9router-proxy 0.5.91 → 0.5.93

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 (1020) hide show
  1. package/README.md +1 -1
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +17 -7
  4. package/app/.next-cli-build/build-manifest.json +3 -3
  5. package/app/.next-cli-build/prerender-manifest.json +20 -20
  6. package/app/.next-cli-build/required-server-files.json +4 -0
  7. package/app/.next-cli-build/routes-manifest.json +65 -0
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -44
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +13 -7
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  91. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  92. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/status/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +19 -5
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -0
  126. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -0
  127. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route_client-reference-manifest.js +1 -0
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  131. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -0
  139. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -0
  140. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route_client-reference-manifest.js +1 -0
  141. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -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/forge-settings/route.js +1 -0
  148. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -0
  149. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route_client-reference-manifest.js +1 -0
  150. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  155. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  157. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +16 -0
  159. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -0
  160. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route_client-reference-manifest.js +1 -0
  161. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  162. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -0
  166. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -0
  167. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route_client-reference-manifest.js +1 -0
  168. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -0
  169. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -0
  170. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route_client-reference-manifest.js +1 -0
  171. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -0
  174. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -0
  175. package/app/.next-cli-build/server/app/api/combos/presets/route_client-reference-manifest.js +1 -0
  176. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  203. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  259. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -0
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -0
  262. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route_client-reference-manifest.js +1 -0
  263. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -0
  264. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -0
  265. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route_client-reference-manifest.js +1 -0
  266. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  299. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  301. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +8 -7
  305. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  309. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  311. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  313. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  315. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  317. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  319. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  321. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  337. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  359. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  379. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -0
  413. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -0
  414. package/app/.next-cli-build/server/app/api/v1/systemone/route_client-reference-manifest.js +1 -0
  415. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  436. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  438. package/app/.next-cli-build/server/app/callback.html +1 -1
  439. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  440. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  441. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +6 -6
  443. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  445. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
  446. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  447. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
  450. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  451. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  452. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  453. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  455. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  456. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  457. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  460. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  461. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  462. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  465. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +7 -7
  466. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  467. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  468. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  470. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  472. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  475. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  476. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  477. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  478. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  480. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  481. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  482. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  485. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  486. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  487. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  488. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  490. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  491. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  492. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  493. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +7 -7
  495. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +7 -7
  496. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
  497. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  500. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  501. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  502. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  506. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  508. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  510. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  511. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  513. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
  514. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  515. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  516. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  517. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  518. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +7 -7
  519. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  520. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  523. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +7 -7
  524. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  525. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  526. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  527. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  528. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  529. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  530. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  532. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  533. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  534. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  535. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  536. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  537. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  538. package/app/.next-cli-build/server/app/index.html +1 -1
  539. package/app/.next-cli-build/server/app/index.rsc +5 -5
  540. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  541. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  542. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  544. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  545. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  546. package/app/.next-cli-build/server/app/landing.html +1 -1
  547. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  548. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  549. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  550. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  551. package/app/.next-cli-build/server/app/login/page.js +1 -1
  552. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  553. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  554. package/app/.next-cli-build/server/app/login.html +1 -1
  555. package/app/.next-cli-build/server/app/login.rsc +6 -6
  556. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  557. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
  559. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  560. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  561. package/app/.next-cli-build/server/app/page.js +1 -1
  562. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  563. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  564. package/app/.next-cli-build/server/app-paths-manifest.json +17 -7
  565. package/app/.next-cli-build/server/chunks/1220.js +1 -1
  566. package/app/.next-cli-build/server/chunks/1679.js +1 -0
  567. package/app/.next-cli-build/server/chunks/1839.js +1 -1
  568. package/app/.next-cli-build/server/chunks/2132.js +1 -0
  569. package/app/.next-cli-build/server/chunks/2220.js +1 -0
  570. package/app/.next-cli-build/server/chunks/2329.js +1 -0
  571. package/app/.next-cli-build/server/chunks/24.js +1 -1
  572. package/app/.next-cli-build/server/chunks/{5285.js → 2778.js} +63 -45
  573. package/app/.next-cli-build/server/chunks/2870.js +1 -1
  574. package/app/.next-cli-build/server/chunks/3726.js +1 -1
  575. package/app/.next-cli-build/server/chunks/3933.js +67 -0
  576. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  577. package/app/.next-cli-build/server/chunks/3966.js +44 -0
  578. package/app/.next-cli-build/server/chunks/4049.js +1 -1
  579. package/app/.next-cli-build/server/chunks/412.js +2 -2
  580. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  581. package/app/.next-cli-build/server/chunks/436.js +1 -1
  582. package/app/.next-cli-build/server/chunks/4572.js +1 -1
  583. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  584. package/app/.next-cli-build/server/chunks/4882.js +1 -0
  585. package/app/.next-cli-build/server/chunks/4884.js +1 -1
  586. package/app/.next-cli-build/server/chunks/5026.js +1 -1
  587. package/app/.next-cli-build/server/chunks/5081.js +3 -3
  588. package/app/.next-cli-build/server/chunks/{318.js → 5330.js} +13 -17
  589. package/app/.next-cli-build/server/chunks/5615.js +2 -2
  590. package/app/.next-cli-build/server/chunks/6022.js +1 -0
  591. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  592. package/app/.next-cli-build/server/chunks/614.js +2 -2
  593. package/app/.next-cli-build/server/chunks/6140.js +1 -0
  594. package/app/.next-cli-build/server/chunks/615.js +1 -1
  595. package/app/.next-cli-build/server/chunks/6249.js +9 -0
  596. package/app/.next-cli-build/server/chunks/6922.js +1 -1
  597. package/app/.next-cli-build/server/chunks/6984.js +1 -0
  598. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  599. package/app/.next-cli-build/server/chunks/7220.js +1 -1
  600. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  601. package/app/.next-cli-build/server/chunks/7525.js +1 -0
  602. package/app/.next-cli-build/server/chunks/7557.js +1 -0
  603. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  604. package/app/.next-cli-build/server/chunks/7843.js +1 -1
  605. package/app/.next-cli-build/server/chunks/{1329.js → 7913.js} +2 -2
  606. package/app/.next-cli-build/server/chunks/7995.js +120 -0
  607. package/app/.next-cli-build/server/chunks/8306.js +1 -0
  608. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  609. package/app/.next-cli-build/server/chunks/8416.js +1 -1
  610. package/app/.next-cli-build/server/chunks/8499.js +12 -12
  611. package/app/.next-cli-build/server/chunks/8635.js +1 -1
  612. package/app/.next-cli-build/server/chunks/869.js +1 -1
  613. package/app/.next-cli-build/server/chunks/8895.js +7 -7
  614. package/app/.next-cli-build/server/chunks/9128.js +1 -1
  615. package/app/.next-cli-build/server/chunks/9402.js +1 -1
  616. package/app/.next-cli-build/server/chunks/9609.js +1 -0
  617. package/app/.next-cli-build/server/chunks/9820.js +1 -1
  618. package/app/.next-cli-build/server/instrumentation.js +1 -1
  619. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  620. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  621. package/app/.next-cli-build/server/middleware.js +15 -9
  622. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  623. package/app/.next-cli-build/server/pages/404.html +1 -1
  624. package/app/.next-cli-build/server/pages/500.html +1 -1
  625. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  626. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  627. package/app/.next-cli-build/static/chunks/1321-cf36a770081d8f23.js +1 -0
  628. package/app/.next-cli-build/static/chunks/2997-559e004193f2a2ee.js +67 -0
  629. package/app/.next-cli-build/static/chunks/5497-36e813c2e3b2fc3a.js +7 -0
  630. package/app/.next-cli-build/static/chunks/{6656-121cb868356b8115.js → 6447-706004106e6d03ff.js} +28 -10
  631. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-bf62957e6bf0c9b6.js → page-ca89dcf426c74779.js} +1 -1
  632. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-d721aa02fd6dc229.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-49227e9571ca75ee.js → page-380f1b80350b23b4.js} +1 -1
  634. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-663f892bfb9c79d1.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-5ce7e708e65d7ed2.js → page-cfcb45884632a585.js} +1 -1
  636. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-d9dba7b1a84d7b1b.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-452f4c039beb1ff0.js → page-a40d84d4f27edd8a.js} +18 -12
  638. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-fe79c701b0256560.js → page-d7b40543599e82bf.js} +1 -1
  639. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-c20828e9f181b48c.js → page-cbb1ba118b052f0e.js} +1 -1
  640. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-1eaf569d16f5fc95.js → page-fbbaf3ed3a147133.js} +1 -1
  641. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-991110e90ac5b7ca.js → page-e0f49f53559a4932.js} +1 -1
  642. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-3d29afe881b86a20.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-1707a43605025629.js → page-558ba86898d31c4a.js} +1 -1
  644. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-8835852736fc1ecb.js → page-b0d2c45144e80fdd.js} +2 -2
  645. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-378e16c550d6670d.js → page-0a7d4e1b0ca385bc.js} +1 -1
  646. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-534cf66a5d57f5da.js → page-8e2af722266f9488.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-9afa902610df6eda.js → page-3a34726f76033b40.js} +1 -1
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-930edc3414aefb99.js → page-c13245238182b386.js} +1 -1
  649. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-11ffcf8f72ed0519.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-ff4999c854469b73.js → page-8ec563b885652f2b.js} +1 -1
  651. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-a5ed9cd2ec340299.js → page-56c7545e40d9ec94.js} +1 -1
  652. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-074f26128db0c704.js → page-0e367c183e161fca.js} +1 -1
  653. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-a802ce8ca6fa34c3.js → page-63854721fb4ee44d.js} +1 -1
  654. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-1e553b4323bf7053.js → layout-528881684d589195.js} +1 -1
  655. package/app/.next-cli-build/static/chunks/app/_global-error/page-8d5a053022fc1e16.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-8d5a053022fc1e16.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-8d5a053022fc1e16.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-8d5a053022fc1e16.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-8d5a053022fc1e16.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-8d5a053022fc1e16.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-8d5a053022fc1e16.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-8d5a053022fc1e16.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-8d5a053022fc1e16.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-8d5a053022fc1e16.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-8d5a053022fc1e16.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-8d5a053022fc1e16.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-8d5a053022fc1e16.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-8d5a053022fc1e16.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-8d5a053022fc1e16.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-8d5a053022fc1e16.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-8d5a053022fc1e16.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-8d5a053022fc1e16.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-8d5a053022fc1e16.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-8d5a053022fc1e16.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-8d5a053022fc1e16.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-8d5a053022fc1e16.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-8d5a053022fc1e16.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-8d5a053022fc1e16.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-8d5a053022fc1e16.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-8d5a053022fc1e16.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-8d5a053022fc1e16.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-8d5a053022fc1e16.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-8d5a053022fc1e16.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-8d5a053022fc1e16.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-8d5a053022fc1e16.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-8d5a053022fc1e16.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-8d5a053022fc1e16.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-8d5a053022fc1e16.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-8d5a053022fc1e16.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-8d5a053022fc1e16.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-8d5a053022fc1e16.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-8d5a053022fc1e16.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-8d5a053022fc1e16.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/combos/route-8d5a053022fc1e16.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-8d5a053022fc1e16.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-8d5a053022fc1e16.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-8d5a053022fc1e16.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-8d5a053022fc1e16.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-8d5a053022fc1e16.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-8d5a053022fc1e16.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/health/route-8d5a053022fc1e16.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/init/route-8d5a053022fc1e16.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-8d5a053022fc1e16.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/keys/route-8d5a053022fc1e16.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/locale/route-8d5a053022fc1e16.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-8d5a053022fc1e16.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-8d5a053022fc1e16.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-8d5a053022fc1e16.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-8d5a053022fc1e16.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-8d5a053022fc1e16.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-8d5a053022fc1e16.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-8d5a053022fc1e16.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-8d5a053022fc1e16.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-8d5a053022fc1e16.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-8d5a053022fc1e16.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-8d5a053022fc1e16.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-8d5a053022fc1e16.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/models/route-8d5a053022fc1e16.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/models/test/route-8d5a053022fc1e16.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-8d5a053022fc1e16.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-8d5a053022fc1e16.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-8d5a053022fc1e16.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-8d5a053022fc1e16.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-8d5a053022fc1e16.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-8d5a053022fc1e16.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-8d5a053022fc1e16.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-8d5a053022fc1e16.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-8d5a053022fc1e16.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-8d5a053022fc1e16.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-8d5a053022fc1e16.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-8d5a053022fc1e16.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-8d5a053022fc1e16.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-8d5a053022fc1e16.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-8d5a053022fc1e16.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-8d5a053022fc1e16.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-8d5a053022fc1e16.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-8d5a053022fc1e16.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/pricing/route-8d5a053022fc1e16.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-8d5a053022fc1e16.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-8d5a053022fc1e16.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-8d5a053022fc1e16.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-8d5a053022fc1e16.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-8d5a053022fc1e16.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-8d5a053022fc1e16.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-8d5a053022fc1e16.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-8d5a053022fc1e16.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-8d5a053022fc1e16.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/providers/route-8d5a053022fc1e16.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-8d5a053022fc1e16.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-8d5a053022fc1e16.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-8d5a053022fc1e16.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-8d5a053022fc1e16.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-8d5a053022fc1e16.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-8d5a053022fc1e16.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-8d5a053022fc1e16.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-8d5a053022fc1e16.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-8d5a053022fc1e16.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-8d5a053022fc1e16.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-8d5a053022fc1e16.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-8d5a053022fc1e16.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-8d5a053022fc1e16.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-8d5a053022fc1e16.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-8d5a053022fc1e16.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-8d5a053022fc1e16.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-8d5a053022fc1e16.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-8d5a053022fc1e16.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-8d5a053022fc1e16.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-8d5a053022fc1e16.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/settings/route-8d5a053022fc1e16.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-8d5a053022fc1e16.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/tags/route-8d5a053022fc1e16.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-8d5a053022fc1e16.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-8d5a053022fc1e16.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-8d5a053022fc1e16.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-8d5a053022fc1e16.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-8d5a053022fc1e16.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-8d5a053022fc1e16.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-8d5a053022fc1e16.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-8d5a053022fc1e16.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-8d5a053022fc1e16.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-8d5a053022fc1e16.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-8d5a053022fc1e16.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-8d5a053022fc1e16.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-8d5a053022fc1e16.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-8d5a053022fc1e16.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-8d5a053022fc1e16.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-8d5a053022fc1e16.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-8d5a053022fc1e16.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-8d5a053022fc1e16.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-8d5a053022fc1e16.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-8d5a053022fc1e16.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-8d5a053022fc1e16.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-8d5a053022fc1e16.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-8d5a053022fc1e16.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-8d5a053022fc1e16.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-8d5a053022fc1e16.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-8d5a053022fc1e16.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-8d5a053022fc1e16.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-8d5a053022fc1e16.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-8d5a053022fc1e16.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-8d5a053022fc1e16.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-8d5a053022fc1e16.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-8d5a053022fc1e16.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-8d5a053022fc1e16.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-8d5a053022fc1e16.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-8d5a053022fc1e16.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-8d5a053022fc1e16.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-8d5a053022fc1e16.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/route-8d5a053022fc1e16.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-8d5a053022fc1e16.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-8d5a053022fc1e16.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-8d5a053022fc1e16.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-8d5a053022fc1e16.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-8d5a053022fc1e16.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-8d5a053022fc1e16.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-8d5a053022fc1e16.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-8d5a053022fc1e16.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-8d5a053022fc1e16.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/version/route-8d5a053022fc1e16.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-8d5a053022fc1e16.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/version/update/route-8d5a053022fc1e16.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/callback/{page-ee5f77ef69dd466f.js → page-0c9a644d519e9326.js} +1 -1
  823. package/app/.next-cli-build/static/chunks/app/login/{page-c72141d109a846b7.js → page-660374ffb28a0929.js} +1 -1
  824. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-8d5a053022fc1e16.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/page-8d5a053022fc1e16.js +1 -0
  826. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-8d5a053022fc1e16.js +1 -0
  827. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-8d5a053022fc1e16.js +1 -0
  828. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-8d5a053022fc1e16.js +1 -0
  829. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-8d5a053022fc1e16.js +1 -0
  830. package/app/.next-cli-build/static/chunks/webpack-c156bc04aeb5cff4.js +1 -0
  831. package/app/.next-cli-build/static/css/2fe9cf66a66ec7a4.css +1 -0
  832. package/app/.next-cli-build/static/fya6os1rUlOasqVluXGJu/_buildManifest.js +1 -0
  833. package/app/package.json +1 -1
  834. package/app/public/i18n/literals/zh-CN.json +26 -1
  835. package/app/public/providers/codewhale.svg +9 -0
  836. package/app/public/providers/crush.png +0 -0
  837. package/app/public/providers/forge.png +0 -0
  838. package/app/public/providers/omp.png +0 -0
  839. package/app/public/providers/pi.svg +6 -0
  840. package/app/public/providers/smelt.svg +101 -0
  841. package/app/server.js +1 -1
  842. package/package.json +1 -1
  843. package/app/.next-cli-build/server/chunks/2353.js +0 -1
  844. package/app/.next-cli-build/server/chunks/4665.js +0 -67
  845. package/app/.next-cli-build/server/chunks/8843.js +0 -1
  846. package/app/.next-cli-build/static/chunks/1321-3fc52cd1214bb03c.js +0 -1
  847. package/app/.next-cli-build/static/chunks/4614-64d9cf612b51fb5c.js +0 -67
  848. package/app/.next-cli-build/static/chunks/5497-d304b79683712fc4.js +0 -7
  849. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-e9094f6397e3db32.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-22d499936f64e70d.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-cf249feaa9108a4e.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-b52bdd6de15807fc.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f3e8f3d109886a92.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/_global-error/page-b01550c0e5fd888b.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-b01550c0e5fd888b.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-b01550c0e5fd888b.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-b01550c0e5fd888b.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-b01550c0e5fd888b.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-b01550c0e5fd888b.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-b01550c0e5fd888b.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-b01550c0e5fd888b.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-b01550c0e5fd888b.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-b01550c0e5fd888b.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-b01550c0e5fd888b.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-b01550c0e5fd888b.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-b01550c0e5fd888b.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-b01550c0e5fd888b.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-b01550c0e5fd888b.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-b01550c0e5fd888b.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-b01550c0e5fd888b.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-b01550c0e5fd888b.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-b01550c0e5fd888b.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-b01550c0e5fd888b.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-b01550c0e5fd888b.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-b01550c0e5fd888b.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-b01550c0e5fd888b.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-b01550c0e5fd888b.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-b01550c0e5fd888b.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-b01550c0e5fd888b.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-b01550c0e5fd888b.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-b01550c0e5fd888b.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-b01550c0e5fd888b.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-b01550c0e5fd888b.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-b01550c0e5fd888b.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-b01550c0e5fd888b.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/combos/route-b01550c0e5fd888b.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-b01550c0e5fd888b.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-b01550c0e5fd888b.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-b01550c0e5fd888b.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-b01550c0e5fd888b.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-b01550c0e5fd888b.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-b01550c0e5fd888b.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/health/route-b01550c0e5fd888b.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/init/route-b01550c0e5fd888b.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-b01550c0e5fd888b.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/keys/route-b01550c0e5fd888b.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/locale/route-b01550c0e5fd888b.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-b01550c0e5fd888b.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-b01550c0e5fd888b.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-b01550c0e5fd888b.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-b01550c0e5fd888b.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-b01550c0e5fd888b.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-b01550c0e5fd888b.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-b01550c0e5fd888b.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-b01550c0e5fd888b.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-b01550c0e5fd888b.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-b01550c0e5fd888b.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-b01550c0e5fd888b.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-b01550c0e5fd888b.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/models/route-b01550c0e5fd888b.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/models/test/route-b01550c0e5fd888b.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-b01550c0e5fd888b.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-b01550c0e5fd888b.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-b01550c0e5fd888b.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-b01550c0e5fd888b.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-b01550c0e5fd888b.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-b01550c0e5fd888b.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-b01550c0e5fd888b.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-b01550c0e5fd888b.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-b01550c0e5fd888b.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-b01550c0e5fd888b.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-b01550c0e5fd888b.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-b01550c0e5fd888b.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-b01550c0e5fd888b.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-b01550c0e5fd888b.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-b01550c0e5fd888b.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-b01550c0e5fd888b.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/pricing/route-b01550c0e5fd888b.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-b01550c0e5fd888b.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-b01550c0e5fd888b.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-b01550c0e5fd888b.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-b01550c0e5fd888b.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-b01550c0e5fd888b.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-b01550c0e5fd888b.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-b01550c0e5fd888b.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-b01550c0e5fd888b.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-b01550c0e5fd888b.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/providers/route-b01550c0e5fd888b.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-b01550c0e5fd888b.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-b01550c0e5fd888b.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-b01550c0e5fd888b.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-b01550c0e5fd888b.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-b01550c0e5fd888b.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-b01550c0e5fd888b.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-b01550c0e5fd888b.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-b01550c0e5fd888b.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-b01550c0e5fd888b.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-b01550c0e5fd888b.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-b01550c0e5fd888b.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-b01550c0e5fd888b.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-b01550c0e5fd888b.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-b01550c0e5fd888b.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-b01550c0e5fd888b.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-b01550c0e5fd888b.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-b01550c0e5fd888b.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-b01550c0e5fd888b.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-b01550c0e5fd888b.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-b01550c0e5fd888b.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/settings/route-b01550c0e5fd888b.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-b01550c0e5fd888b.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/tags/route-b01550c0e5fd888b.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-b01550c0e5fd888b.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-b01550c0e5fd888b.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-b01550c0e5fd888b.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-b01550c0e5fd888b.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-b01550c0e5fd888b.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-b01550c0e5fd888b.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-b01550c0e5fd888b.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-b01550c0e5fd888b.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-b01550c0e5fd888b.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-b01550c0e5fd888b.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-b01550c0e5fd888b.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-b01550c0e5fd888b.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-b01550c0e5fd888b.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-b01550c0e5fd888b.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-b01550c0e5fd888b.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-b01550c0e5fd888b.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-b01550c0e5fd888b.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-b01550c0e5fd888b.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-b01550c0e5fd888b.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-b01550c0e5fd888b.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-b01550c0e5fd888b.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-b01550c0e5fd888b.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-b01550c0e5fd888b.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-b01550c0e5fd888b.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-b01550c0e5fd888b.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-b01550c0e5fd888b.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-b01550c0e5fd888b.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-b01550c0e5fd888b.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-b01550c0e5fd888b.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-b01550c0e5fd888b.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-b01550c0e5fd888b.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-b01550c0e5fd888b.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-b01550c0e5fd888b.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-b01550c0e5fd888b.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-b01550c0e5fd888b.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-b01550c0e5fd888b.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-b01550c0e5fd888b.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/v1/route-b01550c0e5fd888b.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-b01550c0e5fd888b.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-b01550c0e5fd888b.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-b01550c0e5fd888b.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-b01550c0e5fd888b.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-b01550c0e5fd888b.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-b01550c0e5fd888b.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-b01550c0e5fd888b.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-b01550c0e5fd888b.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/version/route-b01550c0e5fd888b.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-b01550c0e5fd888b.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/version/update/route-b01550c0e5fd888b.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-b01550c0e5fd888b.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/page-b01550c0e5fd888b.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-b01550c0e5fd888b.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-b01550c0e5fd888b.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-b01550c0e5fd888b.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-b01550c0e5fd888b.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/webpack-bdc3c550d3b2fcae.js +0 -1
  1018. package/app/.next-cli-build/static/css/cbcd55f590b6b587.css +0 -1
  1019. package/app/.next-cli-build/static/uEwEID5S10ZoXoQeQAzdW/_buildManifest.js +0 -1
  1020. /package/app/.next-cli-build/static/{uEwEID5S10ZoXoQeQAzdW → fya6os1rUlOasqVluXGJu}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{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})},80873:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,i,a]=s,l=Number(i),r=void 0===a?null:Number(a);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),a=i?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(a=a.filter(e=>"none"!==e)),a}var w=s(11059),k=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.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 C.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=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||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)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||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"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:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"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:f}),(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}),(0,i.jsx)(c.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:()=>l(f,`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"})]}),n?(0,i.jsx)("button",{onClick:d,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]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"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"===n?"check_circle":"error"===n?"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"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,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:l,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 E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.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 ",u?"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:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"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)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({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 R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolId||null,k=w?j.get(w):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!w||N,S=k?`Pool: ${k.name}`:w?`Pool: ${w} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.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.",T="";if(k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";k?.isActive===!0?O="success":(w||N)&&(O="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,z="cookie"===E,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":z?"Cookie Account":"API Key"),U=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,[K,M]=(0,a.useState)(!1),J=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{M(!!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=J?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[J]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.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:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:z?"cookie":_?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),U&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(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)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":z?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,i.jsx)(D,{until:J}),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]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(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:S,children:S}),T&&(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:T}),$&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(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:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.jsxs)("button",{onClick:()=>h.onToggle(!h.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 ${h.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:p,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:u,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)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{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})},80873:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,i,a]=s,l=Number(i),r=void 0===a?null:Number(a);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),a=i?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(a=a.filter(e=>"none"!==e)),a}var w=s(11059),k=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.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 C.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=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||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)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||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"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:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"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:f}),(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}),(0,i.jsx)(c.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:()=>l(f,`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"})]}),n?(0,i.jsx)("button",{onClick:d,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]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"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"===n?"check_circle":"error"===n?"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"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,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:l,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 E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.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 ",u?"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:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"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)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({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 R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolId||null,k=w?j.get(w):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!w||N,S=k?`Pool: ${k.name}`:w?`Pool: ${w} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.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.",T="";if(k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";k?.isActive===!0?O="success":(w||N)&&(O="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,z="cookie"===E,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":z?"Cookie Account":"API Key"),U=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,[K,M]=(0,a.useState)(!1),J=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{M(!!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=J?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[J]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.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:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:z?"cookie":_?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),U&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(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)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":z?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,i.jsx)(D,{until:J}),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]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(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:S,children:S}),T&&(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:T}),$&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(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:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.jsxs)("button",{onClick:()=>h.onToggle(!h.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 ${h.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:p,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:u,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)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=`name1|sk-key1
2
2
  name2|sk-key2
3
3
  sk-key-only-auto-named`;function z({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.regions||null,S=m.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[$,O]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,E]=(0,a.useState)({accountId:""}),[I,D]=(0,a.useState)(S),[R,q]=(0,a.useState)(!1),[U,K]=(0,a.useState)(null),[M,J]=(0,a.useState)(!1),F=N?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
@@ -24,4 +24,4 @@ pt-only-auto-named`:_,[L,W]=(0,a.useState)("single"),[B,H]=(0,a.useState)(""),[G
24
24
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
25
  "email": "account2@example.com"
26
26
  }
27
- ]`;function L(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function W({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,N.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=L(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,N.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,N.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=L(l)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,N.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,N.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,N.Tl)("Loaded")," ",f.accountsCount," ",(0,N.Tl)("account(s) from")," ",f.filesCount," ",(0,N.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,N.Tl)("failed")]}),w.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:w.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)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}let B={claude:"claudeAutoPing",codex:"codexAutoPing"},H={qoder:"Fetch Qoder Models","qoder-cn":"Fetch Qoder Models","trae-enterprise":"Fetch Trae Enterprise Models",codearts:"Fetch CodeArts Models"};function G(){let e,t,s,r,u,x=(0,l.useParams)(),h=(0,l.useRouter)(),f=x.id,{getCaps:g}=(0,k.y)(),[y,b]=(0,a.useState)([]),[v,C]=(0,a.useState)(!0),[T,$]=(0,a.useState)(null),[P,I]=(0,a.useState)([]),[D,_]=(0,a.useState)(!1),[U,M]=(0,a.useState)(!1),[F,L]=(0,a.useState)(!1),[G,V]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)(""),[X,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),[es,ei]=(0,a.useState)(!1),[ea,el]=(0,a.useState)(!1),[er,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(null),[ec,em]=(0,a.useState)({}),[ep,eu]=(0,a.useState)([]),[ex,eh]=(0,a.useState)(!1),[ef,eg]=(0,a.useState)({}),[ey,eb]=(0,a.useState)(""),[ev,ej]=(0,a.useState)(()=>new Set),[ew,ek]=(0,a.useState)(!1),[eN,eC]=(0,a.useState)([]),[eS,eA]=(0,a.useState)("__none__"),[eT,e$]=(0,a.useState)(!1),[eO,eP]=(0,a.useState)(null),[eE,eI]=(0,a.useState)(""),[eD,eR]=(0,a.useState)("auto"),[e_,ez]=(0,a.useState)({enabled:!1,connections:{}}),[eq,eU]=(0,a.useState)([]),[eK,eM]=(0,a.useState)([]),[eJ,eF]=(0,a.useState)(null),[eL,eW]=(0,a.useState)([]),[eB,eH]=(0,a.useState)([]),[eG,eV]=(0,a.useState)(null),[eQ,eZ]=(0,a.useState)(!1),[eX,eY]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(!1),[e2,e5]=(0,a.useState)(null),[e3,e4]=(0,a.useState)({}),[e6,e8]=(0,a.useState)(null),e7=(0,a.useRef)(!1),[e9,te]=(0,a.useState)(!1),[tt,ts]=(0,a.useState)(!1),{copied:ti,copy:ta}=(0,w.C)(),tl="ag_risk_confirmed",tr=()=>{_(!0)},tn=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tl)?eZ(!0):"xiaomi-mimo"===f?M(!0):tp?tr():(Z(""),V(!0))},to=()=>{Z(""),V(!0)},td=()=>{tp?tn():to()},tc=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tm=tc?.authModes||[],tp=!!m.zN[f]||!!m.IS[f]||tm.includes("oauth"),tu=!!m.fg[f]||tm.includes("apikey"),tx=!!m.IS[f]?.noAuth,th=(0,p.KC)(f),tf=("cursor"===f||"zed"===f)&&eK.length>0?eK:th,tg=(0,m.wG)(f),ty=(0,m.mq)(f),tb=(0,m.gb)(f),tv=ty||tb,tj=!tv&&tp&&tu,tw="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tk="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tN=e=>{if(!eD||"auto"===eD)return null;let t=j(f,e);return t&&t.includes(eD)?eD:null},tC=tv?f:tg,tS=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=j(f,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tf)s(e.id);for(let e of eL)s(e.id);for(let e of ep)e.providerAlias===tC&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tA=tv?T?.prefix||f:tg,tT=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}`,{cache:"no-store"}),t=await e.json();e.ok&&eH(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tC]),t$=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tC,ids:[e]})})).ok&&await tT()}catch(e){console.log("Error disabling model:",e)}},tO=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error enabling model:",e)}},tP=async e=>{e.length&&eV({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eV(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tC,ids:e})})).ok&&await tT()}catch(e){console.log("Error disabling all models:",e)}}})},tE=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error enabling all models:",e)}},tI=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&em(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tD=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eu(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eW(e.models)}).catch(()=>{})},[f]);let tR=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),l=await t.json(),r=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===f);b(e)}s.ok&&I(r.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};eP(o.fallbackStrategy||null),eI(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eR(d.mode||"auto");let c=B[f],m=c&&n[c]||{};if(ez({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===f)||null;if(!e&&tv)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===f)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[f,tv]),t_=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&($(s.node),await tR(),el(!1))}catch(e){console.log("Error updating provider node:",e)}},tz=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 l={...i};0===Object.keys(a).length?delete l[f]:l[f]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tq=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tU=async e=>{let t=B[f];if(t){ez(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tR(),tI(),tD(),tT()},[tR,tI,tD,tT]),(0,a.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eM([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eM([]),"zed"===f&&eF(null);return}let t=!1;return"zed"===f&&eF(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eM(s.models),"zed"===f&&s?.warning&&eF(s.warning);return}"zed"===f&&(eM([]),eF(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eM([]),eF("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,a.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&S(e).then(eU)},[f]);let tK=async(e,t,s=tg)=>{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 tI();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tM=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tI()}catch(e){console.log("Error deleting alias:",e)}},tJ=async(e,t="llm",s=tC,i)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{}})});if(a.ok)await tD(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tF=async(e,t="llm",s=tC)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tD(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tL=async()=>{if(e9)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active connection first"));te(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=`${f}/`,i=t.startsWith(s)?t.slice(s.length):t;ep.some(e=>e.providerAlias===tC&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tC}/${i}`)||(await tJ(i,"llm",tC),a+=1)}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing live models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{te(!1)}},tW=async()=>{if(tt)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Cline connection first"));ts(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(ep.some(e=>e.providerAlias===tC&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tC}/${t}`)||(await tJ(t,"llm",tC),a+=1))}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{ts(!1)}},tB=async()=>{if(eX||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));e7.current=!1,eY(!0),e1(!1),e5(null),e4(e),e8({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(e7.current){e8({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=y[e];e5(i.id),e4(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,e4(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,e4(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e8({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e5(null),eY(!1),e1(!1),e7.current=!1}},tH=async e=>{eV({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eV(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tG=()=>{tR(),_(!1)},tV=async e=>{Z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tR(),V(!1);return}Z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Z("Failed to save connection")}},tQ=async e=>{try{(await fetch(`/api/providers/${eo.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tR(),ei(!1))}catch(e){console.log("Error updating connection:",e)}},tZ=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tX=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tR()}},tY=y.filter(e=>eN.includes(e.id)),t0=y.length>0&&eN.length===y.length;(0,a.useEffect)(()=>{eC(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===tY.length)return;let e=new Set(tY.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=P.find(e=>e.id===t);return s?.name}})();let t1=()=>{eT||en(!1)},t2=async e=>{e$(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tR(),en(!1)}finally{e$(!1)}},t5=e=>t2(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),t3=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:y.map((e,t)=>{let s;return(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:(s=e.id,eN.includes(s)),onChange:()=>{var t;return t=e.id,void eC(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)(R,{connection:e,proxyPools:P,isOAuth:tp,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>tX(t,t-1),onMoveDown:()=>tX(t,t+1),onToggleActive:t=>tZ(e.id,t),autoPing:B[f]&&"oauth"===e.authType?{on:!0===e_.connections[e.id],onToggle:t=>{var s;return s=e.id,void tU({...e_,connections:{...e_.connections,[s]:t}})},provider:f}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ed(e),ei(!0)},onDelete:()=>tH(e.id),oneByOneStatus:e3[e.id]||null})})]},e.id)})}),t4=P.filter(e=>!0===e.isActive),t6=(0,i.jsx)(c.aF,{isOpen:er,onClose:t1,title:`Apply Proxy (${y.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=P.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t2(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eT||0===t4.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>t5(null),disabled:eT,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),P.map(e=>(0,i.jsxs)("button",{onClick:()=>t5(e.id),disabled:eT||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eT&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t1,variant:"ghost",fullWidth:!0,disabled:eT,children:"Cancel"})]})}),t8=async e=>{if(!ev.has(e)){ej(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:`${tC}/${e}`})}),s=await t.json();eg(t=>({...t,[e]:s.ok?"ok":"error"})),eb(s.ok?"":s.error||"Model not reachable")}catch{eg(t=>({...t,[e]:"error"})),eb("Network error")}finally{ej(t=>{let s=new Set(t);return s.delete(e),s})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tc)return(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)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let t7=()=>ty&&tc.apiType?"responses"===tc.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tb?"/providers/anthropic-m.png":(0,d.HY)(tc.id);return(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)(n(),{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:`${tc.color}15`},children:ex||!t7()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tc.color},children:tc.textIcon||tc.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:t7(),alt:tc.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tc.id),eh(!0)},loading:"lazy",decoding:"async"})}),(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:tc.name}),(tc.notice?.apiKeyUrl||tc.notice?.signupUrl||tc.website)&&(0,i.jsxs)("a",{href:tc.notice?.apiKeyUrl||tc.notice?.signupUrl||tc.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"}),tc.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),tc.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:tc.deprecationNotice})]}),tc.notice?.text&&!tc.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:tc.notice.text}),tc.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tc.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 →"})]}),tv&&T&&(0,i.jsx)(c.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:tb?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tb?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tb?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Z(""),V(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>el(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eV({title:"Delete Compatible Node",message:`Delete this ${tb?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eV(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tx?(0,i.jsx)(c.gw,{providerId:f}):(0,i.jsxs)(c.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:[y.length>0&&P.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>en(!0),children:"Apply Proxy"}),y.length>0&&(0,i.jsxs)(i.Fragment,{children:[eN.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eN.length;0!==e&&eV({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eV(null);let e=0,t=[...eN];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eC([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eN.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tB,disabled:eX,children:eX?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eX&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eX&&(e7.current=!0,e1(!0))},disabled:e0,children:e0?"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)(c.lM,{checked:"round-robin"===eO,onChange:e=>{let t=e?"round-robin":null,s=e?eE||"1":eE;e&&!eE&&eI("1"),eP(t),tz(t,s)}}),"round-robin"===eO&&(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:eE,onChange:e=>{var t;eI(t=e.target.value),tz("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===y.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:tp?"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"}),tj&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tw," or ",tk,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tj?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tn,children:tw}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:to,children:tk})]}):(0,i.jsxs)(i.Fragment,{children:[!tv&&"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>L(!0),children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,N.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>et(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:td,children:tv?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e6&&(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: ",e6.total]}),(0,i.jsxs)("span",{children:["Completed: ",e6.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e6.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e6.failed]}),e6.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eX&&e2&&(0,i.jsxs)("span",{children:["Running: ",y.find(e=>e.id===e2)?.name||e2]})]})}),y.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:t0,onChange:()=>{t0?eC([]):eC(y.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!tv&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>L(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>et(!0),title:(0,N.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tj?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tn,className:"w-full sm:w-auto",children:tw}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:to,className:"w-full sm:w-auto",children:tk})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:td,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.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"}),tS&&(0,i.jsx)("select",{value:eD,onChange:e=>{var t;eR(t=e.target.value),tq(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:tS.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tv&&(e=[...tf,...eL.filter(e=>!tf.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eB.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eB.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tE,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tP(e),children:"Disable All"})]}))]}),!!ey&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:ey}),/RegionError|hosted in China|regionNotAllowed/i.test(ey)&&(s=(t="string"==typeof ey?ey:JSON.stringify(ey)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,i.jsx)("div",{className:"mt-1.5",children:(0,i.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,i.jsx)("span",{children:"Allow China-hosted models"}),(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eJ&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eJ}),(()=>{let e,t,s;if(tv)return(0,i.jsx)(E,{providerStorageAlias:tC,providerDisplayAlias:tA,modelAliases:ec,customModels:ep,copied:ti,onCopy:ta,onSetAlias:tK,onDeleteAlias:tM,onAddCustomModel:e=>tJ(e,"llm",tC),onDeleteCustomModel:e=>tF(e,"llm",tC),connections:y,isAnthropic:tb});let a=[...tf,...eL.filter(e=>!tf.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eB),r=a.filter(e=>!l.has(e.id)),n=a.filter(e=>l.has(e.id)),o=A({customModels:ep,modelAliases:ec,providerAlias:tC,builtInModels:tf,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:`${tA}/${e.id}`,alias:e.alias,copied:ti,onCopy:ta,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tF(e.id,"llm",tC):tM(e.alias)},testStatus:ef[e.id],onTest:y.length>0||tx?()=>t8(e.id):void 0,isTesting:ev.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tN(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tC}/${e.id}`,s=`${f}/${e.id}`,a=Object.entries(ec).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(O,{model:e,fullModel:`${tA}/${e.id}`,alias:a,copied:ti,onCopy:ta,onSetAlias:t=>tK(e.id,t,tC),onDeleteAlias:()=>tM(a),testStatus:ef[e.id],onTest:y.length>0||tx?()=>t8(e.id):void 0,isTesting:ev.has(e.id),isFree:e.isFree,onDisable:()=>t$(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tN(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ek(!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"]}),H[f]&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tL,disabled:e9,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e9?{animation:"spin 1s linear infinite"}:void 0,children:e9?"progress_activity":"download"}),e9?(0,N.Tl)("Fetching..."):(0,N.Tl)(H[f])]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tW,disabled:tt,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:tt?{animation:"spin 1s linear infinite"}:void 0,children:tt?"progress_activity":"download"}),tt?(0,N.Tl)("Fetching..."):(0,N.Tl)("Import from /models")]}),eq.length>0&&(e=new Set([...Object.values(ec),...o.map(e=>e.fullModel)]),t=new Set(tf.map(e=>e.id)),0===(s=eq.filter(s=>!e.has(`${tC}/${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 models:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tJ(e.id,"llm",tC)},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.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.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 (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>tO(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))})]})]})})()]}),t6,"kiro"===f?(0,i.jsx)(c.Mh,{isOpen:D,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}):"cursor"===f?(0,i.jsx)(c.G9,{isOpen:D,onSuccess:tG,onClose:()=>_(!1)}):"gitlab"===f?(0,i.jsx)(c.vj,{isOpen:D,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}):(0,i.jsx)(c.LF,{isOpen:D,provider:f,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}),(0,i.jsx)(c.LH,{isOpen:U,onSuccess:tG,onClose:()=>M(!1)}),"iflow"===f&&(0,i.jsx)(c.vE,{isOpen:F,onSuccess:()=>{tR(),L(!1)},onClose:()=>L(!1)}),(0,i.jsx)(z,{isOpen:G,provider:f,providerName:tc.name,isCompatible:tv,isAnthropic:tb,authType:tc?.authType,authHint:tc?.authHint,website:tc?.website,proxyPools:P,error:Q,existingNames:y.map(e=>e.name).filter(Boolean),onSave:tV,onBulkDone:tR,onClose:()=>{Z(""),V(!1)}}),(0,i.jsx)(c.wI,{isOpen:es,connection:eo,proxyPools:P,onSave:tQ,onClose:()=>ei(!1)}),tv&&(0,i.jsx)(q,{isOpen:ea,node:T,onSave:t_,onClose:()=>el(!1),isAnthropic:tb}),!tv&&(0,i.jsx)(K,{isOpen:ew,providerAlias:tC,providerDisplayAlias:tA,onSave:async(e,t)=>{await tJ(e,"llm",tC,t),ek(!1)},onClose:()=>ek(!1)}),"codex"===f&&(0,i.jsx)(J,{isOpen:X,onClose:()=>Y(!1),onSuccess:tR}),"grok-cli"===f&&(0,i.jsx)(W,{isOpen:ee,onClose:()=>et(!1),onSuccess:tR}),(0,i.jsx)(c.uo,{isOpen:eQ,onClose:()=>eZ(!1),onConfirm:()=>{(window.localStorage.setItem(tl,"true"),eZ(!1),tp)?tr():to()},title:"Risk Notice",message:tc?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eG,onClose:()=>eV(null),onConfirm:eG?.onConfirm,title:eG?.title||"Confirm",message:eG?.message,variant:"danger"})]})}},82837:(e,t,s)=>{Promise.resolve().then(s.bind(s,80873))}},e=>{e.O(0,[4614,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=82837)),_N_E=e.O()}]);
27
+ ]`;function L(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function W({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,N.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=L(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,N.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,N.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=L(l)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,N.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,N.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,N.Tl)("Loaded")," ",f.accountsCount," ",(0,N.Tl)("account(s) from")," ",f.filesCount," ",(0,N.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,N.Tl)("failed")]}),w.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:w.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)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}let B={claude:"claudeAutoPing",codex:"codexAutoPing"},H={qoder:"Fetch Qoder Models","qoder-cn":"Fetch Qoder Models","trae-enterprise":"Fetch Trae Enterprise Models",codearts:"Fetch CodeArts Models"};function G(){let e,t,s,r,u,x=(0,l.useParams)(),h=(0,l.useRouter)(),f=x.id,{getCaps:g}=(0,k.y)(),[y,b]=(0,a.useState)([]),[v,C]=(0,a.useState)(!0),[T,$]=(0,a.useState)(null),[P,I]=(0,a.useState)([]),[D,_]=(0,a.useState)(!1),[U,M]=(0,a.useState)(!1),[F,L]=(0,a.useState)(!1),[G,V]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)(""),[X,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),[es,ei]=(0,a.useState)(!1),[ea,el]=(0,a.useState)(!1),[er,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(null),[ec,em]=(0,a.useState)({}),[ep,eu]=(0,a.useState)([]),[ex,eh]=(0,a.useState)(!1),[ef,eg]=(0,a.useState)({}),[ey,eb]=(0,a.useState)(""),[ev,ej]=(0,a.useState)(()=>new Set),[ew,ek]=(0,a.useState)(!1),[eN,eC]=(0,a.useState)([]),[eS,eA]=(0,a.useState)("__none__"),[eT,e$]=(0,a.useState)(!1),[eO,eP]=(0,a.useState)(null),[eE,eI]=(0,a.useState)(""),[eD,eR]=(0,a.useState)("auto"),[e_,ez]=(0,a.useState)({enabled:!1,connections:{}}),[eq,eU]=(0,a.useState)([]),[eK,eM]=(0,a.useState)([]),[eJ,eF]=(0,a.useState)(null),[eL,eW]=(0,a.useState)([]),[eB,eH]=(0,a.useState)([]),[eG,eV]=(0,a.useState)(null),[eQ,eZ]=(0,a.useState)(!1),[eX,eY]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(!1),[e2,e5]=(0,a.useState)(null),[e3,e4]=(0,a.useState)({}),[e6,e8]=(0,a.useState)(null),e7=(0,a.useRef)(!1),[e9,te]=(0,a.useState)(!1),[tt,ts]=(0,a.useState)(!1),{copied:ti,copy:ta}=(0,w.C)(),tl="ag_risk_confirmed",tr=()=>{_(!0)},tn=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tl)?eZ(!0):"xiaomi-mimo"===f?M(!0):tp?tr():(Z(""),V(!0))},to=()=>{Z(""),V(!0)},td=()=>{tp?tn():to()},tc=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tm=tc?.authModes||[],tp=!!m.zN[f]||!!m.IS[f]||tm.includes("oauth"),tu=!!m.fg[f]||tm.includes("apikey"),tx=!!m.IS[f]?.noAuth,th=(0,p.KC)(f),tf=("cursor"===f||"zed"===f)&&eK.length>0?eK:th,tg=(0,m.wG)(f),ty=(0,m.mq)(f),tb=(0,m.gb)(f),tv=ty||tb,tj=!tv&&tp&&tu,tw="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tk="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tN=e=>{if(!eD||"auto"===eD)return null;let t=j(f,e);return t&&t.includes(eD)?eD:null},tC=tv?f:tg,tS=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=j(f,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tf)s(e.id);for(let e of eL)s(e.id);for(let e of ep)e.providerAlias===tC&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tA=tv?T?.prefix||f:tg,tT=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}`,{cache:"no-store"}),t=await e.json();e.ok&&eH(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tC]),t$=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tC,ids:[e]})})).ok&&await tT()}catch(e){console.log("Error disabling model:",e)}},tO=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error enabling model:",e)}},tP=async e=>{e.length&&eV({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eV(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tC,ids:e})})).ok&&await tT()}catch(e){console.log("Error disabling all models:",e)}}})},tE=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tC)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error enabling all models:",e)}},tI=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&em(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tD=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eu(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eW(e.models)}).catch(()=>{})},[f]);let tR=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),l=await t.json(),r=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===f);b(e)}s.ok&&I(r.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};eP(o.fallbackStrategy||null),eI(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eR(d.mode||"auto");let c=B[f],m=c&&n[c]||{};if(ez({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===f)||null;if(!e&&tv)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===f)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[f,tv]),t_=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&($(s.node),await tR(),el(!1))}catch(e){console.log("Error updating provider node:",e)}},tz=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 l={...i};0===Object.keys(a).length?delete l[f]:l[f]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tq=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tU=async e=>{let t=B[f];if(t){ez(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tR(),tI(),tD(),tT()},[tR,tI,tD,tT]),(0,a.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eM([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eM([]),"zed"===f&&eF(null);return}let t=!1;return"zed"===f&&eF(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eM(s.models),"zed"===f&&s?.warning&&eF(s.warning);return}"zed"===f&&(eM([]),eF(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eM([]),eF("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,a.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&S(e).then(eU)},[f]);let tK=async(e,t,s=tg)=>{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 tI();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tM=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tI()}catch(e){console.log("Error deleting alias:",e)}},tJ=async(e,t="llm",s=tC,i)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{}})});if(a.ok)await tD(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tF=async(e,t="llm",s=tC)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tD(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tL=async()=>{if(e9)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active connection first"));te(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=`${f}/`,i=t.startsWith(s)?t.slice(s.length):t;ep.some(e=>e.providerAlias===tC&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tC}/${i}`)||(await tJ(i,"llm",tC),a+=1)}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing live models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{te(!1)}},tW=async()=>{if(tt)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Cline connection first"));ts(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(ep.some(e=>e.providerAlias===tC&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tC}/${t}`)||(await tJ(t,"llm",tC),a+=1))}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{ts(!1)}},tB=async()=>{if(eX||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));e7.current=!1,eY(!0),e1(!1),e5(null),e4(e),e8({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(e7.current){e8({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=y[e];e5(i.id),e4(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,e4(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,e4(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e8({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e5(null),eY(!1),e1(!1),e7.current=!1}},tH=async e=>{eV({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eV(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tG=()=>{tR(),_(!1)},tV=async e=>{Z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tR(),V(!1);return}Z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Z("Failed to save connection")}},tQ=async e=>{try{(await fetch(`/api/providers/${eo.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tR(),ei(!1))}catch(e){console.log("Error updating connection:",e)}},tZ=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tX=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tR()}},tY=y.filter(e=>eN.includes(e.id)),t0=y.length>0&&eN.length===y.length;(0,a.useEffect)(()=>{eC(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===tY.length)return;let e=new Set(tY.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=P.find(e=>e.id===t);return s?.name}})();let t1=()=>{eT||en(!1)},t2=async e=>{e$(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tR(),en(!1)}finally{e$(!1)}},t5=e=>t2(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),t3=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:y.map((e,t)=>{let s;return(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:(s=e.id,eN.includes(s)),onChange:()=>{var t;return t=e.id,void eC(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)(R,{connection:e,proxyPools:P,isOAuth:tp,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>tX(t,t-1),onMoveDown:()=>tX(t,t+1),onToggleActive:t=>tZ(e.id,t),autoPing:B[f]&&"oauth"===e.authType?{on:!0===e_.connections[e.id],onToggle:t=>{var s;return s=e.id,void tU({...e_,connections:{...e_.connections,[s]:t}})},provider:f}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ed(e),ei(!0)},onDelete:()=>tH(e.id),oneByOneStatus:e3[e.id]||null})})]},e.id)})}),t4=P.filter(e=>!0===e.isActive),t6=(0,i.jsx)(c.aF,{isOpen:er,onClose:t1,title:`Apply Proxy (${y.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=P.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t2(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eT||0===t4.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>t5(null),disabled:eT,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),P.map(e=>(0,i.jsxs)("button",{onClick:()=>t5(e.id),disabled:eT||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eT&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t1,variant:"ghost",fullWidth:!0,disabled:eT,children:"Cancel"})]})}),t8=async e=>{if(!ev.has(e)){ej(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:`${tC}/${e}`})}),s=await t.json();eg(t=>({...t,[e]:s.ok?"ok":"error"})),eb(s.ok?"":s.error||"Model not reachable")}catch{eg(t=>({...t,[e]:"error"})),eb("Network error")}finally{ej(t=>{let s=new Set(t);return s.delete(e),s})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tc)return(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)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let t7=()=>ty&&tc.apiType?"responses"===tc.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tb?"/providers/anthropic-m.png":(0,d.HY)(tc.id);return(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)(n(),{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:`${tc.color}15`},children:ex||!t7()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tc.color},children:tc.textIcon||tc.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:t7(),alt:tc.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tc.id),eh(!0)},loading:"lazy",decoding:"async"})}),(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:tc.name}),(tc.notice?.apiKeyUrl||tc.notice?.signupUrl||tc.website)&&(0,i.jsxs)("a",{href:tc.notice?.apiKeyUrl||tc.notice?.signupUrl||tc.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"}),tc.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),tc.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:tc.deprecationNotice})]}),tc.notice?.text&&!tc.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:tc.notice.text}),tc.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tc.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 →"})]}),tv&&T&&(0,i.jsx)(c.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:tb?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tb?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tb?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Z(""),V(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>el(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eV({title:"Delete Compatible Node",message:`Delete this ${tb?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eV(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tx?(0,i.jsx)(c.gw,{providerId:f}):(0,i.jsxs)(c.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:[y.length>0&&P.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>en(!0),children:"Apply Proxy"}),y.length>0&&(0,i.jsxs)(i.Fragment,{children:[eN.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eN.length;0!==e&&eV({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eV(null);let e=0,t=[...eN];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eC([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eN.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tB,disabled:eX,children:eX?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eX&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eX&&(e7.current=!0,e1(!0))},disabled:e0,children:e0?"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)(c.lM,{checked:"round-robin"===eO,onChange:e=>{let t=e?"round-robin":null,s=e?eE||"1":eE;e&&!eE&&eI("1"),eP(t),tz(t,s)}}),"round-robin"===eO&&(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:eE,onChange:e=>{var t;eI(t=e.target.value),tz("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===y.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:tp?"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"}),tj&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tw," or ",tk,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tj?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tn,children:tw}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:to,children:tk})]}):(0,i.jsxs)(i.Fragment,{children:[!tv&&"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>L(!0),children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,N.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>et(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:td,children:tv?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e6&&(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: ",e6.total]}),(0,i.jsxs)("span",{children:["Completed: ",e6.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e6.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e6.failed]}),e6.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eX&&e2&&(0,i.jsxs)("span",{children:["Running: ",y.find(e=>e.id===e2)?.name||e2]})]})}),y.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:t0,onChange:()=>{t0?eC([]):eC(y.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!tv&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>L(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>et(!0),title:(0,N.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tj?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tn,className:"w-full sm:w-auto",children:tw}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:to,className:"w-full sm:w-auto",children:tk})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:td,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.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"}),tS&&(0,i.jsx)("select",{value:eD,onChange:e=>{var t;eR(t=e.target.value),tq(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:tS.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tv&&(e=[...tf,...eL.filter(e=>!tf.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eB.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eB.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tE,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tP(e),children:"Disable All"})]}))]}),!!ey&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:ey}),/RegionError|hosted in China|regionNotAllowed/i.test(ey)&&(s=(t="string"==typeof ey?ey:JSON.stringify(ey)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,i.jsx)("div",{className:"mt-1.5",children:(0,i.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,i.jsx)("span",{children:"Allow China-hosted models"}),(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eJ&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eJ}),(()=>{let e,t,s;if(tv)return(0,i.jsx)(E,{providerStorageAlias:tC,providerDisplayAlias:tA,modelAliases:ec,customModels:ep,copied:ti,onCopy:ta,onSetAlias:tK,onDeleteAlias:tM,onAddCustomModel:e=>tJ(e,"llm",tC),onDeleteCustomModel:e=>tF(e,"llm",tC),connections:y,isAnthropic:tb});let a=[...tf,...eL.filter(e=>!tf.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eB),r=a.filter(e=>!l.has(e.id)),n=a.filter(e=>l.has(e.id)),o=A({customModels:ep,modelAliases:ec,providerAlias:tC,builtInModels:tf,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:`${tA}/${e.id}`,alias:e.alias,copied:ti,onCopy:ta,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tF(e.id,"llm",tC):tM(e.alias)},testStatus:ef[e.id],onTest:y.length>0||tx?()=>t8(e.id):void 0,isTesting:ev.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tN(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tC}/${e.id}`,s=`${f}/${e.id}`,a=Object.entries(ec).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(O,{model:e,fullModel:`${tA}/${e.id}`,alias:a,copied:ti,onCopy:ta,onSetAlias:t=>tK(e.id,t,tC),onDeleteAlias:()=>tM(a),testStatus:ef[e.id],onTest:y.length>0||tx?()=>t8(e.id):void 0,isTesting:ev.has(e.id),isFree:e.isFree,onDisable:()=>t$(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tN(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ek(!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"]}),H[f]&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tL,disabled:e9,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e9?{animation:"spin 1s linear infinite"}:void 0,children:e9?"progress_activity":"download"}),e9?(0,N.Tl)("Fetching..."):(0,N.Tl)(H[f])]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tW,disabled:tt,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:tt?{animation:"spin 1s linear infinite"}:void 0,children:tt?"progress_activity":"download"}),tt?(0,N.Tl)("Fetching..."):(0,N.Tl)("Import from /models")]}),eq.length>0&&(e=new Set([...Object.values(ec),...o.map(e=>e.fullModel)]),t=new Set(tf.map(e=>e.id)),0===(s=eq.filter(s=>!e.has(`${tC}/${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 models:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tJ(e.id,"llm",tC)},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.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.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 (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>tO(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))})]})]})})()]}),t6,"kiro"===f?(0,i.jsx)(c.Mh,{isOpen:D,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}):"cursor"===f?(0,i.jsx)(c.G9,{isOpen:D,onSuccess:tG,onClose:()=>_(!1)}):"gitlab"===f?(0,i.jsx)(c.vj,{isOpen:D,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}):(0,i.jsx)(c.LF,{isOpen:D,provider:f,providerInfo:tc,onSuccess:tG,onClose:()=>_(!1)}),(0,i.jsx)(c.LH,{isOpen:U,onSuccess:tG,onClose:()=>M(!1)}),"iflow"===f&&(0,i.jsx)(c.vE,{isOpen:F,onSuccess:()=>{tR(),L(!1)},onClose:()=>L(!1)}),(0,i.jsx)(z,{isOpen:G,provider:f,providerName:tc.name,isCompatible:tv,isAnthropic:tb,authType:tc?.authType,authHint:tc?.authHint,website:tc?.website,proxyPools:P,error:Q,existingNames:y.map(e=>e.name).filter(Boolean),onSave:tV,onBulkDone:tR,onClose:()=>{Z(""),V(!1)}}),(0,i.jsx)(c.wI,{isOpen:es,connection:eo,proxyPools:P,onSave:tQ,onClose:()=>ei(!1)}),tv&&(0,i.jsx)(q,{isOpen:ea,node:T,onSave:t_,onClose:()=>el(!1),isAnthropic:tb}),!tv&&(0,i.jsx)(K,{isOpen:ew,providerAlias:tC,providerDisplayAlias:tA,onSave:async(e,t)=>{await tJ(e,"llm",tC,t),ek(!1)},onClose:()=>ek(!1)}),"codex"===f&&(0,i.jsx)(J,{isOpen:X,onClose:()=>Y(!1),onSuccess:tR}),"grok-cli"===f&&(0,i.jsx)(W,{isOpen:ee,onClose:()=>et(!1),onSuccess:tR}),(0,i.jsx)(c.uo,{isOpen:eQ,onClose:()=>eZ(!1),onConfirm:()=>{(window.localStorage.setItem(tl,"true"),eZ(!1),tp)?tr():to()},title:"Risk Notice",message:tc?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eG,onClose:()=>eV(null),onConfirm:eG?.onConfirm,title:eG?.title||"Confirm",message:eG?.message,variant:"danger"})]})}},82837:(e,t,s)=>{Promise.resolve().then(s.bind(s,80873))}},e=>{e.O(0,[2997,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=82837)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function u(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,u]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[h,m]=(0,s.useState)({}),x=(e,r)=>{u(t=>({...t,[e]:r})),h[e]&&m(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),m(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();m({submit:e.error||"Failed to create provider"})}}catch(e){m({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:h.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:h.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),h.submit&&(0,a.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:h.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},85990:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=85990)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function u(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,u]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[h,m]=(0,s.useState)({}),x=(e,r)=>{u(t=>({...t,[e]:r})),h[e]&&m(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),m(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();m({submit:e.error||"Failed to create provider"})}}catch(e){m({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:h.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:h.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),h.submit&&(0,a.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:h.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},85990:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[2997,1321,705,5497,8441,3794,7358],()=>e(e.s=85990)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{1525:(e,t,r)=>{Promise.resolve().then(r.bind(r,29450))},29450:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var s=r(95155),a=r(12115),l=r(14051),i=r.n(l),n=r(35497),o=r(57250),d=r(8247),c=r(90620),p=r(88105),m=r(98500),x=r.n(m),u=r(65921),h=r(38003);let f={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 b(){let[e,t]=(0,a.useState)(null),[r,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,u.i)(),x=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let r=await e.json();t(r)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{x();let e=setInterval(x,3e4);return()=>clearInterval(e)},[x]),(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 h=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await x()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(r)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,s.jsx)("div",{className:"relative",ref:p,children:i&&(0,s.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,s.jsx)("button",{onClick:x,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,s.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,s.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,r=d===`${e.provider}:${e.model}`;return(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,s.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:r,className:"text-[10px] px-1.5! py-0.5! ml-2",children:r?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let g={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the 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:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({variant:e,isOpen:t,onClose:r,onCreated:l}){let i=g[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[d,c]=(0,a.useState)(o),[p,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[b,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{i.hasApiType?c(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(w(null),u(""),f(""))},[i.hasApiType?d.apiType:t]);let k=async()=>{if(d.name.trim()&&d.prefix.trim()&&d.baseUrl.trim()){m(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:i.type})}),t=await e.json();e.ok&&(l(t.node),c(o()),u(""),w(null))}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{m(!1)}}},C=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:x,type:i.type,modelId:h.trim()||void 0})}),t=await e.json();w(t)}catch{w({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(n.aF,{isOpen:t,title:i.title,onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,s.jsx)(n.l6,{label:"API Type",options:v,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:h,onChange:e=>f(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:C,disabled:!x||b||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!N)return null;let{valid:e,error:t,method:r}=N;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===r&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:k,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}y.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired};let j=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"none",label:"No connection"}];function N(e,t,r){let a=[];if(e>0&&a.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=r?`${t} Error (${r})`:`${t} Error`;a.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function w(){let e,t,[r,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(!0),[x,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(!1),[T,I]=(0,a.useState)(null),[E,$]=(0,a.useState)(null),[P,O]=(0,a.useState)("all"),R=(0,u.i)(),S=(0,h.C)(e=>e.query),U=(0,h.C)(e=>e.register),_=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>(U("Search providers..."),()=>_()),[U,_]);let z=e=>!S.trim()||!!e&&e.toLowerCase().includes(S.trim().toLowerCase());(0,a.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),s=await t.json();e.ok&&l(r.connections||[]),t.ok&&o(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let q=(e,t)=>{let s=Array.isArray(t)?t:[t],a=r.filter(t=>t.provider===e&&s.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),p=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:p?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 r=Number(e.errorCode);if(Number.isFinite(r)&&r>=400)return String(r);let s=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;let 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"}(p):null,errorTime:p?.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 r=Math.floor(t/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(p.lastErrorAt):null,allDisabled:c}},D=(e,t)=>(function(e,t,r=!1){return"all"===e||function(e,t=!1){return t?"active":e&&0!==e.total?e.allDisabled?"inactive":"active":"none"}(t,r)===e})(P,e,t),F=async(e,t,s)=>{let a=Array.isArray(t)?t:[t],i=t=>t.provider===e&&a.includes(t.authType),n=r.filter(i);l(e=>e.map(e=>i(e)?{...e,isActive:s}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},M=async(e,t=null)=>{if(!T){I("provider"===e?t:e),$(null);try{let r=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),s=await r.json();if($(s),s.summary){let{passed:e,failed:t,total:r}=s.summary;0===t?R.success(`All ${r} tests passed`):R.warning(`${e}/${r} passed, ${t} failed`)}}catch(e){$({error:"Test request failed"}),R.error("Provider test failed")}finally{I(null)}}},L=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>z(e.name)&&D(q(e.id,"apikey"))),K=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>z(e.name)&&D(q(e.id,"apikey"))),H=(e,t)=>{if("kiro"===t)return["oauth","apikey","api_key"];let r=e?.authModes;return Array.isArray(r)?r.includes("apikey")?["oauth","apikey","api_key"]:"oauth":t in p.nJ||t in c.fg?["oauth","apikey","api_key"]:"oauth"},J=(e=Object.entries(c.zN).filter(([e,t])=>!t.hidden&&z(t.name)&&D(q(e,H(t,e)),t.noAuth)),t="oauth",[...e].sort(([e,r],[s,a])=>{let l=r.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=q(e,t),o=q(s,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(r.name||"").localeCompare(a.name||"")})),B=Object.entries(p.IS).filter(([e,t])=>!t.hidden&&z(t.name)&&D(q(e,H(t,e)),t.noAuth)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),W=Object.entries(p.nJ).filter(([e,t])=>!t.hidden&&z(t.name)&&(t.serviceKinds??["llm"]).includes("llm")&&D(q(e,H(t,e)),t.noAuth)).sort(([e,t],[r,s])=>{let a=t.priority??999,l=s.priority??999;if(a!==l)return a-l;let i=!!s.noAuth-!!t.noAuth;if(0!==i)return i;let n=q(e,H(t,e)).connected>0?0:1,o=q(r,H(s,r)).connected>0?0:1;return n!==o?n-o:(t.name||"").localeCompare(s.name||"")}),Q=Object.entries(c.fg).filter(([e,t])=>!t.hidden&&(t.serviceKinds??["llm"]).includes("llm")&&z(t.name)&&D(q(e,"apikey"),t.noAuth)).sort(([e,t],[r,s])=>{let a=q(e,"apikey").total>0?0:1,l=q(r,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(s.name||"")}),X=!!S.trim()||"all"!==P,Z=X||x?Q:Q.slice(0,20),V=Q.length-20;if(d)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let Y=J.length>0||B.length>0||W.length>0||Q.length>0||L.length>0||K.length>0;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,s.jsx)("div",{className:"flex items-center justify-end",children:(0,s.jsx)("select",{value:P,onChange:e=>O(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":"Filter providers by connection status",children:j.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})}),!Y&&(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search or filters"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>w(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===L.length&&0===K.length?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,s.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...L,...K].map(e=>(0,s.jsx)(C,{providerId:e.id,provider:e,stats:q(e.id,"apikey"),authType:"compatible",onToggle:t=>F(e.id,"apikey",t)},e.id))})]}),J.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(b,{}),(0,s.jsxs)("button",{onClick:()=>M("oauth"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===T?" animate-spin":""}`,children:"play_arrow"}),"oauth"===T?"Testing...":"Test All"]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:J.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(k,{providerId:e,provider:t,stats:q(e,r),authType:"oauth",onToggle:t=>F(e,r,t)},e)})})]}),(B.length>0||W.length>0)&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,s.jsxs)("button",{onClick:()=>M("free"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===T?" animate-spin":""}`,children:"play_arrow"}),"free"===T?"Testing...":"Test All"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[B.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(k,{providerId:e,provider:t,stats:q(e,r),authType:"free",onToggle:t=>F(e,r,t)},e)}),W.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(C,{providerId:e,provider:t,stats:q(e,r),authType:Array.isArray(r)?r[0]??"apikey":r,onToggle:t=>F(e,r,t)},e)})]})]}),Q.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,s.jsxs)("button",{onClick:()=>M("apikey"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===T?" animate-spin":""}`,children:"play_arrow"}),"apikey"===T?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:Z.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:q(e,"apikey"),authType:"apikey",onToggle:t=>F(e,"apikey",t)},e))}),!X&&!x&&V>0&&(0,s.jsxs)("button",{onClick:()=>f(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",Q.length," providers"]})]}),(0,s.jsx)(y,{variant:"openai",isOpen:g,onClose:()=>v(!1),onCreated:e=>{o(t=>[...t,e]),v(!1)}}),(0,s.jsx)(y,{variant:"anthropic",isOpen:N,onClose:()=>w(!1),onCreated:e=>{o(t=>[...t,e]),w(!1)}}),E&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>$(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,s.jsx)("button",{onClick:()=>$(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(A,{results:E})})]})]})]})}function k({providerId:e,provider:t,stats:r,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:m}=r,u=!!t.noAuth;return(0,s.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${m?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:m?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,s.jsxs)(s.Fragment,{children:[N(i,d,c),p&&(0,s.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!m)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})})})]})})})}function C({providerId:e,provider:t,stats:r,authType:a,onToggle:l}){let{connected:i,error:c,errorCode:m,errorTime:u,allDisabled:h}=r,f=e.startsWith(p.JH),b=e.startsWith(p.DI);return(0,s.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:f&&t.apiType?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":(0,d.HY)(t.id),alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,s.jsxs)(s.Fragment,{children:[N(i,c,m),f&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),u&&(0,s.jsx)("span",{className:"text-text-muted",children:u})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function A({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:r}=e,a=e.results||[];return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[r]||r," Test"]}),(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,s.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,s.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,s.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},A.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}}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=1525)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{1525:(e,t,r)=>{Promise.resolve().then(r.bind(r,29450))},29450:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var s=r(95155),a=r(12115),l=r(14051),i=r.n(l),n=r(35497),o=r(57250),d=r(8247),c=r(90620),p=r(88105),m=r(98500),x=r.n(m),u=r(65921),h=r(38003);let f={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 b(){let[e,t]=(0,a.useState)(null),[r,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,u.i)(),x=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let r=await e.json();t(r)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{x();let e=setInterval(x,3e4);return()=>clearInterval(e)},[x]),(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 h=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await x()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(r)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,s.jsx)("div",{className:"relative",ref:p,children:i&&(0,s.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,s.jsx)("button",{onClick:x,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,s.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,s.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,r=d===`${e.provider}:${e.model}`;return(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,s.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:r,className:"text-[10px] px-1.5! py-0.5! ml-2",children:r?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let g={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the 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:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({variant:e,isOpen:t,onClose:r,onCreated:l}){let i=g[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[d,c]=(0,a.useState)(o),[p,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[b,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{i.hasApiType?c(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(w(null),u(""),f(""))},[i.hasApiType?d.apiType:t]);let k=async()=>{if(d.name.trim()&&d.prefix.trim()&&d.baseUrl.trim()){m(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:i.type})}),t=await e.json();e.ok&&(l(t.node),c(o()),u(""),w(null))}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{m(!1)}}},C=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:x,type:i.type,modelId:h.trim()||void 0})}),t=await e.json();w(t)}catch{w({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(n.aF,{isOpen:t,title:i.title,onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,s.jsx)(n.l6,{label:"API Type",options:v,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:h,onChange:e=>f(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:C,disabled:!x||b||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!N)return null;let{valid:e,error:t,method:r}=N;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===r&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:k,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}y.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired};let j=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"none",label:"No connection"}];function N(e,t,r){let a=[];if(e>0&&a.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=r?`${t} Error (${r})`:`${t} Error`;a.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function w(){let e,t,[r,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(!0),[x,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(!1),[T,I]=(0,a.useState)(null),[E,$]=(0,a.useState)(null),[P,O]=(0,a.useState)("all"),R=(0,u.i)(),S=(0,h.C)(e=>e.query),U=(0,h.C)(e=>e.register),_=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>(U("Search providers..."),()=>_()),[U,_]);let z=e=>!S.trim()||!!e&&e.toLowerCase().includes(S.trim().toLowerCase());(0,a.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),s=await t.json();e.ok&&l(r.connections||[]),t.ok&&o(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let q=(e,t)=>{let s=Array.isArray(t)?t:[t],a=r.filter(t=>t.provider===e&&s.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),p=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:p?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 r=Number(e.errorCode);if(Number.isFinite(r)&&r>=400)return String(r);let s=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;let 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"}(p):null,errorTime:p?.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 r=Math.floor(t/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(p.lastErrorAt):null,allDisabled:c}},D=(e,t)=>(function(e,t,r=!1){return"all"===e||function(e,t=!1){return t?"active":e&&0!==e.total?e.allDisabled?"inactive":"active":"none"}(t,r)===e})(P,e,t),F=async(e,t,s)=>{let a=Array.isArray(t)?t:[t],i=t=>t.provider===e&&a.includes(t.authType),n=r.filter(i);l(e=>e.map(e=>i(e)?{...e,isActive:s}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},M=async(e,t=null)=>{if(!T){I("provider"===e?t:e),$(null);try{let r=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),s=await r.json();if($(s),s.summary){let{passed:e,failed:t,total:r}=s.summary;0===t?R.success(`All ${r} tests passed`):R.warning(`${e}/${r} passed, ${t} failed`)}}catch(e){$({error:"Test request failed"}),R.error("Provider test failed")}finally{I(null)}}},L=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>z(e.name)&&D(q(e.id,"apikey"))),K=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>z(e.name)&&D(q(e.id,"apikey"))),H=(e,t)=>{if("kiro"===t)return["oauth","apikey","api_key"];let r=e?.authModes;return Array.isArray(r)?r.includes("apikey")?["oauth","apikey","api_key"]:"oauth":t in p.nJ||t in c.fg?["oauth","apikey","api_key"]:"oauth"},J=(e=Object.entries(c.zN).filter(([e,t])=>!t.hidden&&z(t.name)&&D(q(e,H(t,e)),t.noAuth)),t="oauth",[...e].sort(([e,r],[s,a])=>{let l=r.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=q(e,t),o=q(s,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(r.name||"").localeCompare(a.name||"")})),B=Object.entries(p.IS).filter(([e,t])=>!t.hidden&&z(t.name)&&D(q(e,H(t,e)),t.noAuth)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),W=Object.entries(p.nJ).filter(([e,t])=>!t.hidden&&z(t.name)&&(t.serviceKinds??["llm"]).includes("llm")&&D(q(e,H(t,e)),t.noAuth)).sort(([e,t],[r,s])=>{let a=t.priority??999,l=s.priority??999;if(a!==l)return a-l;let i=!!s.noAuth-!!t.noAuth;if(0!==i)return i;let n=q(e,H(t,e)).connected>0?0:1,o=q(r,H(s,r)).connected>0?0:1;return n!==o?n-o:(t.name||"").localeCompare(s.name||"")}),Q=Object.entries(c.fg).filter(([e,t])=>!t.hidden&&(t.serviceKinds??["llm"]).includes("llm")&&z(t.name)&&D(q(e,"apikey"),t.noAuth)).sort(([e,t],[r,s])=>{let a=q(e,"apikey").total>0?0:1,l=q(r,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(s.name||"")}),X=!!S.trim()||"all"!==P,Z=X||x?Q:Q.slice(0,20),V=Q.length-20;if(d)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let Y=J.length>0||B.length>0||W.length>0||Q.length>0||L.length>0||K.length>0;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,s.jsx)("div",{className:"flex items-center justify-end",children:(0,s.jsx)("select",{value:P,onChange:e=>O(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":"Filter providers by connection status",children:j.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})}),!Y&&(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search or filters"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>w(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===L.length&&0===K.length?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,s.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...L,...K].map(e=>(0,s.jsx)(C,{providerId:e.id,provider:e,stats:q(e.id,"apikey"),authType:"compatible",onToggle:t=>F(e.id,"apikey",t)},e.id))})]}),J.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(b,{}),(0,s.jsxs)("button",{onClick:()=>M("oauth"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===T?" animate-spin":""}`,children:"play_arrow"}),"oauth"===T?"Testing...":"Test All"]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:J.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(k,{providerId:e,provider:t,stats:q(e,r),authType:"oauth",onToggle:t=>F(e,r,t)},e)})})]}),(B.length>0||W.length>0)&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,s.jsxs)("button",{onClick:()=>M("free"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===T?" animate-spin":""}`,children:"play_arrow"}),"free"===T?"Testing...":"Test All"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[B.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(k,{providerId:e,provider:t,stats:q(e,r),authType:"free",onToggle:t=>F(e,r,t)},e)}),W.map(([e,t])=>{let r=H(t,e);return(0,s.jsx)(C,{providerId:e,provider:t,stats:q(e,r),authType:Array.isArray(r)?r[0]??"apikey":r,onToggle:t=>F(e,r,t)},e)})]})]}),Q.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,s.jsxs)("button",{onClick:()=>M("apikey"),disabled:!!T,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"===T?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===T?" animate-spin":""}`,children:"play_arrow"}),"apikey"===T?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:Z.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:q(e,"apikey"),authType:"apikey",onToggle:t=>F(e,"apikey",t)},e))}),!X&&!x&&V>0&&(0,s.jsxs)("button",{onClick:()=>f(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",Q.length," providers"]})]}),(0,s.jsx)(y,{variant:"openai",isOpen:g,onClose:()=>v(!1),onCreated:e=>{o(t=>[...t,e]),v(!1)}}),(0,s.jsx)(y,{variant:"anthropic",isOpen:N,onClose:()=>w(!1),onCreated:e=>{o(t=>[...t,e]),w(!1)}}),E&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>$(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,s.jsx)("button",{onClick:()=>$(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(A,{results:E})})]})]})]})}function k({providerId:e,provider:t,stats:r,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:m}=r,u=!!t.noAuth;return(0,s.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${m?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:m?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,s.jsxs)(s.Fragment,{children:[N(i,d,c),p&&(0,s.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!m)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})})})]})})})}function C({providerId:e,provider:t,stats:r,authType:a,onToggle:l}){let{connected:i,error:c,errorCode:m,errorTime:u,allDisabled:h}=r,f=e.startsWith(p.JH),b=e.startsWith(p.DI);return(0,s.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:f&&t.apiType?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":(0,d.HY)(t.id),alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,s.jsxs)(s.Fragment,{children:[N(i,c,m),f&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),u&&(0,s.jsx)("span",{className:"text-text-muted",children:u})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function A({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:r}=e,a=e.results||[];return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[r]||r," Test"]}),(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,s.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,s.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,s.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},A.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}}},e=>{e.O(0,[2997,1321,705,5497,8441,3794,7358],()=>e(e.s=1525)),_N_E=e.O()}]);