zevairouter 1.1.35 → 1.1.37

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 (934) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +38 -1
  3. package/README.zh-CN.md +1 -0
  4. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  5. package/cli/app/.next-cli-build/app-path-routes-manifest.json +22 -20
  6. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  7. package/cli/app/.next-cli-build/prerender-manifest.json +4 -4
  8. package/cli/app/.next-cli-build/routes-manifest.json +14 -0
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +9 -9
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  66. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  67. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  68. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  69. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  71. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  74. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  75. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  76. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  77. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  78. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  79. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  80. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  81. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  82. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  83. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js +2 -2
  87. package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/changelog/route.js +1 -1
  91. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  101. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  102. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  107. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  108. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  109. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  110. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  111. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/context/route.js +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/health/route.js +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  135. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  136. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/metrics/route.js +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js +2 -2
  212. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js +1 -0
  213. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js.nft.json +1 -0
  214. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route_client-reference-manifest.js +1 -0
  215. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/providers/route.js +2 -2
  220. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  230. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  231. package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  232. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  233. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  234. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  235. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  236. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  237. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js +2 -2
  250. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  253. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  264. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  271. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js +2 -2
  275. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  277. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js +1 -0
  294. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js.nft.json +1 -0
  295. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route_client-reference-manifest.js +1 -0
  296. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  305. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  306. package/cli/app/.next-cli-build/server/app/callback/page.js +1 -1
  307. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  308. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  309. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  310. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  311. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  312. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  313. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  314. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +3 -3
  315. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +3 -3
  316. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +3 -3
  317. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  318. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  319. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
  320. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
  321. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
  322. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  323. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  324. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
  325. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
  326. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
  327. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  328. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  329. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
  330. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
  331. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
  332. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  333. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  334. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +3 -3
  335. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +3 -3
  336. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +3 -3
  337. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  338. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  339. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
  340. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  341. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
  342. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  343. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  344. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
  345. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
  346. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
  347. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  348. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  349. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
  350. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
  351. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
  352. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  353. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  354. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +3 -3
  355. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +3 -3
  356. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +3 -3
  357. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  358. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  359. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
  360. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
  361. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
  362. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  363. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  364. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
  365. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
  366. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
  367. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  368. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  369. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
  370. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
  371. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
  372. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  373. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  374. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
  375. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
  376. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
  377. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  378. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  379. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
  380. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
  381. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
  382. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  383. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  384. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
  385. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  386. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
  387. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  388. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  389. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  390. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  391. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  392. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  393. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  394. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
  395. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
  396. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
  397. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  398. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  399. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
  400. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
  401. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
  402. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  403. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  404. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
  405. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
  406. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
  407. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  408. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  409. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
  410. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
  411. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
  412. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  413. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  414. package/cli/app/.next-cli-build/server/app/dashboard.rsc +3 -3
  415. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
  416. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
  417. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  418. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  419. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  420. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  421. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  422. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  423. package/cli/app/.next-cli-build/server/app/landing/page.js +1 -1
  424. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  425. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  426. package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
  427. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  428. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  429. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  430. package/cli/app/.next-cli-build/server/app/login/page.js +1 -1
  431. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  432. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  433. package/cli/app/.next-cli-build/server/app/login.rsc +3 -3
  434. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  435. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  436. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  437. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  438. package/cli/app/.next-cli-build/server/app/page.js +1 -1
  439. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  440. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js +2 -2
  441. package/cli/app/.next-cli-build/server/app-paths-manifest.json +22 -20
  442. package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
  443. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  444. package/cli/app/.next-cli-build/server/chunks/2299.js +1 -1
  445. package/cli/app/.next-cli-build/server/chunks/3477.js +1 -1
  446. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  447. package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
  448. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
  449. package/cli/app/.next-cli-build/server/chunks/5019.js +1 -1
  450. package/cli/app/.next-cli-build/server/chunks/5436.js +1 -1
  451. package/cli/app/.next-cli-build/server/chunks/5681.js +1 -1
  452. package/cli/app/.next-cli-build/server/chunks/6846.js +1 -1
  453. package/cli/app/.next-cli-build/server/chunks/7170.js +1 -1
  454. package/cli/app/.next-cli-build/server/chunks/7319.js +19 -19
  455. package/cli/app/.next-cli-build/server/chunks/7502.js +1 -1
  456. package/cli/app/.next-cli-build/server/chunks/7634.js +1 -1
  457. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  458. package/cli/app/.next-cli-build/server/chunks/9679.js +1 -1
  459. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  460. package/cli/app/.next-cli-build/server/middleware.js +1 -1
  461. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  462. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  463. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  464. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  465. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  466. package/cli/app/.next-cli-build/static/chunks/{5497-07fd56ae6cf0f59f.js → 5497-74f6311426810796.js} +3 -3
  467. package/cli/app/.next-cli-build/static/chunks/620-b9f4de494966acab.js +1 -0
  468. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-d580298598ba5275.js +58 -0
  469. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-cc4cd8701a14c45e.js +3 -0
  470. package/cli/app/.next-cli-build/static/chunks/app/_global-error/{page-378a2e64adcc5f02.js → page-3fd3d1141471fe7d.js} +1 -1
  471. package/cli/app/.next-cli-build/static/chunks/app/api/auth/login/{route-378a2e64adcc5f02.js → route-3fd3d1141471fe7d.js} +1 -1
  472. package/cli/app/.next-cli-build/static/chunks/app/api/auth/logout/{route-378a2e64adcc5f02.js → route-3fd3d1141471fe7d.js} +1 -1
  473. package/cli/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/{route-378a2e64adcc5f02.js → route-3fd3d1141471fe7d.js} +1 -1
  474. package/cli/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-3fd3d1141471fe7d.js +1 -0
  475. package/cli/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-3fd3d1141471fe7d.js +1 -0
  476. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-3fd3d1141471fe7d.js +1 -0
  477. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-3fd3d1141471fe7d.js +1 -0
  478. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-3fd3d1141471fe7d.js +1 -0
  479. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-3fd3d1141471fe7d.js +1 -0
  480. package/cli/app/.next-cli-build/static/chunks/app/api/auth/status/route-3fd3d1141471fe7d.js +1 -0
  481. package/cli/app/.next-cli-build/static/chunks/app/api/cache/stats/route-3fd3d1141471fe7d.js +1 -0
  482. package/cli/app/.next-cli-build/static/chunks/app/api/changelog/route-3fd3d1141471fe7d.js +1 -0
  483. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-3fd3d1141471fe7d.js +1 -0
  484. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-3fd3d1141471fe7d.js +1 -0
  485. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-3fd3d1141471fe7d.js +1 -0
  486. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-3fd3d1141471fe7d.js +1 -0
  487. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-3fd3d1141471fe7d.js +1 -0
  488. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-gateway/accounts/route-3fd3d1141471fe7d.js +1 -0
  489. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-3fd3d1141471fe7d.js +1 -0
  490. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-3fd3d1141471fe7d.js +1 -0
  491. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-3fd3d1141471fe7d.js +1 -0
  492. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-3fd3d1141471fe7d.js +1 -0
  493. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-3fd3d1141471fe7d.js +1 -0
  494. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-3fd3d1141471fe7d.js +1 -0
  495. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-3fd3d1141471fe7d.js +1 -0
  496. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-3fd3d1141471fe7d.js +1 -0
  497. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-3fd3d1141471fe7d.js +1 -0
  498. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-3fd3d1141471fe7d.js +1 -0
  499. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-3fd3d1141471fe7d.js +1 -0
  500. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-3fd3d1141471fe7d.js +1 -0
  501. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-3fd3d1141471fe7d.js +1 -0
  502. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-3fd3d1141471fe7d.js +1 -0
  503. package/cli/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-3fd3d1141471fe7d.js +1 -0
  504. package/cli/app/.next-cli-build/static/chunks/app/api/combos/route-3fd3d1141471fe7d.js +1 -0
  505. package/cli/app/.next-cli-build/static/chunks/app/api/context/[id]/route-3fd3d1141471fe7d.js +1 -0
  506. package/cli/app/.next-cli-build/static/chunks/app/api/context/bulk/route-3fd3d1141471fe7d.js +1 -0
  507. package/cli/app/.next-cli-build/static/chunks/app/api/context/route-3fd3d1141471fe7d.js +1 -0
  508. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/chat/completions/route-3fd3d1141471fe7d.js +1 -0
  509. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/cli-tools/keys/route-3fd3d1141471fe7d.js +1 -0
  510. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/media/[operation]/route-3fd3d1141471fe7d.js +1 -0
  511. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/media/videos/[id]/route-3fd3d1141471fe7d.js +1 -0
  512. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/enable/route-3fd3d1141471fe7d.js +1 -0
  513. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-3fd3d1141471fe7d.js +1 -0
  514. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-3fd3d1141471fe7d.js +1 -0
  515. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-3fd3d1141471fe7d.js +1 -0
  516. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/start/route-3fd3d1141471fe7d.js +1 -0
  517. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/status/route-3fd3d1141471fe7d.js +1 -0
  518. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-3fd3d1141471fe7d.js +1 -0
  519. package/cli/app/.next-cli-build/static/chunks/app/api/health/ready/route-3fd3d1141471fe7d.js +1 -0
  520. package/cli/app/.next-cli-build/static/chunks/app/api/health/route-3fd3d1141471fe7d.js +1 -0
  521. package/cli/app/.next-cli-build/static/chunks/app/api/init/route-3fd3d1141471fe7d.js +1 -0
  522. package/cli/app/.next-cli-build/static/chunks/app/api/keys/[id]/rotate/route-3fd3d1141471fe7d.js +1 -0
  523. package/cli/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-3fd3d1141471fe7d.js +1 -0
  524. package/cli/app/.next-cli-build/static/chunks/app/api/keys/route-3fd3d1141471fe7d.js +1 -0
  525. package/cli/app/.next-cli-build/static/chunks/app/api/locale/route-3fd3d1141471fe7d.js +1 -0
  526. package/cli/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-3fd3d1141471fe7d.js +1 -0
  527. package/cli/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-3fd3d1141471fe7d.js +1 -0
  528. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-3fd3d1141471fe7d.js +1 -0
  529. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-3fd3d1141471fe7d.js +1 -0
  530. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-3fd3d1141471fe7d.js +1 -0
  531. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-3fd3d1141471fe7d.js +1 -0
  532. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-3fd3d1141471fe7d.js +1 -0
  533. package/cli/app/.next-cli-build/static/chunks/app/api/metrics/route-3fd3d1141471fe7d.js +1 -0
  534. package/cli/app/.next-cli-build/static/chunks/app/api/models/alias/route-3fd3d1141471fe7d.js +1 -0
  535. package/cli/app/.next-cli-build/static/chunks/app/api/models/availability/route-3fd3d1141471fe7d.js +1 -0
  536. package/cli/app/.next-cli-build/static/chunks/app/api/models/custom/route-3fd3d1141471fe7d.js +1 -0
  537. package/cli/app/.next-cli-build/static/chunks/app/api/models/disabled/route-3fd3d1141471fe7d.js +1 -0
  538. package/cli/app/.next-cli-build/static/chunks/app/api/models/route-3fd3d1141471fe7d.js +1 -0
  539. package/cli/app/.next-cli-build/static/chunks/app/api/models/test/route-3fd3d1141471fe7d.js +1 -0
  540. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-3fd3d1141471fe7d.js +1 -0
  541. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  542. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  543. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  544. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  545. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  546. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  547. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  548. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  549. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  550. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  551. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  552. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  553. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  554. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  555. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  556. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-token/route-3fd3d1141471fe7d.js +1 -0
  557. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/quota-cookie/route-3fd3d1141471fe7d.js +1 -0
  558. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  559. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  560. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  561. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  562. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  563. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-token/route-3fd3d1141471fe7d.js +1 -0
  564. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/quota-cookie/route-3fd3d1141471fe7d.js +1 -0
  565. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-3fd3d1141471fe7d.js +1 -0
  566. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-3fd3d1141471fe7d.js +1 -0
  567. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-3fd3d1141471fe7d.js +1 -0
  568. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-3fd3d1141471fe7d.js +1 -0
  569. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  570. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  571. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  572. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  573. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  574. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-token/route-3fd3d1141471fe7d.js +1 -0
  575. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-3fd3d1141471fe7d.js +1 -0
  576. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-3fd3d1141471fe7d.js +1 -0
  577. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-3fd3d1141471fe7d.js +1 -0
  578. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  579. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  580. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  581. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  582. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  583. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-3fd3d1141471fe7d.js +1 -0
  584. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-3fd3d1141471fe7d.js +1 -0
  585. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-3fd3d1141471fe7d.js +1 -0
  586. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-3fd3d1141471fe7d.js +1 -0
  587. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route-3fd3d1141471fe7d.js +1 -0
  588. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route-3fd3d1141471fe7d.js +1 -0
  589. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/route-3fd3d1141471fe7d.js +1 -0
  590. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/latest/route-3fd3d1141471fe7d.js +1 -0
  591. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/route-3fd3d1141471fe7d.js +1 -0
  592. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-3fd3d1141471fe7d.js +1 -0
  593. package/cli/app/.next-cli-build/static/chunks/app/api/pricing/route-3fd3d1141471fe7d.js +1 -0
  594. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-3fd3d1141471fe7d.js +1 -0
  595. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-3fd3d1141471fe7d.js +1 -0
  596. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-3fd3d1141471fe7d.js +1 -0
  597. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-3fd3d1141471fe7d.js +1 -0
  598. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-3fd3d1141471fe7d.js +1 -0
  599. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-3fd3d1141471fe7d.js +1 -0
  600. package/cli/app/.next-cli-build/static/chunks/app/api/providers/bulk-delete/route-3fd3d1141471fe7d.js +1 -0
  601. package/cli/app/.next-cli-build/static/chunks/app/api/providers/client/route-3fd3d1141471fe7d.js +1 -0
  602. package/cli/app/.next-cli-build/static/chunks/app/api/providers/codebuddy/discover-models/route-3fd3d1141471fe7d.js +1 -0
  603. package/cli/app/.next-cli-build/static/chunks/app/api/providers/flow/import/route-3fd3d1141471fe7d.js +1 -0
  604. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-3fd3d1141471fe7d.js +1 -0
  605. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kiro/discover-models/route-3fd3d1141471fe7d.js +1 -0
  606. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kiro/models/route-3fd3d1141471fe7d.js +1 -0
  607. package/cli/app/.next-cli-build/static/chunks/app/api/providers/opencode/discover-models/route-3fd3d1141471fe7d.js +1 -0
  608. package/cli/app/.next-cli-build/static/chunks/app/api/providers/route-3fd3d1141471fe7d.js +1 -0
  609. package/cli/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-3fd3d1141471fe7d.js +1 -0
  610. package/cli/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-3fd3d1141471fe7d.js +1 -0
  611. package/cli/app/.next-cli-build/static/chunks/app/api/providers/validate/route-3fd3d1141471fe7d.js +1 -0
  612. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-3fd3d1141471fe7d.js +1 -0
  613. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-3fd3d1141471fe7d.js +1 -0
  614. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-3fd3d1141471fe7d.js +1 -0
  615. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-3fd3d1141471fe7d.js +1 -0
  616. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-3fd3d1141471fe7d.js +1 -0
  617. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-3fd3d1141471fe7d.js +1 -0
  618. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-3fd3d1141471fe7d.js +1 -0
  619. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-3fd3d1141471fe7d.js +1 -0
  620. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-3fd3d1141471fe7d.js +1 -0
  621. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-3fd3d1141471fe7d.js +1 -0
  622. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-3fd3d1141471fe7d.js +1 -0
  623. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-3fd3d1141471fe7d.js +1 -0
  624. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-3fd3d1141471fe7d.js +1 -0
  625. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-3fd3d1141471fe7d.js +1 -0
  626. package/cli/app/.next-cli-build/static/chunks/app/api/settings/database/route-3fd3d1141471fe7d.js +1 -0
  627. package/cli/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-3fd3d1141471fe7d.js +1 -0
  628. package/cli/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-3fd3d1141471fe7d.js +1 -0
  629. package/cli/app/.next-cli-build/static/chunks/app/api/settings/route-3fd3d1141471fe7d.js +1 -0
  630. package/cli/app/.next-cli-build/static/chunks/app/api/shutdown/route-3fd3d1141471fe7d.js +1 -0
  631. package/cli/app/.next-cli-build/static/chunks/app/api/tags/route-3fd3d1141471fe7d.js +1 -0
  632. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/setup/route-3fd3d1141471fe7d.js +1 -0
  633. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/status/route-3fd3d1141471fe7d.js +1 -0
  634. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/unlock/route-3fd3d1141471fe7d.js +1 -0
  635. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/input/route-3fd3d1141471fe7d.js +1 -0
  636. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/resize/route-3fd3d1141471fe7d.js +1 -0
  637. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/route-3fd3d1141471fe7d.js +1 -0
  638. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/stream/route-3fd3d1141471fe7d.js +1 -0
  639. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/route-3fd3d1141471fe7d.js +1 -0
  640. package/cli/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-3fd3d1141471fe7d.js +1 -0
  641. package/cli/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-3fd3d1141471fe7d.js +1 -0
  642. package/cli/app/.next-cli-build/static/chunks/app/api/translator/load/route-3fd3d1141471fe7d.js +1 -0
  643. package/cli/app/.next-cli-build/static/chunks/app/api/translator/save/route-3fd3d1141471fe7d.js +1 -0
  644. package/cli/app/.next-cli-build/static/chunks/app/api/translator/send/route-3fd3d1141471fe7d.js +1 -0
  645. package/cli/app/.next-cli-build/static/chunks/app/api/translator/translate/route-3fd3d1141471fe7d.js +1 -0
  646. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-3fd3d1141471fe7d.js +1 -0
  647. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-3fd3d1141471fe7d.js +1 -0
  648. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-3fd3d1141471fe7d.js +1 -0
  649. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-3fd3d1141471fe7d.js +1 -0
  650. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-3fd3d1141471fe7d.js +1 -0
  651. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-3fd3d1141471fe7d.js +1 -0
  652. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-3fd3d1141471fe7d.js +1 -0
  653. package/cli/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-3fd3d1141471fe7d.js +1 -0
  654. package/cli/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-3fd3d1141471fe7d.js +1 -0
  655. package/cli/app/.next-cli-build/static/chunks/app/api/usage/aggregate/route-3fd3d1141471fe7d.js +1 -0
  656. package/cli/app/.next-cli-build/static/chunks/app/api/usage/chart/route-3fd3d1141471fe7d.js +1 -0
  657. package/cli/app/.next-cli-build/static/chunks/app/api/usage/history/route-3fd3d1141471fe7d.js +1 -0
  658. package/cli/app/.next-cli-build/static/chunks/app/api/usage/logs/route-3fd3d1141471fe7d.js +1 -0
  659. package/cli/app/.next-cli-build/static/chunks/app/api/usage/providers/route-3fd3d1141471fe7d.js +1 -0
  660. package/cli/app/.next-cli-build/static/chunks/app/api/usage/quota-stream/route-3fd3d1141471fe7d.js +1 -0
  661. package/cli/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-3fd3d1141471fe7d.js +1 -0
  662. package/cli/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-3fd3d1141471fe7d.js +1 -0
  663. package/cli/app/.next-cli-build/static/chunks/app/api/usage/routing-stream/route-3fd3d1141471fe7d.js +1 -0
  664. package/cli/app/.next-cli-build/static/chunks/app/api/usage/stats/route-3fd3d1141471fe7d.js +1 -0
  665. package/cli/app/.next-cli-build/static/chunks/app/api/usage/stream/route-3fd3d1141471fe7d.js +1 -0
  666. package/cli/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-3fd3d1141471fe7d.js +1 -0
  667. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-3fd3d1141471fe7d.js +1 -0
  668. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-3fd3d1141471fe7d.js +1 -0
  669. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-3fd3d1141471fe7d.js +1 -0
  670. package/cli/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-3fd3d1141471fe7d.js +1 -0
  671. package/cli/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-3fd3d1141471fe7d.js +1 -0
  672. package/cli/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-3fd3d1141471fe7d.js +1 -0
  673. package/cli/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-3fd3d1141471fe7d.js +1 -0
  674. package/cli/app/.next-cli-build/static/chunks/app/api/v1/messages/route-3fd3d1141471fe7d.js +1 -0
  675. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-3fd3d1141471fe7d.js +1 -0
  676. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-3fd3d1141471fe7d.js +1 -0
  677. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/route-3fd3d1141471fe7d.js +1 -0
  678. package/cli/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-3fd3d1141471fe7d.js +1 -0
  679. package/cli/app/.next-cli-build/static/chunks/app/api/v1/responses/route-3fd3d1141471fe7d.js +1 -0
  680. package/cli/app/.next-cli-build/static/chunks/app/api/v1/route-3fd3d1141471fe7d.js +1 -0
  681. package/cli/app/.next-cli-build/static/chunks/app/api/v1/search/route-3fd3d1141471fe7d.js +1 -0
  682. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/content/route-3fd3d1141471fe7d.js +1 -0
  683. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-3fd3d1141471fe7d.js +1 -0
  684. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-3fd3d1141471fe7d.js +1 -0
  685. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-3fd3d1141471fe7d.js +1 -0
  686. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-3fd3d1141471fe7d.js +1 -0
  687. package/cli/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-3fd3d1141471fe7d.js +1 -0
  688. package/cli/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-3fd3d1141471fe7d.js +1 -0
  689. package/cli/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-3fd3d1141471fe7d.js +1 -0
  690. package/cli/app/.next-cli-build/static/chunks/app/api/version/route-3fd3d1141471fe7d.js +1 -0
  691. package/cli/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-3fd3d1141471fe7d.js +1 -0
  692. package/cli/app/.next-cli-build/static/chunks/app/api/version/update/route-3fd3d1141471fe7d.js +1 -0
  693. package/cli/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-3fd3d1141471fe7d.js +1 -0
  694. package/cli/app/.next-cli-build/static/chunks/app/page-3fd3d1141471fe7d.js +1 -0
  695. package/cli/app/.next-cli-build/static/chunks/app/provider-icons/[provider]/route-3fd3d1141471fe7d.js +1 -0
  696. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-3fd3d1141471fe7d.js +1 -0
  697. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-3fd3d1141471fe7d.js +1 -0
  698. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-3fd3d1141471fe7d.js +1 -0
  699. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-3fd3d1141471fe7d.js +1 -0
  700. package/cli/app/.next-cli-build/static/irN0Xw2r75K1uQTN_Q0Xt/_buildManifest.js +1 -0
  701. package/cli/app/CHANGELOG.md +26 -0
  702. package/cli/app/package.json +2 -1
  703. package/cli/package.json +1 -1
  704. package/package.json +2 -1
  705. package/scripts/gflow-reply-capture.py +328 -0
  706. package/cli/app/.next-cli-build/static/chunks/620-9d9e9b024f693b28.js +0 -1
  707. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-f769b7591eebddf5.js +0 -58
  708. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b182e3cb24f86f4b.js +0 -3
  709. package/cli/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-378a2e64adcc5f02.js +0 -1
  710. package/cli/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-378a2e64adcc5f02.js +0 -1
  711. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-378a2e64adcc5f02.js +0 -1
  712. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-378a2e64adcc5f02.js +0 -1
  713. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-378a2e64adcc5f02.js +0 -1
  714. package/cli/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-378a2e64adcc5f02.js +0 -1
  715. package/cli/app/.next-cli-build/static/chunks/app/api/auth/status/route-378a2e64adcc5f02.js +0 -1
  716. package/cli/app/.next-cli-build/static/chunks/app/api/cache/stats/route-378a2e64adcc5f02.js +0 -1
  717. package/cli/app/.next-cli-build/static/chunks/app/api/changelog/route-378a2e64adcc5f02.js +0 -1
  718. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-378a2e64adcc5f02.js +0 -1
  719. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-378a2e64adcc5f02.js +0 -1
  720. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-378a2e64adcc5f02.js +0 -1
  721. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-378a2e64adcc5f02.js +0 -1
  722. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-378a2e64adcc5f02.js +0 -1
  723. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-gateway/accounts/route-378a2e64adcc5f02.js +0 -1
  724. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-378a2e64adcc5f02.js +0 -1
  725. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-378a2e64adcc5f02.js +0 -1
  726. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-378a2e64adcc5f02.js +0 -1
  727. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-378a2e64adcc5f02.js +0 -1
  728. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-378a2e64adcc5f02.js +0 -1
  729. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-378a2e64adcc5f02.js +0 -1
  730. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-378a2e64adcc5f02.js +0 -1
  731. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-378a2e64adcc5f02.js +0 -1
  732. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-378a2e64adcc5f02.js +0 -1
  733. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-378a2e64adcc5f02.js +0 -1
  734. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-378a2e64adcc5f02.js +0 -1
  735. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-378a2e64adcc5f02.js +0 -1
  736. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-378a2e64adcc5f02.js +0 -1
  737. package/cli/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-378a2e64adcc5f02.js +0 -1
  738. package/cli/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-378a2e64adcc5f02.js +0 -1
  739. package/cli/app/.next-cli-build/static/chunks/app/api/combos/route-378a2e64adcc5f02.js +0 -1
  740. package/cli/app/.next-cli-build/static/chunks/app/api/context/[id]/route-378a2e64adcc5f02.js +0 -1
  741. package/cli/app/.next-cli-build/static/chunks/app/api/context/bulk/route-378a2e64adcc5f02.js +0 -1
  742. package/cli/app/.next-cli-build/static/chunks/app/api/context/route-378a2e64adcc5f02.js +0 -1
  743. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/chat/completions/route-378a2e64adcc5f02.js +0 -1
  744. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/cli-tools/keys/route-378a2e64adcc5f02.js +0 -1
  745. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/media/[operation]/route-378a2e64adcc5f02.js +0 -1
  746. package/cli/app/.next-cli-build/static/chunks/app/api/dashboard/media/videos/[id]/route-378a2e64adcc5f02.js +0 -1
  747. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/enable/route-378a2e64adcc5f02.js +0 -1
  748. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-378a2e64adcc5f02.js +0 -1
  749. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-378a2e64adcc5f02.js +0 -1
  750. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-378a2e64adcc5f02.js +0 -1
  751. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/start/route-378a2e64adcc5f02.js +0 -1
  752. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/status/route-378a2e64adcc5f02.js +0 -1
  753. package/cli/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-378a2e64adcc5f02.js +0 -1
  754. package/cli/app/.next-cli-build/static/chunks/app/api/health/ready/route-378a2e64adcc5f02.js +0 -1
  755. package/cli/app/.next-cli-build/static/chunks/app/api/health/route-378a2e64adcc5f02.js +0 -1
  756. package/cli/app/.next-cli-build/static/chunks/app/api/init/route-378a2e64adcc5f02.js +0 -1
  757. package/cli/app/.next-cli-build/static/chunks/app/api/keys/[id]/rotate/route-378a2e64adcc5f02.js +0 -1
  758. package/cli/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-378a2e64adcc5f02.js +0 -1
  759. package/cli/app/.next-cli-build/static/chunks/app/api/keys/route-378a2e64adcc5f02.js +0 -1
  760. package/cli/app/.next-cli-build/static/chunks/app/api/locale/route-378a2e64adcc5f02.js +0 -1
  761. package/cli/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-378a2e64adcc5f02.js +0 -1
  762. package/cli/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-378a2e64adcc5f02.js +0 -1
  763. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-378a2e64adcc5f02.js +0 -1
  764. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-378a2e64adcc5f02.js +0 -1
  765. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-378a2e64adcc5f02.js +0 -1
  766. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-378a2e64adcc5f02.js +0 -1
  767. package/cli/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-378a2e64adcc5f02.js +0 -1
  768. package/cli/app/.next-cli-build/static/chunks/app/api/metrics/route-378a2e64adcc5f02.js +0 -1
  769. package/cli/app/.next-cli-build/static/chunks/app/api/models/alias/route-378a2e64adcc5f02.js +0 -1
  770. package/cli/app/.next-cli-build/static/chunks/app/api/models/availability/route-378a2e64adcc5f02.js +0 -1
  771. package/cli/app/.next-cli-build/static/chunks/app/api/models/custom/route-378a2e64adcc5f02.js +0 -1
  772. package/cli/app/.next-cli-build/static/chunks/app/api/models/disabled/route-378a2e64adcc5f02.js +0 -1
  773. package/cli/app/.next-cli-build/static/chunks/app/api/models/route-378a2e64adcc5f02.js +0 -1
  774. package/cli/app/.next-cli-build/static/chunks/app/api/models/test/route-378a2e64adcc5f02.js +0 -1
  775. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-378a2e64adcc5f02.js +0 -1
  776. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  777. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  778. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  779. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  780. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/antigravity/bulk-import/route-378a2e64adcc5f02.js +0 -1
  781. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  782. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  783. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  784. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  785. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cloudflare-ai/bulk-import/route-378a2e64adcc5f02.js +0 -1
  786. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  787. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  788. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  789. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  790. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-import/route-378a2e64adcc5f02.js +0 -1
  791. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/bulk-token/route-378a2e64adcc5f02.js +0 -1
  792. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy/quota-cookie/route-378a2e64adcc5f02.js +0 -1
  793. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  794. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  795. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  796. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  797. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-378a2e64adcc5f02.js +0 -1
  798. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-token/route-378a2e64adcc5f02.js +0 -1
  799. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/quota-cookie/route-378a2e64adcc5f02.js +0 -1
  800. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-378a2e64adcc5f02.js +0 -1
  801. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-378a2e64adcc5f02.js +0 -1
  802. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-378a2e64adcc5f02.js +0 -1
  803. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-378a2e64adcc5f02.js +0 -1
  804. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  805. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  806. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  807. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  808. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-378a2e64adcc5f02.js +0 -1
  809. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-token/route-378a2e64adcc5f02.js +0 -1
  810. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-378a2e64adcc5f02.js +0 -1
  811. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-378a2e64adcc5f02.js +0 -1
  812. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-378a2e64adcc5f02.js +0 -1
  813. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  814. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  815. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  816. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  817. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/bulk-import/route-378a2e64adcc5f02.js +0 -1
  818. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-378a2e64adcc5f02.js +0 -1
  819. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-378a2e64adcc5f02.js +0 -1
  820. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-378a2e64adcc5f02.js +0 -1
  821. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-378a2e64adcc5f02.js +0 -1
  822. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route-378a2e64adcc5f02.js +0 -1
  823. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route-378a2e64adcc5f02.js +0 -1
  824. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/[jobId]/route-378a2e64adcc5f02.js +0 -1
  825. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/latest/route-378a2e64adcc5f02.js +0 -1
  826. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/qoder/bulk-import/route-378a2e64adcc5f02.js +0 -1
  827. package/cli/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-378a2e64adcc5f02.js +0 -1
  828. package/cli/app/.next-cli-build/static/chunks/app/api/pricing/route-378a2e64adcc5f02.js +0 -1
  829. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-378a2e64adcc5f02.js +0 -1
  830. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-378a2e64adcc5f02.js +0 -1
  831. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-378a2e64adcc5f02.js +0 -1
  832. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-378a2e64adcc5f02.js +0 -1
  833. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-378a2e64adcc5f02.js +0 -1
  834. package/cli/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-378a2e64adcc5f02.js +0 -1
  835. package/cli/app/.next-cli-build/static/chunks/app/api/providers/bulk-delete/route-378a2e64adcc5f02.js +0 -1
  836. package/cli/app/.next-cli-build/static/chunks/app/api/providers/client/route-378a2e64adcc5f02.js +0 -1
  837. package/cli/app/.next-cli-build/static/chunks/app/api/providers/codebuddy/discover-models/route-378a2e64adcc5f02.js +0 -1
  838. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-378a2e64adcc5f02.js +0 -1
  839. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kiro/discover-models/route-378a2e64adcc5f02.js +0 -1
  840. package/cli/app/.next-cli-build/static/chunks/app/api/providers/kiro/models/route-378a2e64adcc5f02.js +0 -1
  841. package/cli/app/.next-cli-build/static/chunks/app/api/providers/opencode/discover-models/route-378a2e64adcc5f02.js +0 -1
  842. package/cli/app/.next-cli-build/static/chunks/app/api/providers/route-378a2e64adcc5f02.js +0 -1
  843. package/cli/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-378a2e64adcc5f02.js +0 -1
  844. package/cli/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-378a2e64adcc5f02.js +0 -1
  845. package/cli/app/.next-cli-build/static/chunks/app/api/providers/validate/route-378a2e64adcc5f02.js +0 -1
  846. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-378a2e64adcc5f02.js +0 -1
  847. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-378a2e64adcc5f02.js +0 -1
  848. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-378a2e64adcc5f02.js +0 -1
  849. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-378a2e64adcc5f02.js +0 -1
  850. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-378a2e64adcc5f02.js +0 -1
  851. package/cli/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-378a2e64adcc5f02.js +0 -1
  852. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-378a2e64adcc5f02.js +0 -1
  853. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-378a2e64adcc5f02.js +0 -1
  854. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-378a2e64adcc5f02.js +0 -1
  855. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-378a2e64adcc5f02.js +0 -1
  856. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-378a2e64adcc5f02.js +0 -1
  857. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-378a2e64adcc5f02.js +0 -1
  858. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-378a2e64adcc5f02.js +0 -1
  859. package/cli/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-378a2e64adcc5f02.js +0 -1
  860. package/cli/app/.next-cli-build/static/chunks/app/api/settings/database/route-378a2e64adcc5f02.js +0 -1
  861. package/cli/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-378a2e64adcc5f02.js +0 -1
  862. package/cli/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-378a2e64adcc5f02.js +0 -1
  863. package/cli/app/.next-cli-build/static/chunks/app/api/settings/route-378a2e64adcc5f02.js +0 -1
  864. package/cli/app/.next-cli-build/static/chunks/app/api/shutdown/route-378a2e64adcc5f02.js +0 -1
  865. package/cli/app/.next-cli-build/static/chunks/app/api/tags/route-378a2e64adcc5f02.js +0 -1
  866. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/setup/route-378a2e64adcc5f02.js +0 -1
  867. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/status/route-378a2e64adcc5f02.js +0 -1
  868. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/auth/unlock/route-378a2e64adcc5f02.js +0 -1
  869. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/input/route-378a2e64adcc5f02.js +0 -1
  870. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/resize/route-378a2e64adcc5f02.js +0 -1
  871. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/route-378a2e64adcc5f02.js +0 -1
  872. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/[id]/stream/route-378a2e64adcc5f02.js +0 -1
  873. package/cli/app/.next-cli-build/static/chunks/app/api/terminal/session/route-378a2e64adcc5f02.js +0 -1
  874. package/cli/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-378a2e64adcc5f02.js +0 -1
  875. package/cli/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-378a2e64adcc5f02.js +0 -1
  876. package/cli/app/.next-cli-build/static/chunks/app/api/translator/load/route-378a2e64adcc5f02.js +0 -1
  877. package/cli/app/.next-cli-build/static/chunks/app/api/translator/save/route-378a2e64adcc5f02.js +0 -1
  878. package/cli/app/.next-cli-build/static/chunks/app/api/translator/send/route-378a2e64adcc5f02.js +0 -1
  879. package/cli/app/.next-cli-build/static/chunks/app/api/translator/translate/route-378a2e64adcc5f02.js +0 -1
  880. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-378a2e64adcc5f02.js +0 -1
  881. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-378a2e64adcc5f02.js +0 -1
  882. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-378a2e64adcc5f02.js +0 -1
  883. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-378a2e64adcc5f02.js +0 -1
  884. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-378a2e64adcc5f02.js +0 -1
  885. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-378a2e64adcc5f02.js +0 -1
  886. package/cli/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-378a2e64adcc5f02.js +0 -1
  887. package/cli/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-378a2e64adcc5f02.js +0 -1
  888. package/cli/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-378a2e64adcc5f02.js +0 -1
  889. package/cli/app/.next-cli-build/static/chunks/app/api/usage/aggregate/route-378a2e64adcc5f02.js +0 -1
  890. package/cli/app/.next-cli-build/static/chunks/app/api/usage/chart/route-378a2e64adcc5f02.js +0 -1
  891. package/cli/app/.next-cli-build/static/chunks/app/api/usage/history/route-378a2e64adcc5f02.js +0 -1
  892. package/cli/app/.next-cli-build/static/chunks/app/api/usage/logs/route-378a2e64adcc5f02.js +0 -1
  893. package/cli/app/.next-cli-build/static/chunks/app/api/usage/providers/route-378a2e64adcc5f02.js +0 -1
  894. package/cli/app/.next-cli-build/static/chunks/app/api/usage/quota-stream/route-378a2e64adcc5f02.js +0 -1
  895. package/cli/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-378a2e64adcc5f02.js +0 -1
  896. package/cli/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-378a2e64adcc5f02.js +0 -1
  897. package/cli/app/.next-cli-build/static/chunks/app/api/usage/routing-stream/route-378a2e64adcc5f02.js +0 -1
  898. package/cli/app/.next-cli-build/static/chunks/app/api/usage/stats/route-378a2e64adcc5f02.js +0 -1
  899. package/cli/app/.next-cli-build/static/chunks/app/api/usage/stream/route-378a2e64adcc5f02.js +0 -1
  900. package/cli/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-378a2e64adcc5f02.js +0 -1
  901. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-378a2e64adcc5f02.js +0 -1
  902. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-378a2e64adcc5f02.js +0 -1
  903. package/cli/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-378a2e64adcc5f02.js +0 -1
  904. package/cli/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-378a2e64adcc5f02.js +0 -1
  905. package/cli/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-378a2e64adcc5f02.js +0 -1
  906. package/cli/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-378a2e64adcc5f02.js +0 -1
  907. package/cli/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-378a2e64adcc5f02.js +0 -1
  908. package/cli/app/.next-cli-build/static/chunks/app/api/v1/messages/route-378a2e64adcc5f02.js +0 -1
  909. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-378a2e64adcc5f02.js +0 -1
  910. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-378a2e64adcc5f02.js +0 -1
  911. package/cli/app/.next-cli-build/static/chunks/app/api/v1/models/route-378a2e64adcc5f02.js +0 -1
  912. package/cli/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-378a2e64adcc5f02.js +0 -1
  913. package/cli/app/.next-cli-build/static/chunks/app/api/v1/responses/route-378a2e64adcc5f02.js +0 -1
  914. package/cli/app/.next-cli-build/static/chunks/app/api/v1/route-378a2e64adcc5f02.js +0 -1
  915. package/cli/app/.next-cli-build/static/chunks/app/api/v1/search/route-378a2e64adcc5f02.js +0 -1
  916. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-378a2e64adcc5f02.js +0 -1
  917. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-378a2e64adcc5f02.js +0 -1
  918. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-378a2e64adcc5f02.js +0 -1
  919. package/cli/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-378a2e64adcc5f02.js +0 -1
  920. package/cli/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-378a2e64adcc5f02.js +0 -1
  921. package/cli/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-378a2e64adcc5f02.js +0 -1
  922. package/cli/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-378a2e64adcc5f02.js +0 -1
  923. package/cli/app/.next-cli-build/static/chunks/app/api/version/route-378a2e64adcc5f02.js +0 -1
  924. package/cli/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-378a2e64adcc5f02.js +0 -1
  925. package/cli/app/.next-cli-build/static/chunks/app/api/version/update/route-378a2e64adcc5f02.js +0 -1
  926. package/cli/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-378a2e64adcc5f02.js +0 -1
  927. package/cli/app/.next-cli-build/static/chunks/app/page-378a2e64adcc5f02.js +0 -1
  928. package/cli/app/.next-cli-build/static/chunks/app/provider-icons/[provider]/route-378a2e64adcc5f02.js +0 -1
  929. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-378a2e64adcc5f02.js +0 -1
  930. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-378a2e64adcc5f02.js +0 -1
  931. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-378a2e64adcc5f02.js +0 -1
  932. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-378a2e64adcc5f02.js +0 -1
  933. package/cli/app/.next-cli-build/static/xMoj4_bjwJPoc8IRqfkM8/_buildManifest.js +0 -1
  934. /package/cli/app/.next-cli-build/static/{xMoj4_bjwJPoc8IRqfkM8 → irN0Xw2r75K1uQTN_Q0Xt}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},9825:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},22977:(a,b,c)=>{Promise.resolve().then(c.bind(c,95318))},25049:(a,b,c)=>{"use strict";c.d(b,{c:()=>e});var d=c(67484);function e(a={}){let[b,c]=(0,d.useState)(null);return JSON.stringify(Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).sort(([a],[b])=>a.localeCompare(b))),b}c(74875)},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},52392:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/zevairouter-build/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/zevairouter-build/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},55511:a=>{"use strict";a.exports=require("crypto")},58962:(a,b,c)=>{"use strict";c.d(b,{x6:()=>d.fetchJson,E2:()=>e,gs:()=>f});var d=c(86819);function e(a){if(!a)return null;let b=a.match(/\b([45]\d{2})\b/);return b?b[1]:"ERR"}function f(a){if(!a)return"";let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return`${d}d ago`}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},74875:(a,b,c)=>{"use strict";c.d(b,{BU:()=>l,G9:()=>h,d4:()=>j,gJ:()=>d,i2:()=>k});let d=[{id:"all",label:"All"},{id:"active",label:"Active",keys:["active"]},{id:"errors",label:"Errors",keys:["connection_error","auth_error","quota_exhausted","rate_limited","banned","cooldown","unknown"]},{id:"connection",label:"Connection",keys:["connection_error"]},{id:"auth",label:"Auth",keys:["auth_error"]},{id:"limit",label:"Limit",keys:["rate_limited","cooldown"]},{id:"exhausted",label:"Exhausted",keys:["quota_exhausted"]},{id:"banned",label:"Banned",keys:["banned"]},{id:"disabled",label:"Disabled",keys:["disabled"]}],e={active:{label:"active",severity:"success",terminal:!1},disabled:{label:"disabled",severity:"default",terminal:!1},connection_error:{label:"connection error",severity:"error",terminal:!1},auth_error:{label:"auth error",severity:"error",terminal:!0},quota_exhausted:{label:"exhausted",severity:"error",terminal:!0},rate_limited:{label:"rate limited",severity:"warning",terminal:!1},banned:{label:"banned",severity:"error",terminal:!0},cooldown:{label:"cooldown",severity:"warning",terminal:!1},unknown:{label:"unknown",severity:"default",terminal:!1}},f={policy_suspended:"banned",account_validation_required:"auth_error",credential_rejected:"auth_error",reauth_required:"auth_error",authentication:"auth_error",entitlement_or_quota:"quota_exhausted",rate_limited:"rate_limited",permission_denied:"auth_error",upstream_transient:"connection_error"};function g(a){if(!a)return"";if("string"==typeof a)return a.toLowerCase();try{return JSON.stringify(a).toLowerCase()}catch{return String(a).toLowerCase()}}function h(a={},b=Date.now()){let c=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>new Date(a).getTime()).filter(a=>Number.isFinite(a)&&a>b);return c.length>0?new Date(Math.min(...c)).toISOString():null}function i(a,b=""){let c=e[a]||e.unknown;return{key:a,...c,reason:b}}function j(a={}){var b;let c=(b=a).quarantinedAt?i(f[g(b.failureClass)]||"unknown",b.quarantineReason||b.lastError||"Connection is quarantined"):null;if(c)return c;if(!1===a.isActive)return i("disabled","Connection is disabled");if(function(a={}){return null!==h(a)}(a))return i("cooldown","Model cooldown is active");if(function(a){if(!a)return!1;let b=new Date(a).getTime();return Number.isFinite(b)&&b>Date.now()}(a.rateLimitedUntil))return i("rate_limited","Rate limit cooldown is active");let d=g(a.testStatus||a.status),e=g(a.lastErrorType||a.errorType),k=g(a.errorCode||a.statusCode),l=g(a.lastError||a.error),m=`${d} ${e} ${k} ${l}`.trim();return!m||["active","success","ok"].includes(d)?i("active",""):m.includes("ban")||m.includes("suspend")||m.includes("restricted")?i("banned",a.lastError||"Account appears restricted"):m.includes("exhaust")||m.includes("quota exceeded")||m.includes("insufficient_quota")||m.includes("payment required")||"402"===k?i("quota_exhausted",a.lastError||"Quota exhausted"):e.includes("rate_limited")||m.includes("rate limit")||m.includes("too many requests")||"429"===k?i("rate_limited",a.lastError||"Rate limited"):e.includes("auth")||e.includes("token")||m.includes("unauthorized")||m.includes("invalid api key")||m.includes("token invalid")||m.includes("token expired")||m.includes("revoked")||"401"===k||"403"===k?i("auth_error",a.lastError||"Authentication failed"):e.includes("network")||m.includes("network")||m.includes("timeout")||m.includes("fetch failed")||m.includes("econn")||m.includes("dns")||m.includes("proxy")?i("connection_error",a.lastError||"Connection failed"):["error","expired","unavailable","failed"].includes(d)?i("connection_error",a.lastError||a.testStatus||"Connection failed"):i("unknown",a.lastError||a.testStatus||"")}function k(a,b){if(!b||"all"===b)return!0;let c=d.find(a=>a.id===b);return!c||c.keys.includes(j(a).key)}function l(a){return a?.severity==="success"?"success":a?.severity==="error"?"error":"default"}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},86819:(a,b,c)=>{"use strict";c.d(b,{fetchJson:()=>e});let d={"Content-Type":"application/json"};async function e(a,b={}){let{body:c,headers:f,...g}=b,h={...g,headers:{...d,...f}};void 0!==c&&"string"!=typeof c?h.body=JSON.stringify(c):void 0!==c&&(h.body=c);let i=await fetch(a,h),j=await i.text(),k=null;if(j)try{k=JSON.parse(j)}catch{let b=Error(`Non-JSON response from ${a} (HTTP ${i.status})`);throw b.status=i.status,b.rawBody=j.slice(0,300),b}if(!i.ok){let a=k&&(k.error?.message||k.error||k.message)||`Request failed (HTTP ${i.status})`,b=Error("string"==typeof a?a:`HTTP ${i.status}`);throw b.status=i.status,b.data=k,b}return k}e.get=(a,b)=>e(a,{...b,method:"GET"}),e.post=(a,b,c)=>e(a,{...c,method:"POST",body:b}),e.put=(a,b,c)=>e(a,{...c,method:"PUT",body:b}),e.patch=(a,b,c)=>e(a,{...c,method:"PATCH",body:b}),e.del=(a,b)=>e(a,{...b,method:"DELETE"})},87550:a=>{"use strict";a.exports=require("better-sqlite3")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")},95318:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>ad});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(50412),k=c(96919);let l=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function m(a){return l.includes(String(a||""))}function n(a){let b=String(a||"").trim();return b&&m(b)?`/dashboard/automation?provider=${encodeURIComponent(b)}`:"/dashboard/automation"}var o=c(91431),p=c(50377),q=c(99258),r=c(67088),s=c(74875);c(22062);let t=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),u=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),v=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})})});function w(a,b){a.includes(b)||a.push(b)}var x=c(41371),y=c(49885),z=c.n(y);function A({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:m,thinkingSuffix:n}){let o="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0,p=n?`${b}(${n})`:b;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:o?{color:o}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.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:p}),a.name&&(0,d.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:a.name})]}),k&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:k,disabled:l,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${l?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:l?{animation:"spin 1s linear infinite"}:void 0,children:l?"progress_activity":"science"})}),(0,d.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:l?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(p,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):m?(0,d.jsx)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function B({models:a,modelAliases:b,providerStorageAlias:c,providerDisplayAlias:d}){let e={...b||{}},f=new Set(Object.values(e)),g=[];for(let b of Array.isArray(a)?a:[]){let a=function(a){if(!a)return"";if("string"==typeof a)return a.trim();let b=a.id||a.name||a.model;return"string"==typeof b?b.trim():""}(b);if(!a)continue;let h=`${c}/${a}`;if(f.has(h))continue;let i=function(a,b,c){let d=a.split("/"),e=d[d.length-1];if(!e)return"";if(!b[e])return e;let f=`${c}-${e}`;if(!b[f])return f;let g=2;for(;b[`${f}-${g}`];)g+=1;return`${f}-${g}`}(a,e,d);i&&(g.push({alias:i,model:h,modelId:a}),e[i]=h,f.add(h))}return g}function C({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function D({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,copied:f,onCopy:g,onSetAlias:h,onDeleteAlias:i,onAliasesChanged:k,connections:l,isAnthropic:m}){let[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(()=>new Set),[v,w]=(0,e.useState)({}),x=async b=>{let c=`${a}/${b}`;u(a=>new Set(a).add(b));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:c})}),b=await a.json();w(a=>({...a,[c]:b.ok?"ok":"error"}))}catch{w(a=>({...a,[c]:"error"}))}finally{u(a=>{let c=new Set(a);return c.delete(b),c})}},y=Object.entries(c).filter(([,b])=>b.startsWith(`${a}/`)).map(([b,c])=>({modelId:c.replace(`${a}/`,""),fullModel:c,alias:b})),z=async()=>{if(!n.trim()||p)return;let d=n.trim(),[e]=B({models:[{id:d}],modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(!e)return void alert("This model already exists.");q(!0);try{await h(d,e.alias,a),o("")}catch(a){console.log("Error adding model:",a),alert(a?.message||`Failed to add model "${d}".`)}finally{q(!1)}},A=async()=>{if(r)return;let d=l.find(a=>!1!==a.isActive);if(d){s(!0);try{let e=await fetch(`/api/providers/${d.id}/models`),f=await e.json();if(!e.ok)return void alert(f.error||"Failed to import models");let g=f.models||[];if(0===g.length)return void alert("No models returned from /models.");let h=B({models:g,modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(0===h.length)return void alert("No new models were added.");let i=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:h.map(({alias:a,model:b})=>({alias:a,model:b}))})}),j=await i.json();if(!i.ok)throw Error(j.error||"Failed to save imported models.");await k(),alert(`Successfully added ${j.count||h.length} models.`)}catch(a){console.log("Error importing models:",a),alert(a?.message||"Failed to import models from /models.")}finally{s(!1)}}},E=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",m?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:n,onChange:a=>o(a.target.value),onKeyDown:a=>"Enter"===a.key&&z(),placeholder:m?"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,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:z,disabled:!n.trim()||p,children:p?"Adding...":"Add"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!E||r,children:r?"Importing...":"Import from /models"})]}),!E&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),y.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:y.map(({modelId:c,fullModel:e,alias:h})=>(0,d.jsx)(C,{modelId:c,fullModel:`${b}/${c}`,copied:f,onCopy:g,onDeleteAlias:()=>i(h),onTest:l.length>0?()=>x(c):void 0,testStatus:v[`${a}/${c}`],isTesting:t.has(c)},e))})]})}A.propTypes={model:z().shape({id:z().string.isRequired}).isRequired,fullModel:z().string.isRequired,alias:z().string,copied:z().string,onCopy:z().func.isRequired,testStatus:z().oneOf(["ok","error"]),isCustom:z().bool,isFree:z().bool,onDeleteAlias:z().func,onTest:z().func,isTesting:z().bool,onDisable:z().func,thinkingSuffix:z().string},z().string.isRequired,z().string.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func,z().oneOf(["ok","error"]),z().bool,z().string.isRequired,z().object.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func.isRequired,D.propTypes={providerStorageAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,modelAliases:z().object.isRequired,copied:z().string,onCopy:z().func.isRequired,onSetAlias:z().func.isRequired,onDeleteAlias:z().func.isRequired,onAliasesChanged:z().func.isRequired,connections:z().arrayOf(z().shape({id:z().string,isActive:z().bool})).isRequired,isAnthropic:z().bool};var E=c(25049);function F({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function G({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:k,onUpdateProxy:l,onEdit:m,onDelete:n,autoPingEnabled:o=!1,onToggleAutoPing:p,oneByOneStatus:q=null}){let[r,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),x=(0,e.useMemo)(()=>new Map((b||[]).map(a=>[a.id,a])),[b]),y=(0,e.useMemo)(()=>b||[],[b]),z=a.providerSpecificData?.proxyPoolId||null,A=z?x.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",H="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);H=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{H=b}}let I=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",J="default";A?.isActive===!0?J="success":(z||B)&&(J="error");let K=async a=>{v(!0);try{await l("__none__"===a?null:a)}finally{v(!1),t(!1)}},L=a.authType||(c?"oauth":"apikey"),M="oauth"===L,N="cookie"===L,O=a=>"string"==typeof a&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),P=M?O(a.email)?a.email:O(a.name)?a.name:a.name||a.email||a.displayName||"OAuth Account":a.name||a.email||a.displayName||"API Key",Q=(0,E.c)(a),R=null!==Q,S="unavailable"!==a.testStatus||R?a.testStatus:"active",T=(0,s.d4)(a),U=!!a.quarantinedAt,V={policy_suspended:"Policy suspension",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[a.failureClass]||a.quarantineReason||"Account quarantined",W=Number.isFinite(Date.parse(a.quarantinedAt))?new Date(a.quarantinedAt).toLocaleString():a.quarantinedAt||null,X=a.modelLockReason?.resetsAt,Y=Number.isFinite(Date.parse(X))?new Date(X).toLocaleString():X||null,Z=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.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===a.isActive&&!U?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:N?"cookie":M?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:P}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(j.Ex,{variant:(()=>{if(!1===a.isActive)return"default";let b=(0,s.BU)(T);return"active"!==T.key?b:"active"===S||"success"===S?"success":"error"===S||"expired"===S||"unavailable"===S?"error":"default"})(),size:"sm",dot:!0,children:T.label||S||"unknown"}),(0,d.jsx)(j.Ex,{variant:"default",size:"sm",children:M?"OAuth":N?"Cookie":"API Key"}),U&&(0,d.jsx)(j.Ex,{variant:"error",size:"sm",children:"Quarantined"}),C&&(0,d.jsx)(j.Ex,{variant:J,size:"sm",children:"Proxy"}),a.autoDisabledAt&&!U&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===a.autoDisabledReason?"Token expired":"banned"===a.autoDisabledReason?"Banned":"quota_exhausted"===a.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(a.autoDisabledAt).toLocaleDateString()]}),U&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${a.quarantineReason||V}${W?` - ${W}`:""}`,children:[V,W?` - ${W}`:""]}),R&&!1!==a.isActive&&(0,d.jsx)(F,{until:Q}),R&&a.modelLockReason&&!1!==a.isActive&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${a.modelLockReason.reason}${Y?` — resets ${Y}`:""}`,children:[a.modelLockReason.model,a.modelLockReason.providerErrorCode?` (${a.modelLockReason.providerErrorCode})`:"",Y?` — resets ${Y}`:""]}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),Z()&&(0,d.jsx)(j.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:Z()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),H&&(0,d.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:H}),I&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]}),U&&!1===a.isActive&&(0,d.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[y.length>0&&(0,d.jsxs)("div",{className:"relative",ref:w,children:[(0,d.jsxs)("button",{onClick:()=>t(a=>!a),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:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:u?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),r&&(0,d.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,d.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),y.map(a=>(0,d.jsx)("button",{onClick:()=>K(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsxs)("button",{onClick:()=>p(!o),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${o?"text-primary":"text-text-muted hover:text-primary"}`,title:o?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),(0,d.jsxs)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:k,title:a.isActive??!0?"Disable connection":U?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}F.propTypes={until:z().string.isRequired},G.propTypes={connection:z().shape({id:z().string,name:z().string,email:z().string,displayName:z().string,modelLockUntil:z().string,testStatus:z().string,isActive:z().bool,lastError:z().string,failureClass:z().string,quarantinedAt:z().string,quarantineReason:z().string,priority:z().number,globalPriority:z().number}).isRequired,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string,proxyUrl:z().string,noProxy:z().string,isActive:z().bool})),isOAuth:z().bool.isRequired,isFirst:z().bool.isRequired,isLast:z().bool.isRequired,onMoveUp:z().func.isRequired,onMoveDown:z().func.isRequired,onToggleActive:z().func.isRequired,onUpdateProxy:z().func,autoPingEnabled:z().bool,onToggleAutoPing:z().func,onEdit:z().func.isRequired,onDelete:z().func.isRequired,oneByOneStatus:z().shape({state:z().string,error:z().string})};var H=c(58962);let I=`name1|sk-key1
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},9825:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20893:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/zevairouter-build/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/zevairouter-build/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},21820:a=>{"use strict";a.exports=require("os")},22977:(a,b,c)=>{Promise.resolve().then(c.bind(c,95318))},25049:(a,b,c)=>{"use strict";c.d(b,{c:()=>e});var d=c(67484);function e(a={}){let[b,c]=(0,d.useState)(null);return JSON.stringify(Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).sort(([a],[b])=>a.localeCompare(b))),b}c(74875)},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},55511:a=>{"use strict";a.exports=require("crypto")},58962:(a,b,c)=>{"use strict";c.d(b,{x6:()=>d.fetchJson,E2:()=>e,gs:()=>f});var d=c(86819);function e(a){if(!a)return null;let b=a.match(/\b([45]\d{2})\b/);return b?b[1]:"ERR"}function f(a){if(!a)return"";let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return`${d}d ago`}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},74875:(a,b,c)=>{"use strict";c.d(b,{BU:()=>l,G9:()=>h,d4:()=>j,gJ:()=>d,i2:()=>k});let d=[{id:"all",label:"All"},{id:"active",label:"Active",keys:["active"]},{id:"errors",label:"Errors",keys:["connection_error","auth_error","quota_exhausted","rate_limited","banned","cooldown","unknown"]},{id:"connection",label:"Connection",keys:["connection_error"]},{id:"auth",label:"Auth",keys:["auth_error"]},{id:"limit",label:"Limit",keys:["rate_limited","cooldown"]},{id:"exhausted",label:"Exhausted",keys:["quota_exhausted"]},{id:"banned",label:"Banned",keys:["banned"]},{id:"disabled",label:"Disabled",keys:["disabled"]}],e={active:{label:"active",severity:"success",terminal:!1},disabled:{label:"disabled",severity:"default",terminal:!1},connection_error:{label:"connection error",severity:"error",terminal:!1},auth_error:{label:"auth error",severity:"error",terminal:!0},quota_exhausted:{label:"exhausted",severity:"error",terminal:!0},rate_limited:{label:"rate limited",severity:"warning",terminal:!1},banned:{label:"banned",severity:"error",terminal:!0},cooldown:{label:"cooldown",severity:"warning",terminal:!1},unknown:{label:"unknown",severity:"default",terminal:!1}},f={policy_suspended:"banned",account_validation_required:"auth_error",credential_rejected:"auth_error",reauth_required:"auth_error",authentication:"auth_error",entitlement_or_quota:"quota_exhausted",rate_limited:"rate_limited",permission_denied:"auth_error",upstream_transient:"connection_error"};function g(a){if(!a)return"";if("string"==typeof a)return a.toLowerCase();try{return JSON.stringify(a).toLowerCase()}catch{return String(a).toLowerCase()}}function h(a={},b=Date.now()){let c=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>new Date(a).getTime()).filter(a=>Number.isFinite(a)&&a>b);return c.length>0?new Date(Math.min(...c)).toISOString():null}function i(a,b=""){let c=e[a]||e.unknown;return{key:a,...c,reason:b}}function j(a={}){var b;let c=(b=a).quarantinedAt?i(f[g(b.failureClass)]||"unknown",b.quarantineReason||b.lastError||"Connection is quarantined"):null;if(c)return c;if(!1===a.isActive)return i("disabled","Connection is disabled");if(function(a={}){return null!==h(a)}(a))return i("cooldown","Model cooldown is active");if(function(a){if(!a)return!1;let b=new Date(a).getTime();return Number.isFinite(b)&&b>Date.now()}(a.rateLimitedUntil))return i("rate_limited","Rate limit cooldown is active");let d=g(a.testStatus||a.status),e=g(a.lastErrorType||a.errorType),k=g(a.errorCode||a.statusCode),l=g(a.lastError||a.error),m=`${d} ${e} ${k} ${l}`.trim();return!m||["active","success","ok"].includes(d)?i("active",""):m.includes("ban")||m.includes("suspend")||m.includes("restricted")?i("banned",a.lastError||"Account appears restricted"):m.includes("exhaust")||m.includes("quota exceeded")||m.includes("insufficient_quota")||m.includes("payment required")||"402"===k?i("quota_exhausted",a.lastError||"Quota exhausted"):e.includes("rate_limited")||m.includes("rate limit")||m.includes("too many requests")||"429"===k?i("rate_limited",a.lastError||"Rate limited"):e.includes("auth")||e.includes("token")||m.includes("unauthorized")||m.includes("invalid api key")||m.includes("token invalid")||m.includes("token expired")||m.includes("revoked")||"401"===k||"403"===k?i("auth_error",a.lastError||"Authentication failed"):e.includes("network")||m.includes("network")||m.includes("timeout")||m.includes("fetch failed")||m.includes("econn")||m.includes("dns")||m.includes("proxy")?i("connection_error",a.lastError||"Connection failed"):["error","expired","unavailable","failed"].includes(d)?i("connection_error",a.lastError||a.testStatus||"Connection failed"):i("unknown",a.lastError||a.testStatus||"")}function k(a,b){if(!b||"all"===b)return!0;let c=d.find(a=>a.id===b);return!c||c.keys.includes(j(a).key)}function l(a){return a?.severity==="success"?"success":a?.severity==="error"?"error":"default"}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},86819:(a,b,c)=>{"use strict";c.d(b,{fetchJson:()=>e});let d={"Content-Type":"application/json"};async function e(a,b={}){let{body:c,headers:f,...g}=b,h={...g,headers:{...d,...f}};void 0!==c&&"string"!=typeof c?h.body=JSON.stringify(c):void 0!==c&&(h.body=c);let i=await fetch(a,h),j=await i.text(),k=null;if(j)try{k=JSON.parse(j)}catch{let b=Error(`Non-JSON response from ${a} (HTTP ${i.status})`);throw b.status=i.status,b.rawBody=j.slice(0,300),b}if(!i.ok){let a=k&&(k.error?.message||k.error||k.message)||`Request failed (HTTP ${i.status})`,b=Error("string"==typeof a?a:`HTTP ${i.status}`);throw b.status=i.status,b.data=k,b}return k}e.get=(a,b)=>e(a,{...b,method:"GET"}),e.post=(a,b,c)=>e(a,{...c,method:"POST",body:b}),e.put=(a,b,c)=>e(a,{...c,method:"PUT",body:b}),e.patch=(a,b,c)=>e(a,{...c,method:"PATCH",body:b}),e.del=(a,b)=>e(a,{...b,method:"DELETE"})},87550:a=>{"use strict";a.exports=require("better-sqlite3")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")},95318:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>ad});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(50412),k=c(96919);let l=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function m(a){return l.includes(String(a||""))}function n(a){let b=String(a||"").trim();return b&&m(b)?`/dashboard/automation?provider=${encodeURIComponent(b)}`:"/dashboard/automation"}var o=c(91431),p=c(50377),q=c(99258),r=c(67088),s=c(74875);c(22062);let t=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),u=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),v=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})})});function w(a,b){a.includes(b)||a.push(b)}var x=c(41371),y=c(49885),z=c.n(y);function A({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:m,thinkingSuffix:n}){let o="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0,p=n?`${b}(${n})`:b;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:o?{color:o}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.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:p}),a.name&&(0,d.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:a.name})]}),k&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:k,disabled:l,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${l?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:l?{animation:"spin 1s linear infinite"}:void 0,children:l?"progress_activity":"science"})}),(0,d.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:l?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(p,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):m?(0,d.jsx)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function B({models:a,modelAliases:b,providerStorageAlias:c,providerDisplayAlias:d}){let e={...b||{}},f=new Set(Object.values(e)),g=[];for(let b of Array.isArray(a)?a:[]){let a=function(a){if(!a)return"";if("string"==typeof a)return a.trim();let b=a.id||a.name||a.model;return"string"==typeof b?b.trim():""}(b);if(!a)continue;let h=`${c}/${a}`;if(f.has(h))continue;let i=function(a,b,c){let d=a.split("/"),e=d[d.length-1];if(!e)return"";if(!b[e])return e;let f=`${c}-${e}`;if(!b[f])return f;let g=2;for(;b[`${f}-${g}`];)g+=1;return`${f}-${g}`}(a,e,d);i&&(g.push({alias:i,model:h,modelId:a}),e[i]=h,f.add(h))}return g}function C({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function D({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,copied:f,onCopy:g,onSetAlias:h,onDeleteAlias:i,onAliasesChanged:k,connections:l,isAnthropic:m}){let[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(()=>new Set),[v,w]=(0,e.useState)({}),x=async b=>{let c=`${a}/${b}`;u(a=>new Set(a).add(b));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:c})}),b=await a.json();w(a=>({...a,[c]:b.ok?"ok":"error"}))}catch{w(a=>({...a,[c]:"error"}))}finally{u(a=>{let c=new Set(a);return c.delete(b),c})}},y=Object.entries(c).filter(([,b])=>b.startsWith(`${a}/`)).map(([b,c])=>({modelId:c.replace(`${a}/`,""),fullModel:c,alias:b})),z=async()=>{if(!n.trim()||p)return;let d=n.trim(),[e]=B({models:[{id:d}],modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(!e)return void alert("This model already exists.");q(!0);try{await h(d,e.alias,a),o("")}catch(a){console.log("Error adding model:",a),alert(a?.message||`Failed to add model "${d}".`)}finally{q(!1)}},A=async()=>{if(r)return;let d=l.find(a=>!1!==a.isActive);if(d){s(!0);try{let e=await fetch(`/api/providers/${d.id}/models`),f=await e.json();if(!e.ok)return void alert(f.error||"Failed to import models");let g=f.models||[];if(0===g.length)return void alert("No models returned from /models.");let h=B({models:g,modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(0===h.length)return void alert("No new models were added.");let i=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:h.map(({alias:a,model:b})=>({alias:a,model:b}))})}),j=await i.json();if(!i.ok)throw Error(j.error||"Failed to save imported models.");await k(),alert(`Successfully added ${j.count||h.length} models.`)}catch(a){console.log("Error importing models:",a),alert(a?.message||"Failed to import models from /models.")}finally{s(!1)}}},E=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",m?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:n,onChange:a=>o(a.target.value),onKeyDown:a=>"Enter"===a.key&&z(),placeholder:m?"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,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:z,disabled:!n.trim()||p,children:p?"Adding...":"Add"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!E||r,children:r?"Importing...":"Import from /models"})]}),!E&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),y.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:y.map(({modelId:c,fullModel:e,alias:h})=>(0,d.jsx)(C,{modelId:c,fullModel:`${b}/${c}`,copied:f,onCopy:g,onDeleteAlias:()=>i(h),onTest:l.length>0?()=>x(c):void 0,testStatus:v[`${a}/${c}`],isTesting:t.has(c)},e))})]})}A.propTypes={model:z().shape({id:z().string.isRequired}).isRequired,fullModel:z().string.isRequired,alias:z().string,copied:z().string,onCopy:z().func.isRequired,testStatus:z().oneOf(["ok","error"]),isCustom:z().bool,isFree:z().bool,onDeleteAlias:z().func,onTest:z().func,isTesting:z().bool,onDisable:z().func,thinkingSuffix:z().string},z().string.isRequired,z().string.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func,z().oneOf(["ok","error"]),z().bool,z().string.isRequired,z().object.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func.isRequired,D.propTypes={providerStorageAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,modelAliases:z().object.isRequired,copied:z().string,onCopy:z().func.isRequired,onSetAlias:z().func.isRequired,onDeleteAlias:z().func.isRequired,onAliasesChanged:z().func.isRequired,connections:z().arrayOf(z().shape({id:z().string,isActive:z().bool})).isRequired,isAnthropic:z().bool};var E=c(25049);function F({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function G({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:k,onUpdateProxy:l,onEdit:m,onDelete:n,autoPingEnabled:o=!1,onToggleAutoPing:p,oneByOneStatus:q=null}){let[r,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),x=(0,e.useMemo)(()=>new Map((b||[]).map(a=>[a.id,a])),[b]),y=(0,e.useMemo)(()=>b||[],[b]),z=a.providerSpecificData?.proxyPoolId||null,A=z?x.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",H="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);H=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{H=b}}let I=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",J="default";A?.isActive===!0?J="success":(z||B)&&(J="error");let K=async a=>{v(!0);try{await l("__none__"===a?null:a)}finally{v(!1),t(!1)}},L=a.authType||(c?"oauth":"apikey"),M="oauth"===L,N="cookie"===L,O=a=>"string"==typeof a&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),P=M?O(a.email)?a.email:O(a.name)?a.name:a.name||a.email||a.displayName||"OAuth Account":a.name||a.email||a.displayName||"API Key",Q=(0,E.c)(a),R=null!==Q,S="unavailable"!==a.testStatus||R?a.testStatus:"active",T=(0,s.d4)(a),U=!!a.quarantinedAt,V={policy_suspended:"Policy suspension",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[a.failureClass]||a.quarantineReason||"Account quarantined",W=Number.isFinite(Date.parse(a.quarantinedAt))?new Date(a.quarantinedAt).toLocaleString():a.quarantinedAt||null,X=a.modelLockReason?.resetsAt,Y=Number.isFinite(Date.parse(X))?new Date(X).toLocaleString():X||null,Z=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.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===a.isActive&&!U?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:N?"cookie":M?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:P}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(j.Ex,{variant:(()=>{if(!1===a.isActive)return"default";let b=(0,s.BU)(T);return"active"!==T.key?b:"active"===S||"success"===S?"success":"error"===S||"expired"===S||"unavailable"===S?"error":"default"})(),size:"sm",dot:!0,children:T.label||S||"unknown"}),(0,d.jsx)(j.Ex,{variant:"default",size:"sm",children:M?"OAuth":N?"Cookie":"API Key"}),U&&(0,d.jsx)(j.Ex,{variant:"error",size:"sm",children:"Quarantined"}),C&&(0,d.jsx)(j.Ex,{variant:J,size:"sm",children:"Proxy"}),a.autoDisabledAt&&!U&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===a.autoDisabledReason?"Token expired":"banned"===a.autoDisabledReason?"Banned":"quota_exhausted"===a.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(a.autoDisabledAt).toLocaleDateString()]}),U&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${a.quarantineReason||V}${W?` - ${W}`:""}`,children:[V,W?` - ${W}`:""]}),R&&!1!==a.isActive&&(0,d.jsx)(F,{until:Q}),R&&a.modelLockReason&&!1!==a.isActive&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${a.modelLockReason.reason}${Y?` — resets ${Y}`:""}`,children:[a.modelLockReason.model,a.modelLockReason.providerErrorCode?` (${a.modelLockReason.providerErrorCode})`:"",Y?` — resets ${Y}`:""]}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),Z()&&(0,d.jsx)(j.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:Z()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),H&&(0,d.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:H}),I&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]}),U&&!1===a.isActive&&(0,d.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[y.length>0&&(0,d.jsxs)("div",{className:"relative",ref:w,children:[(0,d.jsxs)("button",{onClick:()=>t(a=>!a),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:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:u?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),r&&(0,d.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,d.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),y.map(a=>(0,d.jsx)("button",{onClick:()=>K(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsxs)("button",{onClick:()=>p(!o),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${o?"text-primary":"text-text-muted hover:text-primary"}`,title:o?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),(0,d.jsxs)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:k,title:a.isActive??!0?"Disable connection":U?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}F.propTypes={until:z().string.isRequired},G.propTypes={connection:z().shape({id:z().string,name:z().string,email:z().string,displayName:z().string,modelLockUntil:z().string,testStatus:z().string,isActive:z().bool,lastError:z().string,failureClass:z().string,quarantinedAt:z().string,quarantineReason:z().string,priority:z().number,globalPriority:z().number}).isRequired,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string,proxyUrl:z().string,noProxy:z().string,isActive:z().bool})),isOAuth:z().bool.isRequired,isFirst:z().bool.isRequired,isLast:z().bool.isRequired,onMoveUp:z().func.isRequired,onMoveDown:z().func.isRequired,onToggleActive:z().func.isRequired,onUpdateProxy:z().func,autoPingEnabled:z().bool,onToggleAutoPing:z().func,onEdit:z().func.isRequired,onDelete:z().func.isRequired,oneByOneStatus:z().shape({state:z().string,error:z().string})};var H=c(58962);let I=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function J({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:l,proxyPools:m,error:n,onSave:o,onBulkDone:p,onClose:q}){let r="__none__",s="ollama-local"===b,t="cookie"===h,u="xai"===b&&!t,v=t?"Cookie Value":"qoder"===b?"Personal Access Token (PAT)":"API Key",w=t?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":u?"xai-...":"qoder"===b?"pt-...":"",x="azure"===b,y="cloudflare-ai"===b,z=k.Q2?.[b]?.regions||null,A=k.Q2?.[b]?.defaultRegion||z?.[0]?.id||"",[B,C]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:r,ollamaHostUrl:""}),[D,E]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[F,G]=(0,e.useState)({accountId:""}),[K,L]=(0,e.useState)(A),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)("single"),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(null);(0,e.useRef)(!1);let Y=()=>s&&B.ollamaHostUrl.trim()?{baseUrl:B.ollamaHostUrl.trim()}:x?{azureEndpoint:D.azureEndpoint,apiVersion:D.apiVersion,deployment:D.deployment,organization:D.organization}:y?{accountId:F.accountId}:z&&K?{region:K}:void 0,Z=async()=>{N(!0);try{let a=await (0,H.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:B.apiKey,providerSpecificData:Y()}});P(a.valid?"success":"failed")}catch{P("unknown")}finally{N(!1)}},$=async()=>{if(b&&(s||B.apiKey)&&(s||B.name)&&(!f||B.defaultModel.trim())){R(!0);try{let a=!1;try{N(!0),P(null),a=!!(await (0,H.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:B.apiKey,providerSpecificData:Y()}})).valid,P(a?"success":"failed")}catch{P("unknown")}finally{N(!1)}let c=Number.parseInt(B.priority,10);await o({name:B.name||(s?"Ollama Local":""),apiKey:B.apiKey,defaultModel:f?B.defaultModel.trim():void 0,priority:Number.isFinite(c)?c:1,proxyPoolId:B.proxyPoolId===r?null:B.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Y()})}finally{R(!1)}}},_=async()=>{let a=U.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return;R(!0),X(null);let c=0,d=0,e=[],f=[];for(let g=0;g<a.length;g++){let h=a[g].split("|"),i=h.length>=2?h.slice(1).join("|").trim():h[0].trim(),j=h.length>=2?h[0].trim():"Key",k=`${j} ${g+1}`;try{await (0,H.x6)("/api/providers",{method:"POST",body:{provider:b,apiKey:i,name:k,priority:1,testStatus:"unknown"}}),c++}catch(b){d++,e.push({line:a[g],message:b?.message||"Request failed"}),f.push(a[g])}}R(!1),X({success:c,failed:d,failedRows:e}),V(f.join("\n")),c>0&&p&&p()};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Add ${c||b} ${v}`,onClose:q,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"single"===S?"primary":"ghost",onClick:()=>{T("single"),X(null)},children:"Single"}),(0,d.jsx)(j.$n,{size:"sm",variant:"bulk"===S?"primary":"ghost",onClick:()=>{T("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===S&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:I,value:U,onChange:a=>V(a.target.value)}),W&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),W.failedRows?.length>0&&(0,d.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:W.failedRows.map((a,b)=>(0,d.jsxs)("li",{className:"break-words",children:[(0,d.jsx)("span",{className:"font-mono",children:a.line.length>40?`${a.line.slice(0,40)}…`:a.line}),` — ${a.message}`]},b))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:_,fullWidth:!0,disabled:Q||!U.trim(),children:Q?"Adding...":"Add All Keys"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{label:"Name",value:B.name,onChange:a=>C({...B,name:a.target.value}),placeholder:s?"Ollama Local":"Production Key"}),s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"Ollama Host URL",value:B.ollamaHostUrl,onChange:a=>C({...B,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),!s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:v,type:t?"text":"password",value:B.apiKey,onChange:a=>C({...B,apiKey:a.target.value}),placeholder:w,className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:!B.apiKey||M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),u&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),t&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,l&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",l.replace(/^https?:\/\//,"")]})]})]}),z&&(0,d.jsx)(j.l6,{label:"Region",value:K,onChange:a=>L(a.target.value),options:z.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(j.pd,{label:"Default Model",value:B.defaultModel,onChange:a=>C({...B,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),s&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),O&&(0,d.jsx)(j.Ex,{variant:"success"===O?"success":"failed"===O?"error":"default",children:"success"===O?"Valid":"failed"===O?"Invalid":"Could not validate"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(j.pd,{label:"Account ID",value:F.accountId,onChange:a=>G({...F,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"Azure Endpoint",value:D.azureEndpoint,onChange:a=>E({...D,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(j.pd,{label:"Deployment Name",value:D.deployment,onChange:a=>E({...D,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(j.pd,{label:"API Version",value:D.apiVersion,onChange:a=>E({...D,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(j.pd,{label:"Organization",value:D.organization,onChange:a=>E({...D,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(j.pd,{label:"Priority",type:"number",value:B.priority,onChange:a=>C({...B,priority:a.target.value}),onBlur:a=>{let b=Number.parseInt(a.target.value,10);C(a=>({...a,priority:Number.isFinite(b)?b:1}))}}),(0,d.jsx)(j.l6,{label:"Proxy Pool",value:B.proxyPoolId,onChange:a=>C({...B,proxyPoolId:a.target.value}),options:[{value:r,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:$,fullWidth:!0,disabled:Q||!s&&(!B.name||!B.apiKey)||f&&!B.defaultModel.trim()||x&&(!D.azureEndpoint||!D.deployment||!D.organization)||y&&!F.accountId,children:Q?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function K({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(j.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(j.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(j.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(j.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(j.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||k,children:k?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function L({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"science",loading:"testing"===k,onClick:r,disabled:!h.trim()||"testing"===k,children:"testing"===k?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===k&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(j.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(j.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}J.propTypes={isOpen:z().bool.isRequired,provider:z().string,providerName:z().string,isCompatible:z().bool,isAnthropic:z().bool,authType:z().string,authHint:z().string,website:z().string,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string})),error:z().string,onSave:z().func.isRequired,onBulkDone:z().func,onClose:z().func.isRequired},K.propTypes={isOpen:z().bool.isRequired,node:z().shape({id:z().string,name:z().string,prefix:z().string,apiType:z().string,baseUrl:z().string}),onSave:z().func.isRequired,onClose:z().func.isRequired,isAnthropic:z().bool},L.propTypes={isOpen:z().bool.isRequired,providerAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,onSave:z().func.isRequired,onClose:z().func.isRequired};let M="/api/providers/codebuddy/discover-models",N={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},O={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function P(a,b){return a?.error||b}function Q({isOpen:a,connections:b,onModelsAdded:c,onClose:f}){let g=(0,e.useMemo)(()=>b.filter(a=>"codebuddy"===a.provider&&!1!==a.isActive),[b]),[h,i]=(0,e.useState)(null),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(()=>new Set),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(()=>new Set),C=(0,e.useCallback)(async()=>{l(!0),n(""),p(""),v(!1),z([]);try{let a=await fetch(M,{cache:"no-store"}),b=await a.json();if(!a.ok)throw Error(P(b,"Could not refresh model candidates"));i(b),r(new Set((b.hidden||[]).map(a=>a.id)))}catch(a){n(a.message)}finally{l(!1)}},[]),D=async()=>{if(s&&0!==q.size&&!w){x(!0),n(""),p("");try{let a=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:s,models:[...q]})}),b=await a.json();if(!a.ok)throw Error(P(b,"Hidden model scan failed"));z(b.results||[]),v(!1)}catch(a){n(a.message)}finally{x(!1)}}},E=(0,e.useMemo)(()=>new Map(y.map(a=>[a.id,a])),[y]),F=(0,e.useMemo)(()=>(h?.hidden||[]).filter(a=>{let b=E.get(a.id)?.status;return a.previouslyVerified||"verified"===b||"recognized"===b}),[h,E]),G=async a=>{let b=a.filter(a=>!A.has(a.id));if(!b.length)return;B(a=>new Set([...a,...b.map(a=>a.id)])),n(""),p("");let d=[];try{for(let a of b){let b=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"cb",id:a.id,type:"llm",name:a.name})}),c=await b.json();if(!b.ok)throw Error(P(c,`Could not add ${a.id}`));d.push(a)}window.dispatchEvent(new Event("customModelChanged")),await c?.(d),p(`${d.length} model${1===d.length?"":"s"} added to CodeBuddy Global.`)}catch(a){d.length&&(window.dispatchEvent(new Event("customModelChanged")),await c?.(d)),n(a.message)}finally{B(a=>{let c=new Set(a);return b.forEach(a=>c.delete(a.id)),c})}},H=F.filter(a=>q.has(a.id));return(0,d.jsx)(j.aF,{isOpen:a,onClose:f,title:"Discover CodeBuddy Global Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsx)("div",{className:"overflow-hidden rounded-xl border border-cyan-500/20 bg-gradient-to-br from-cyan-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Live package candidates"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"Refreshing reads Tencent's current CLI manifests and does not call a model or use credits."}),h?.version&&(0,d.jsxs)("p",{className:"mt-2 font-mono text-xs text-cyan-700 dark:text-cyan-300",children:["codebuddy-code@",h.version]})]}),(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:k,onClick:C,children:"Refresh Candidates"})]})}),m&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:m}),o&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:o}),h?.warnings?.map(a=>(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:a},a)),h&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.official?.length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Official Global"})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.hidden?.length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Hidden candidates"})]}),(0,d.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.hidden?.filter(a=>a.previouslyVerified).length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Previously verified"})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Hidden route candidates"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"From alternate official manifests; availability is not guaranteed on Global SaaS."})]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>r(q.size===(h.hidden?.length||0)?new Set:new Set(h.hidden.map(a=>a.id))),children:q.size===(h.hidden?.length||0)?"Clear":"Select all"})]}),(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:(h.hidden||[]).map(a=>{let b=E.get(a.id);return(0,d.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:q.has(a.id),onChange:()=>{var b;return b=a.id,void r(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-1 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:a.name}),(0,d.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:a.id}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:a.sources.length?a.sources.join(" + "):"request history"})]}),(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[a.previouslyVerified&&(0,d.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"previous success"}),b&&(0,d.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${O[b.status]||O.error}`,children:N[b.status]||b.status}),(a.previouslyVerified||["verified","recognized"].includes(b?.status))&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),G([a])},className:"text-xs font-semibold text-primary hover:underline",disabled:A.has(a.id),children:A.has(a.id)?"Adding...":"Add"})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-amber-500/25 bg-amber-500/[0.07] p-4",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,d.jsx)(j.l6,{label:"CodeBuddy Global connection",value:s,onChange:a=>t(a.target.value),options:g.map(a=>({value:a.id,label:a.name||a.email||a.id})),placeholder:"No active Global connection",disabled:!g.length||w,hint:"Every probe is pinned to this connection."}),(0,d.jsxs)(j.$n,{size:"sm",icon:"radar",onClick:()=>v(!0),disabled:!s||0===q.size||w,children:["Scan Hidden Models (",q.size,")"]})]}),!g.length&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a CodeBuddy Global connection before scanning."}),u&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-amber-500/40 bg-surface px-3 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using scan"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion probes and may consume CodeBuddy credits. Scanning uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,d.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>v(!1),disabled:w,children:"Cancel"}),(0,d.jsx)(j.$n,{size:"sm",icon:"science",loading:w,onClick:D,children:"Start Credit Scan"})]})]})]}),y.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[y.filter(a=>"verified"===a.status).length," verified, ",y.filter(a=>"recognized"===a.status).length," recognized, ",y.filter(a=>"unavailable"===a.status).length," unavailable"]}),(0,d.jsxs)(j.$n,{size:"sm",icon:"playlist_add",onClick:()=>G(H),disabled:!H.length||A.size>0,children:["Add Selected Available (",H.length,")"]})]})]})]})})}Q.propTypes={isOpen:z().bool.isRequired,connections:z().arrayOf(z().object).isRequired,onModelsAdded:z().func,onClose:z().func.isRequired};let R="/api/providers/opencode/discover-models",S={verified:"Verified (200 OK)",overloaded:"Overloaded (503)",unavailable:"Unavailable",deprecated:"Deprecated (410)",unsupported:"Protocol Unsupported",error:"Error"},T={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",overloaded:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",unavailable:"border-zinc-500/30 bg-zinc-500/[0.08] text-zinc-600 dark:text-zinc-400",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",error:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300"};function U({isOpen:a,onModelsAdded:b,onClose:c}){let[f,g]=(0,e.useState)([]),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>new Set),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(()=>new Set),[w,x]=(0,e.useState)(()=>new Set),y=(0,e.useCallback)(async()=>{i(!0),l(""),n(""),t([]);try{let a=await fetch(R,{cache:"no-store"}),b=await a.json();if(!a.ok)throw Error(b?.error||"Could not fetch OpenCode models");let c=b.candidates||[];g(c),p(new Set(c.map(a=>a.id))),x(new Set(c.filter(a=>a.isConfigured).map(a=>a.id)))}catch(a){l(a.message)}finally{i(!1)}},[]),z=async()=>{if(0!==o.size&&!q){r(!0),l(""),n("");try{let a=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:[...o]})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Live probe failed");t(b.results||[])}catch(a){l(a.message)}finally{r(!1)}}},A=(0,e.useMemo)(()=>new Map(s.map(a=>[a.id,a])),[s]),B=async a=>{let c=a.filter(a=>!u.has(a.id)&&!w.has(a.id));if(!c.length)return;v(a=>new Set([...a,...c.map(a=>a.id)])),l(""),n("");let d=[];try{for(let a of c){let b=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"oc",id:a.id,type:"llm",name:a.name||a.id})}),c=await b.json();if(!b.ok)throw Error(c?.error||`Could not add ${a.id}`);d.push(a)}window.dispatchEvent(new Event("customModelChanged")),x(a=>new Set([...a,...d.map(a=>a.id)])),await b?.(d),n(`${d.length} model${1===d.length?"":"s"} added to OpenCode Free!`)}catch(a){d.length&&(window.dispatchEvent(new Event("customModelChanged")),x(a=>new Set([...a,...d.map(a=>a.id)])),await b?.(d)),l(a.message)}finally{v(a=>{let b=new Set(a);return c.forEach(a=>b.delete(a.id)),b})}},C=(0,e.useMemo)(()=>f.filter(a=>{let b=A.get(a.id);return b?.ok&&!w.has(a.id)}),[f,A,w]);return(0,d.jsx)(j.aF,{isOpen:a,onClose:c,title:"Live Probe OpenCode Free Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsx)("div",{className:"overflow-hidden rounded-xl border border-orange-500/20 bg-gradient-to-br from-orange-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Upstream Catalog Live Probe"}),(0,d.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["Pulls candidates directly from ",(0,d.jsx)("span",{className:"font-mono",children:"opencode.ai/zen/v1/models"})," and tests real-time completions to verify which free models are alive."]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:h,onClick:y,children:"Refresh Catalog"}),(0,d.jsx)(j.$n,{size:"sm",icon:"radar",loading:q,disabled:0===o.size||q,onClick:z,className:"bg-orange-600 hover:bg-orange-700 text-white",children:q?"Probing Upstream...":`Live Probe (${o.size})`})]})]})}),k&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:k}),m&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:m}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Total Candidates: ",(0,d.jsx)("strong",{className:"text-text-main",children:f.length})]}),s.length>0&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["• Verified Live: ",(0,d.jsx)("strong",{className:"text-green-600",children:s.filter(a=>a.ok).length})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[C.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>B(C),disabled:u.size>0,className:"text-xs font-semibold text-primary hover:underline",children:["+ Add All Verified (",C.length,")"]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>p(o.size===f.length?new Set:new Set(f.map(a=>a.id))),children:o.size===f.length?"Deselect All":"Select All"})]})]}),(0,d.jsx)("div",{className:"max-h-96 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:f.map(a=>{let b=A.get(a.id),c=w.has(a.id),e=u.has(a.id);return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[(0,d.jsx)("input",{type:"checkbox",checked:o.has(a.id),onChange:()=>{var b;return b=a.id,void p(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"accent-orange-500"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:a.name}),c&&(0,d.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Active in Router"})]}),(0,d.jsxs)("span",{className:"block font-mono text-[11px] text-text-muted truncate",children:["oc/",a.id]})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[b?(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`rounded-full border px-2.5 py-0.5 text-[11px] font-medium ${T[b.status]||T.error}`,title:b.message,children:S[b.status]||b.statusText}),b.latencyMs>0&&(0,d.jsxs)("span",{className:"text-[11px] text-text-muted font-mono",children:[b.latencyMs,"ms"]})]}):(0,d.jsx)("span",{className:"text-[11px] text-text-muted italic",children:"Ready to probe"}),!c&&(0,d.jsx)("button",{type:"button",onClick:()=>B([a]),disabled:e,className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:e?"Adding...":"+ Add"})]})]},a.id)})}),(0,d.jsx)("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",onClick:c,children:"Close"})})]})})}U.propTypes={isOpen:z().bool.isRequired,onModelsAdded:z().func,onClose:z().func.isRequired};let V="/api/providers/kiro/discover-models",W={verified:"Verified",recognized:"Recognized (quota)",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},X={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"},Y={live:"live catalog",saved:"saved on account",alias:"your alias"};function Z(a){return a?a>=1e6?`${a/1e6}M`:`${Math.round(a/1e3)}K`:null}function $({isOpen:a,connections:b,onClose:c}){let f=(0,e.useMemo)(()=>b.filter(a=>"kiro"===a.provider&&!1!==a.isActive&&!a.quarantinedAt),[b]),[g,h]=(0,e.useState)(""),[i,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(()=>new Set),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async a=>{if(a){m(!0),o(""),A(""),s(!1),w([]);try{let b=await fetch(`${V}?connectionId=${encodeURIComponent(a)}`,{cache:"no-store"}),c=await b.json();if(!b.ok)throw Error(c?.error||"Could not refresh Kiro candidates");k(c),q(new Set((c.candidates||[]).filter(a=>!a.inLive).map(a=>a.id)))}catch(a){k(null),o(a.message)}finally{m(!1)}}},[]),C=async()=>{if(g&&0!==p.size&&!t){u(!0),o("");try{let a=await fetch(V,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:[...p]})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Kiro model probe failed");w(b.results||[]),s(!1)}catch(a){o(a.message)}finally{u(!1)}}},D=(0,e.useMemo)(()=>new Map(v.map(a=>[a.id,a])),[v]),E=i?.candidates||[],F=E.filter(a=>a.inLive).length,G=E.length-F,H=v.filter(a=>"verified"===a.status).map(a=>a.id),I=!!i&&!i.hasProfile&&H.length>0,J=async()=>{if(I&&!x){y(!0),o(""),A("");try{let a=await fetch(V,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:H})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Saving verified models failed");A(`${b.saved.length} verified model${1===b.saved.length?"":"s"} saved to this connection.`)}catch(a){o(a.message)}finally{y(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:c,title:"Live Probe Kiro Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"overflow-hidden rounded-xl border border-violet-500/20 bg-gradient-to-br from-violet-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,d.jsx)(j.l6,{label:"Kiro connection",value:g,onChange:a=>h(a.target.value),options:f.map(a=>({value:a.id,label:a.name||a.email||a.id})),placeholder:"No active Kiro connection",disabled:!f.length||t,hint:"The catalog and every probe are pinned to this connection."}),(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:l,disabled:!g||t,onClick:()=>B(g),children:"Refresh Catalog"})]}),(0,d.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing calls Kiro's ListAvailableModels for this account and does not use credits."}),!f.length&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Kiro connection first."})]}),n&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:n}),z&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:z}),i?.warnings?.map(a=>(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:a},a)),i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:F}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"In live catalog"})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:G}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Saved / alias only"})]}),(0,d.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,d.jsx)("p",{className:`text-sm font-semibold ${i.liveCatalog?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:i.liveCatalog?"Live catalog readable":"Live catalog unavailable"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:i.hasProfile?"Account has a CodeWhisperer profile":"No profile (API-key login)"})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Base models"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"-thinking and -agentic variants share their base model and are not probed separately."})]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>q(p.size===E.length?new Set:new Set(E.map(a=>a.id))),children:p.size===E.length?"Clear":"Select all"})]}),(0,d.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:E.map(a=>{let b=D.get(a.id),c=[Z(a.contextLength),Z(a.maxOutputTokens)].filter(Boolean).join(" / ");return(0,d.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:p.has(a.id),onChange:()=>{var b;return b=a.id,void q(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-1 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:a.name}),(0,d.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["kr/",a.id]}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.sources.map(a=>Y[a]||a).join(" + "),c&&` \xb7 ${c}`,a.rateMultiplier&&1!==a.rateMultiplier&&` \xb7 ${a.rateMultiplier}x credit`]})]}),(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[a.inLive&&(0,d.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"live"}),b&&(0,d.jsxs)("span",{title:b.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${X[b.status]||X.error}`,children:[W[b.status]||b.status,"verified"===b.status&&Number.isFinite(b.latencyMs)&&` \xb7 ${b.latencyMs}ms`]})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-amber-500/25 bg-amber-500/[0.07] p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:v.length>0?`${v.filter(a=>"verified"===a.status).length} verified, ${v.filter(a=>"unavailable"===a.status).length} unavailable, ${v.filter(a=>!["verified","unavailable"].includes(a.status)).length} other`:"Probe sends one real completion per selected model."}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[I&&(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"save",loading:x,onClick:J,children:["Save Verified to Connection (",H.length,")"]}),(0,d.jsxs)(j.$n,{size:"sm",icon:"radar",onClick:()=>s(!0),disabled:!g||0===p.size||t,children:["Probe Selected (",p.size,")"]})]})]}),r&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-amber-500/40 bg-surface px-3 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion requests and may consume Kiro credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,d.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>s(!1),disabled:t,children:"Cancel"}),(0,d.jsx)(j.$n,{size:"sm",icon:"science",loading:t,onClick:C,children:"Start Probe"})]})]})]})]})]})})}function _({showAutomation:a,showAddConnection:b,onOpenAutomation:c,onAddConnection:e}){return a||b?(0,d.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:flex-wrap sm:justify-end",children:[a?(0,d.jsx)(j.$n,{size:"sm",icon:"automation",variant:"secondary",onClick:c,className:"w-full sm:w-auto",children:"Open Automation"}):null,b?(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:e,className:"w-full sm:w-auto",children:"Add Connection"}):null]}):null}$.propTypes={isOpen:z().bool.isRequired,connections:z().arrayOf(z().object).isRequired,onClose:z().func.isRequired},_.propTypes={showAutomation:z().bool.isRequired,showAddConnection:z().bool.isRequired,onOpenAutomation:z().func.isRequired,onAddConnection:z().func.isRequired};let aa={claude:"claudeAutoPing",codex:"codexAutoPing"};function ab(a){return["completed","cancelled","failed"].includes(a)}async function ac(a){let b=new AbortController,c=window.setTimeout(()=>b.abort(),8e3);try{let c=await fetch(a,{cache:"no-store",signal:b.signal}),d=null;try{d=await c.json()}catch{d=null}return{response:c,data:d}}finally{window.clearTimeout(c)}}function ad(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[l,y]=(0,e.useState)([]),[z,B]=(0,e.useState)(!0),[C,E]=(0,e.useState)(""),[F,H]=(0,e.useState)(null),[I,M]=(0,e.useState)([]),[N,O]=(0,e.useState)(!1),[P,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!1),[Z,ad]=(0,e.useState)(""),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(null),[am,an]=(0,e.useState)({}),[ao,ap]=(0,e.useState)(!1),[aq,ar]=(0,e.useState)({}),[as,at]=(0,e.useState)({}),[au,av]=(0,e.useState)(()=>new Set),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)(!1),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)("__none__"),[aI,aJ]=(0,e.useState)(!1),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(null),[aO,aP]=(0,e.useState)(""),[aQ,aR]=(0,e.useState)("auto"),[aS,aT]=(0,e.useState)({}),[aU,aV]=(0,e.useState)([]),[aW,aX]=(0,e.useState)([]),[aY,aZ]=(0,e.useState)([]),[a$,a_]=(0,e.useState)(null),[a0,a1]=(0,e.useState)(!1),[a2,a3]=(0,e.useState)(null),[a4,a5]=(0,e.useState)(!1),[a6,a7]=(0,e.useState)(!1),[a8,a9]=(0,e.useState)(null),[ba,bb]=(0,e.useState)({}),[bc,bd]=(0,e.useState)(null),be=(0,e.useRef)(!1),bf=(0,e.useRef)(null),bg=(0,e.useRef)("1"),[bh,bi]=(0,e.useState)(!1),[bj,bk]=(0,e.useState)(null),[bl,bm]=(0,e.useState)(""),[bn,bo]=(0,e.useState)(1),[bp,bq]=(0,e.useState)(20),[br,bs]=(0,e.useState)("all"),[bt,bu]=(0,e.useState)(""),[bv,bw]=(0,e.useState)(1),[bx,by]=(0,e.useState)(20),{copied:bz,copy:bA}=(0,p.C)(),bB=(0,e.useRef)(0),bC=(0,e.useRef)([]),bD=(0,e.useRef)(!0),bE=(0,e.useRef)(null),bF=(0,x.i)(a=>a.error),bG=(0,e.useCallback)(()=>{bk(null),bm(""),bB.current=0},[]),bH=()=>{O(!0)},bI=()=>{"kiro"===g&&bj?.jobId&&ab(bj.status)&&bG(),c.push(n(g))},bJ=F?{id:F.id,name:F.name||("anthropic-compatible"===F.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===F.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===F.type?"AC":"OC",apiType:F.apiType,baseUrl:F.baseUrl,type:F.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],bK=bJ?.authModes||[],bL=!!k.zN[g]||!!k.IS[g]||bK.includes("oauth"),bM=!!k.fg[g]||bK.includes("apikey"),bN=!!k.IS[g]?.noAuth,bO=(0,r.F)("kiro"===g),bP=(0,o.KC)(g),bQ="kiro"===g?bO:bP,bR=(0,k.wG)(g),bS=(0,k.mq)(g),bT=(0,k.gb)(g),bU=bS||bT,bV=m(g),bW=function({providerId:a,providerInfo:b,isOAuth:c,supportsApiKeyAuth:d,isCompatible:e}){if(!b||b.noAuth||b.authModes?.includes("none"))return[];let f=[];for(let g of(c&&w(f,"oauth"),(d||e||"cookie"===b.authType||!c)&&w(f,"apikey"),u[a]||[]))w(f,g);return f.map(b=>{let c=t[b];return c?{...c,...v[a]?.[b]}:null}).filter(Boolean)}({providerId:g,providerInfo:bJ,isOAuth:bL,supportsApiKeyAuth:bM,isCompatible:bS||bT}),bX=function(a,{specializedChooser:b=!1}={}){return a.length?b?{type:"specialized"}:1===a.length?{type:"method",methodId:a[0].id}:{type:"chooser"}:{type:"none"}}(bW,{specializedChooser:"kiro"===g}),bY=bW.map(a=>"quota-cookie"===a.id&&0===l.length?{...a,disabled:!0,description:"Add a CodeBuddy connection before attaching its quota cookie."}:a),bZ=k.Q2[g]?.thinkingConfig||k.s9.extended,b$=bU?g:bR,b_=bU?F?.prefix||g:bR,b0=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{cache:"no-store"}),b=await a.json();a.ok&&aZ(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[b$]),b1=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:[a]})})).ok&&await b0()}catch(a){console.log("Error disabling model:",a)}},b2=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b0()}catch(a){console.log("Error enabling model:",a)}},b3=async a=>{a.length&&a_({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a_(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:a})})).ok&&await b0()}catch(a){console.log("Error disabling all models:",a)}}})},b4=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{method:"DELETE"})).ok&&await b0()}catch(a){console.log("Error enabling all models:",a)}},b5=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&an(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),b6=(0,e.useCallback)(async()=>{try{E("");let[a,b,c,d]=await Promise.allSettled([ac("/api/providers"),ac("/api/provider-nodes"),ac("/api/proxy-pools?isActive=true"),ac("/api/settings")]),e="fulfilled"===a.status?a.value.response:null,f="fulfilled"===a.status?a.value.data:{},h="fulfilled"===b.status?b.value.response:null,i="fulfilled"===b.status?b.value.data:{},j="fulfilled"===c.status?c.value.response:null,l="fulfilled"===c.status?c.value.data:{},m="fulfilled"===d.status?d.value.response:null,n=m?.ok&&d.value.data||{};if(e?.ok){let a=(f.connections||[]).filter(a=>a.provider===g);bC.current=a,y(a)}else E("Connections could not be loaded.");j?.ok&&M(l.proxyPools||[]);let o=(n.providerStrategies||{})[g]||{};aN(o.fallbackStrategy||null),aP(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1"),bg.current=null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1";let p=(n.providerThinking||{})[g]||{};aR(p.mode||"auto");let q=aa[g];if(aT(q&&n?.[q]?.connections||{}),h?.ok){let a=(i.nodes||[]).find(a=>a.id===g)||null;if(!a&&((0,k.mq)(g)||(0,k.gb)(g)))for(let b=0;b<3;b+=1){if(await new Promise(a=>setTimeout(a,150)),!bD.current)return;let{response:b,data:c}=await ac("/api/provider-nodes");if(!bD.current)return;if(b.ok&&(a=(c.nodes||[]).find(a=>a.id===g)||null))break}H(a)}}catch(a){console.log("Error fetching connections:",a),bD.current&&E("Connections could not be loaded.")}finally{bD.current&&B(!1)}},[g]),b7=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(H(c.node),await b6(),ah(!1))}catch(a){console.log("Error updating provider node:",a)}},b8=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},b9=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},ca=async(a,b)=>{let c=aa[g];if(!c)return;let d={...aS,[a]:b};aT(d);try{let a=await fetch("/api/settings",{cache:"no-store"}),b={...(a.ok?await a.json():{})[c]||{},connections:d};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[c]:b})})).ok)throw Error("Failed to save auto-ping setting")}catch(a){aT(aS),console.log("Error saving auto-ping config:",a)}},cb=async(a,b,c=bR)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b5();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},cc=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b5()}catch(a){console.log("Error deleting alias:",a)}},cd=async()=>{if(bh)return;let a=l.find(a=>!1!==a.isActive);if(!a)return void alert((0,q.Tl)("Please add an active Qoder connection first"));bi(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,q.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,q.Tl)("No models returned"));let e={...am},f=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${b$}/${c}`;!Object.values(e).includes(d)&&(e[c]||(await cb(c,c,b$),e[c]=d,f+=1))}0===f?alert((0,q.Tl)("All models already exist, no new models added")):alert((0,q.Tl)("Successfully added")+` ${f} `+(0,q.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,q.Tl)("Error fetching models")+": "+a.message)}finally{bi(!1)}},ce=async()=>{let a=[...l];if(a4||0===a.length)return;let b=Object.fromEntries(a.map(a=>[a.id,{state:"queued",error:null}]));be.current=!1,a5(!0),a7(!1),a9(null),bb(b),bd({total:a.length,completed:0,passed:0,failed:0,stopped:!1});let c=0,d=0;try{for(let b=0;b<a.length;b+=1){if(be.current){bd({total:a.length,completed:b,passed:c,failed:d,stopped:!0});break}let e=a[b];if(!bC.current.some(a=>a.id===e.id)){bb(a=>({...a,[e.id]:{state:"skipped",error:null}})),bd({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1});continue}a9(e.id),bb(a=>({...a,[e.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${e.id}/test`,{method:"POST"}),b=await a.json(),f=!!b.valid;f?c+=1:d+=1,bb(a=>({...a,[e.id]:{state:f?"success":"failed",error:f?null:b.error||null}}))}catch(a){d+=1,bb(b=>({...b,[e.id]:{state:"failed",error:a.message||"Test failed"}}))}bd({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1}),b<a.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{a9(null),a5(!1),a7(!1),be.current=!1}},cf=async a=>{a_({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{a_(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&y(l.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},cg=()=>{b6(),O(!1)},ch=(0,e.useCallback)(a=>{bk(a),bm("")},[bG]),ci=async a=>{ad("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b6(),Y(!1);return}ad(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),ad("Failed to save connection")}},cj=async a=>{try{(await fetch(`/api/providers/${ak.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await b6(),af(!1))}catch(a){console.log("Error updating connection:",a)}},ck=async(a,b)=>{try{let c=await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(c.ok){let d=await c.json().catch(()=>null);y(c=>c.map(c=>c.id===a?{...c,isActive:b,...d?.connection||{}}:c))}}catch(a){console.log("Error updating connection status:",a)}},cl=async(a,b)=>{let c=[...l];[c[a],c[b]]=[c[b],c[a]],y(c);try{let[d,e]=await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a+1})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b+1})})]);d.ok&&e.ok||(console.log("Priority swap rejected:",d.status,e.status),await b6())}catch(a){console.log("Error swapping priority:",a),await b6()}},cm=(0,e.useMemo)(()=>{let a=bt.trim().toLowerCase();return l.filter(b=>!!(0,s.i2)(b,br)&&(!a||[b.name,b.email,b.id,b.account,b.username,b.label,b.authType,b.notes,b.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(a)))},[l,br,bt]),cn=(0,e.useMemo)(()=>s.gJ.reduce((a,b)=>(a[b.id]="all"===b.id?l.length:l.filter(a=>(0,s.i2)(a,b.id)).length,a),{}),[l]),co=aE.filter(a=>l.some(b=>b.id===a)),cp=l.filter(a=>co.includes(a.id)),cq="codebuddy"===g?(cp.length>0?cp:l).map(a=>a.id):[],cr=cm.length>0&&cm.every(a=>co.includes(a.id)),cs=a=>{switch(a){case"oauth":bH();return;case"apikey":ad(""),Y(!0);return;case"cookie":R(!0);return;case"quota-cookie":l.length>1&&0===cp.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):T(!0);return;default:bF(`Unsupported connection method: ${a}`,"Add Connection")}},ct=a=>{null!==bE.current&&window.cancelAnimationFrame(bE.current),bE.current=window.requestAnimationFrame(()=>{bE.current=null,cs(a)})},cu=()=>{"specialized"===bX.type?bH():"method"===bX.type?cs(bX.methodId):"chooser"===bX.type&&W(!0)},cv=(()=>{if(0===cp.length)return"";let a=new Set(cp.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return"All selected currently unbound";let c=I.find(a=>a.id===b);return`All selected currently bound to ${c?.name||b}`}return"Selected connections have mixed proxy bindings"})(),cw=()=>{aI||aj(!1)},cx=async a=>{aJ(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await b6(),aj(!1)}finally{aJ(!1)}},cy=a=>cx(cp.map(b=>({connectionId:b.id,proxyPoolId:a}))),cz=a=>{let b="gsuite"===a?"GSuite (non-Gmail)":"Gmail (@gmail.com)";a_({title:`Delete ${b}`,message:`Delete ALL ${b} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{a_(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:bJ?.id||g,emailFilter:a})})).ok&&(aF([]),await b6())}catch(a){console.error("bulk delete error:",a)}}})},cA=Math.max(1,Math.ceil(cm.length/bp)),cB=Math.min(bn,cA),cC=cm.slice((cB-1)*bp,cB*bp),cD=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:cC.map((a,b)=>{let c,e=l.findIndex(b=>b.id===a.id);return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,co.includes(c)),onChange:()=>{var b;return b=a.id,void aF(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${a.name||a.email||a.id}`})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(G,{connection:a,proxyPools:I,isOAuth:bL,isFirst:0===e,isLast:e===l.length-1,onMoveUp:()=>cl(e,e-1),onMoveDown:()=>cl(e,e+1),onToggleActive:b=>ck(a.id,b),autoPingEnabled:!0===aS[a.id],onToggleAutoPing:aa[g]&&"oauth"===a.authType?b=>ca(a.id,b):void 0,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&y(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{al(a),af(!0)},onDelete:()=>cf(a.id),oneByOneStatus:ba[a.id]||null})})]},a.id)})}),cE=I.filter(a=>!0===a.isActive),cF=(0,d.jsx)(j.aF,{isOpen:ai,onClose:cw,title:`Apply Proxy (${cp.length} selected)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=I.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):cx(cp.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aI||0===cE.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>cy(null),disabled:aI,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),I.map(a=>(0,d.jsxs)("button",{onClick:()=>cy(a.id),disabled:aI||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aI&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:cw,variant:"ghost",fullWidth:!0,disabled:aI,children:"Cancel"})]})}),cG=async a=>{av(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b$}/${a}`})}),c=await b.json();ar(b=>({...b,[a]:c.ok?"ok":"error"})),at(b=>({...b,[a]:c.ok?"":c.error||"Model not reachable"}))}catch{ar(b=>({...b,[a]:"error"})),at(b=>({...b,[a]:"Network error"}))}finally{av(b=>{let c=new Set(b);return c.delete(a),c})}};return z?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bJ?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bJ.color}15`},children:ao?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bJ.color},children:bJ.textIcon||bJ.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.A,{src:bS&&bJ.apiType?"responses"===bJ.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bT?"/providers/anthropic-m.png":`/providers/${bJ.id}.png`,alt:bJ.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ap(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bJ.name}),(bJ.notice?.apiKeyUrl||bJ.notice?.signupUrl||bJ.website)&&(0,d.jsxs)("a",{href:bJ.notice?.apiKeyUrl||bJ.notice?.signupUrl||bJ.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bJ.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[l.length," connection",1===l.length?"":"s"]})]})]})]}),bJ.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bJ.deprecationNotice})]}),bJ.notice?.text&&!bJ.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bJ.notice.text}),bJ.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bJ.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 →"})]}),bU&&F&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bT?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bT?"Messages API":"responses"===F.apiType?"Responses API":"Chat Completions"," \xb7 ",(F.baseUrl||"").replace(/\/$/,""),"/",bT?"messages":"responses"===F.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{ad(""),Y(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ah(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a_({title:"Delete Compatible Node",message:`Delete this ${bT?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a_(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bN?(0,d.jsx)(j.gw,{providerId:g}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[l.length>0&&I.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===cp.length)return;let a=[...new Set(cp.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"))];aH(1===a.length?a[0]:"__none__"),aj(!0)},disabled:0===cp.length,children:"Apply Proxy"}),l.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ce,disabled:a4,children:a4?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a4&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a4&&(be.current=!0,a7(!0))},disabled:a6,children:a6?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Thinking"}),(0,d.jsx)("select",{value:aQ,onChange:a=>{var b;aR(b=a.target.value),b9(b)},className:"text-xs px-2 py-1 border border-border rounded-md bg-background focus:outline-none focus:border-primary",title:"Forces reasoning_effort on requests; model chips copy as alias/model(level)",children:(bZ?.options||k.mt).map(a=>(0,d.jsx)("option",{value:a,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(j.lM,{checked:"round-robin"===aM,onChange:a=>{let b=a?"round-robin":null,c=a?aO||"1":aO;a&&!aO&&aP("1"),bg.current=c,bf.current&&(clearTimeout(bf.current),bf.current=null),aN(b),b8(b,c)}}),"round-robin"===aM&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aO,onChange:a=>{var b;aP(b=a.target.value),bg.current=b,bf.current&&clearTimeout(bf.current),bf.current=setTimeout(()=>{b8("round-robin",bg.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),l.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr,onChange:()=>{cr?aF(a=>a.filter(a=>!cm.some(b=>b.id===a))):aF(a=>Array.from(new Set([...a,...cm.map(a=>a.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),cr?"Unselect visible":"Select visible"]}),(0,d.jsxs)(j.Ex,{variant:"default",children:[cm.length," visible"]}),cp.length>0&&(0,d.jsxs)(j.Ex,{variant:"default",children:[cp.length," selected"]}),cv&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:cv}),cp.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>{aF([]),aH("__none__")},children:"Clear"}),cp.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==cp.length&&a_({title:"Delete Selected Connections",message:`Delete ${cp.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{a_(null);let a=[],b=0;for(let c of cp)try{(await fetch(`/api/providers/${c.id}`,{method:"DELETE"})).ok?a.push(c.id):b+=1}catch(a){console.log("Error deleting selected connection:",a),b+=1}aF(b=>b.filter(b=>!a.includes(b))),b>0&&alert(`Deleted ${a.length} connection(s); ${b} failed.`),await b6()}})},children:["Delete Selected (",cp.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>cz("gsuite"),children:"Delete GSuite"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>cz("gmail"),children:"Delete Gmail"})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.gJ.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>bs(a.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${br===a.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[a.label,(0,d.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:cn[a.id]||0})]},a.id))}),l.length>=20&&(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:bt,onChange:a=>bu(a.target.value),placeholder:`Search ${l.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),C?(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:C})]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{B(!0),b6()},children:"Retry"})]}):0===l.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bL?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bW.length>1?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add Connection lists every available authentication method."}):null]})]}),(0,d.jsx)(_,{showAutomation:bV,showAddConnection:"none"!==bX.type,onOpenAutomation:bI,onAddConnection:cu})]}),"kiro"===g&&bj?.jobId&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",bj.status," | Success: ",bj.summary?.success||0," | Running: ",bj.summary?.running||0," | Queued: ",bj.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),ab(bj.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bG,children:"Clear"})]})]}),"kiro"===g&&!bj?.jobId&&bl&&(0,d.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:bl})]}):(0,d.jsxs)(d.Fragment,{children:[bc&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bc.total]}),(0,d.jsxs)("span",{children:["Completed: ",bc.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bc.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bc.failed]}),bc.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a4&&a8&&(0,d.jsxs)("span",{children:["Running: ",l.find(a=>a.id===a8)?.name||a8]})]})}),"kiro"===g&&bj?.jobId&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",bj.status," | Success: ",bj.summary?.success||0," | Running: ",bj.summary?.running||0," | Queued: ",bj.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),ab(bj.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bG,children:"Clear"})]})]}),"kiro"===g&&!bj?.jobId&&bl&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:bl}),cD,"kiro"===g&&cA>1&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",cB," of ",cA," • Showing ",(cB-1)*bp+1,"-",Math.min(cB*bp,cm.length)," of ",cm.length," connections"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cB<=1,onClick:()=>bo(a=>Math.max(1,a-1)),children:"Previous"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cB>=cA,onClick:()=>bo(a=>Math.min(cA,a+1)),children:"Next"})]})]}),"kiro"!==g&&cm.length>0&&(0,d.jsx)(j.dK,{currentPage:cB,pageSize:bp,totalItems:cm.length,onPageChange:bo,onPageSizeChange:a=>{bq(a),bo(1)},className:"mt-2"}),l.length>0&&0===cm.length&&(0,d.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(_,{showAutomation:bV,showAddConnection:"none"!==bX.type,onOpenAutomation:bI,onAddConnection:cu})})]})]}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!bU&&(a=[...bQ,...aW.filter(a=>!bQ.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aY.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aY.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:b4,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>b3(a),children:"Disable All"})]}))]}),Object.values(as).some(Boolean)&&(0,d.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(as).filter(([,a])=>!!a).map(([a,b])=>(0,d.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[a,": ",b]},a))}),(()=>{let a,b,c;if(bU)return(0,d.jsx)(D,{providerStorageAlias:b$,providerDisplayAlias:b_,modelAliases:am,copied:bz,onCopy:bA,onSetAlias:cb,onDeleteAlias:cc,onAliasesChanged:b5,connections:l,isAnthropic:bT});let e=[...bQ,...aW.filter(a=>!bQ.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),f=new Set(aY),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),k=Object.entries(am).filter(([a,b])=>{let c=`${b$}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return bJ.passthroughModels?!bQ.some(a=>a.id===d):!bQ.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${b$}/`.length),alias:a,fullModel:b})),m=Math.min(bv,Math.max(1,Math.ceil(h.length/bx))),n=h.slice((m-1)*bx,m*bx);return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[k.map(a=>(0,d.jsx)(A,{model:{id:a.id},fullModel:`${b_}/${a.id}`,alias:a.alias,copied:bz,onCopy:bA,onSetAlias:()=>{},onDeleteAlias:()=>cc(a.alias),testStatus:aq[a.id],onTest:l.length>0||bN?()=>cG(a.id):void 0,isTesting:au.has(a.id),isCustom:!0,isFree:!1,thinkingSuffix:aQ&&"auto"!==aQ&&"off"!==aQ&&"none"!==aQ?aQ:null},a.id)),n.map(a=>{let b=`${b$}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(am).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(A,{model:a,fullModel:`${b_}/${a.id}`,alias:e,copied:bz,onCopy:bA,onSetAlias:b=>cb(a.id,b,b$),onDeleteAlias:()=>cc(e),testStatus:aq[a.id],onTest:l.length>0||bN?()=>cG(a.id):void 0,isTesting:au.has(a.id),isFree:a.isFree,onDisable:()=>b1(a.id),thinkingSuffix:aQ&&"auto"!==aQ&&"off"!==aQ&&"none"!==aQ?aQ:null},a.id)}),h.length>bx&&(0,d.jsx)("div",{className:"w-full",children:(0,d.jsx)(j.dK,{currentPage:m,pageSize:bx,totalItems:h.length,onPageChange:bw,onPageSizeChange:a=>{by(a),bw(1)}})}),(0,d.jsxs)("button",{onClick:()=>ax(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"codebuddy"===g&&(0,d.jsxs)("button",{onClick:()=>az(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-cyan-500/50 px-3 py-2 text-xs text-cyan-700 transition-colors hover:border-cyan-500 hover:bg-cyan-500/[0.07] dark:text-cyan-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Discover Models"]}),"opencode"===g&&(0,d.jsxs)("button",{onClick:()=>aB(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-orange-500/50 px-3 py-2 text-xs text-orange-700 transition-colors hover:border-orange-500 hover:bg-orange-500/[0.07] dark:text-orange-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"kiro"===g&&(0,d.jsxs)("button",{onClick:()=>aD(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-violet-500/50 px-3 py-2 text-xs text-violet-700 transition-colors hover:border-violet-500 hover:bg-violet-500/[0.07] dark:text-violet-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"qoder"===g&&l.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:cd,disabled:bh,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bh?{animation:"spin 1s linear infinite"}:void 0,children:bh?"progress_activity":"download"}),bh?(0,q.Tl)("Fetching..."):(0,q.Tl)("Fetch Qoder Models")]}),aU.length>0&&(a=new Set(Object.values(am)),b=new Set(bQ.map(a=>a.id)),0===(c=aU.filter(c=>!a.has(`${b$}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{let b=a.id.split("/").pop();await cb(a.id,b,b$)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>b2(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),ai&&cF,V&&(0,d.jsx)(j.mz,{isOpen:!0,providerName:bJ.name,methods:bY,onSelect:a=>{W(!1),ct(a)},onClose:()=>W(!1)}),N&&("kiro"===g?(0,d.jsx)(j.Mh,{isOpen:!0,providerInfo:bJ,onSuccess:cg,onRefresh:b6,initialBulkJobId:bj?.jobId||null,onBulkJobChange:ch,onClose:()=>O(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:!0,onSuccess:cg,onClose:()=>O(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:!0,providerInfo:bJ,onSuccess:cg,onClose:()=>O(!1)}):(0,d.jsx)(j.LF,{isOpen:!0,provider:g,providerInfo:bJ,onSuccess:cg,onClose:()=>O(!1)})),"iflow"===g&&P&&(0,d.jsx)(j.vE,{isOpen:!0,onSuccess:()=>{b6(),R(!1)},onClose:()=>R(!1)}),"codebuddy"===g&&S&&(0,d.jsx)(j.xl,{isOpen:!0,connectionIds:cq,onSuccess:()=>{b6(),T(!1)},onClose:()=>T(!1)}),X&&(0,d.jsx)(J,{isOpen:!0,provider:g,providerName:bJ.name,isCompatible:bU,isAnthropic:bT,authType:bJ?.authType,authHint:bJ?.authHint,website:bJ?.website,proxyPools:I,error:Z,onSave:ci,onBulkDone:b6,onClose:()=>{ad(""),Y(!1)}}),ae&&ak&&(0,d.jsx)(j.wI,{isOpen:!0,connection:ak,proxyPools:I,onSave:cj,onClose:()=>af(!1)}),bU&&ag&&(0,d.jsx)(K,{isOpen:!0,node:F,onSave:b7,onClose:()=>ah(!1),isAnthropic:bT}),!bU&&aw&&(0,d.jsx)(L,{isOpen:!0,providerAlias:b$,providerDisplayAlias:b_,onSave:async a=>{let b=bJ?.passthroughModels?a.split("/").pop():a;await cb(a,b,b$),ax(!1)},onClose:()=>ax(!1)}),"codebuddy"===g&&ay&&(0,d.jsx)(Q,{isOpen:!0,connections:l,onModelsAdded:async a=>{for(let b of a)await cb(b.id,b.id,"cb");await b5()},onClose:()=>az(!1)}),"opencode"===g&&aA&&(0,d.jsx)(U,{isOpen:!0,onModelsAdded:async a=>{for(let b of a)await cb(b.id,b.id,"oc");await b5()},onClose:()=>aB(!1)}),"kiro"===g&&aC&&(0,d.jsx)($,{isOpen:!0,connections:l,onClose:()=>aD(!1)}),a0&&(0,d.jsx)(j.uo,{isOpen:!0,onClose:()=>a1(!1),onConfirm:()=>{a1(!1),a3(null),ct(a2||"oauth")},title:"Risk Notice",message:bJ?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),a$&&(0,d.jsx)(j.uo,{isOpen:!0,onClose:()=>{aK||a_(null)},onConfirm:async()=>{if(aK)return;let a=a$?.onConfirm;if(a){aL(!0);try{await a()}finally{aL(!1)}}},title:a$?.title||"Confirm",message:a$?.message,variant:"danger",loading:aK})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,2430,6686,2760,492,3999,5024,3477,5681,1131,412,1756],()=>b(b.s=52392));module.exports=c})();
3
+ sk-key-only-auto-named`;function J({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:l,proxyPools:m,error:n,onSave:o,onBulkDone:p,onClose:q}){let r="__none__",s="ollama-local"===b,t="flow"===b,u="cookie"===h,v="xai"===b&&!u,w=t?"Daemon token":u?"Cookie Value":"qoder"===b?"Personal Access Token (PAT)":"API Key",x=u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"qoder"===b?"pt-...":"",y="azure"===b,z="cloudflare-ai"===b,A=k.Q2?.[b]?.regions||null,B=k.Q2?.[b]?.defaultRegion||A?.[0]?.id||"",[C,D]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:r,ollamaHostUrl:"",flowProfile:"",flowBaseUrl:"http://127.0.0.1:8077/mcp",flowI2vReady:!1}),[E,F]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[G,K]=(0,e.useState)({accountId:""}),[L,M]=(0,e.useState)(B),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)("single"),[V,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(null);(0,e.useRef)(!1);let Z=()=>s&&C.ollamaHostUrl.trim()?{baseUrl:C.ollamaHostUrl.trim()}:t?{profile:C.flowProfile.trim(),baseUrl:C.flowBaseUrl.trim()||"http://127.0.0.1:8077/mcp",i2vReady:C.flowI2vReady}:y?{azureEndpoint:E.azureEndpoint,apiVersion:E.apiVersion,deployment:E.deployment,organization:E.organization}:z?{accountId:G.accountId}:A&&L?{region:L}:void 0,$=async()=>{O(!0);try{let a=await (0,H.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:C.apiKey,providerSpecificData:Z()}});Q(a.valid?"success":"failed")}catch{Q("unknown")}finally{O(!1)}},_=async()=>{if(b&&(s||C.apiKey)&&(!t||C.flowProfile.trim())&&(s||C.name)&&(!f||C.defaultModel.trim())){S(!0);try{let a=!1;try{O(!0),Q(null),a=!!(await (0,H.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:C.apiKey,providerSpecificData:Z()}})).valid,Q(a?"success":"failed")}catch{Q("unknown")}finally{O(!1)}let c=Number.parseInt(C.priority,10);await o({name:C.name||(s?"Ollama Local":""),apiKey:C.apiKey,defaultModel:f?C.defaultModel.trim():void 0,priority:Number.isFinite(c)?c:1,proxyPoolId:t||C.proxyPoolId===r?null:C.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Z()})}finally{S(!1)}}},aa=async()=>{let a=V.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return;S(!0),Y(null);let c=0,d=0,e=[],f=[];for(let g=0;g<a.length;g++){let h=a[g].split("|"),i=h.length>=2?h.slice(1).join("|").trim():h[0].trim(),j=h.length>=2?h[0].trim():"Key",k=`${j} ${g+1}`;try{await (0,H.x6)("/api/providers",{method:"POST",body:{provider:b,apiKey:i,name:k,priority:1,testStatus:"unknown"}}),c++}catch(b){d++,e.push({line:a[g],message:b?.message||"Request failed"}),f.push(a[g])}}S(!1),Y({success:c,failed:d,failedRows:e}),W(f.join("\n")),c>0&&p&&p()};return b?(0,d.jsx)(j.aF,{isOpen:a,title:t?"Add Google Flow Account":`Add ${c||b} ${w}`,onClose:q,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"single"===T?"primary":"ghost",onClick:()=>{U("single"),Y(null)},children:"Single"}),(0,d.jsx)(j.$n,{size:"sm",variant:"bulk"===T?"primary":"ghost",onClick:()=>{U("bulk"),Y(null)},children:"Bulk Add"})]}),"bulk"===T&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:I,value:V,onChange:a=>W(a.target.value)}),X&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${X.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",X.success," added",X.failed>0?`, ✗ ${X.failed} failed`:""]}),X.failedRows?.length>0&&(0,d.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:X.failedRows.map((a,b)=>(0,d.jsxs)("li",{className:"break-words",children:[(0,d.jsx)("span",{className:"font-mono",children:a.line.length>40?`${a.line.slice(0,40)}…`:a.line}),` — ${a.message}`]},b))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:aa,fullWidth:!0,disabled:R||!V.trim(),children:R?"Adding...":"Add All Keys"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===T&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{label:t?"Account name":"Name",value:C.name,onChange:a=>D({...C,name:a.target.value}),placeholder:t?"Google account email":s?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20 flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"gflow profile",value:C.flowProfile,onChange:a=>D({...C,flowProfile:a.target.value}),placeholder:"from: gflow auth list",hint:"One connection maps to one Google Flow browser profile.",required:!0}),(0,d.jsx)(j.pd,{label:"Daemon URL",value:C.flowBaseUrl,onChange:a=>D({...C,flowBaseUrl:a.target.value}),placeholder:"http://127.0.0.1:8077/mcp"}),(0,d.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:C.flowI2vReady,onChange:a=>D({...C,flowI2vReady:a.target.checked}),className:"mt-1"}),(0,d.jsxs)("span",{children:["I2V upload consent confirmed ",(0,d.jsx)("span",{className:"block text-xs text-text-muted",children:"Enable only after uploading an image you own once on flow.google.com and accepting Google's rights dialog. Required for 20–60s videos."})]})]})]}),s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"Ollama Host URL",value:C.ollamaHostUrl,onChange:a=>D({...C,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:$,disabled:N||R,variant:"secondary",children:N?"Checking...":"Check"})})]}),!s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:w,type:u?"text":"password",value:C.apiKey,onChange:a=>D({...C,apiKey:a.target.value}),placeholder:t?"GFLOW_DAEMON_TOKEN":x,hint:t?"Must match the token used by `gflow serve`.":void 0,className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:$,disabled:!C.apiKey||t&&!C.flowProfile.trim()||N||R,variant:"secondary",children:N?"Checking...":"Check"})})]}),v&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,l&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",l.replace(/^https?:\/\//,"")]})]})]}),A&&(0,d.jsx)(j.l6,{label:"Region",value:L,onChange:a=>M(a.target.value),options:A.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(j.pd,{label:"Default Model",value:C.defaultModel,onChange:a=>D({...C,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),s&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),P&&(0,d.jsx)(j.Ex,{variant:"success"===P?"success":"failed"===P?"error":"default",children:"success"===P?"Valid":"failed"===P?"Invalid":"Could not validate"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),z&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(j.pd,{label:"Account ID",value:G.accountId,onChange:a=>K({...G,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"Azure Endpoint",value:E.azureEndpoint,onChange:a=>F({...E,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(j.pd,{label:"Deployment Name",value:E.deployment,onChange:a=>F({...E,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(j.pd,{label:"API Version",value:E.apiVersion,onChange:a=>F({...E,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(j.pd,{label:"Organization",value:E.organization,onChange:a=>F({...E,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(j.pd,{label:"Priority",type:"number",value:C.priority,onChange:a=>D({...C,priority:a.target.value}),onBlur:a=>{let b=Number.parseInt(a.target.value,10);D(a=>({...a,priority:Number.isFinite(b)?b:1}))}}),!t&&(0,d.jsx)(j.l6,{label:"Proxy Pool",value:C.proxyPoolId,onChange:a=>D({...C,proxyPoolId:a.target.value}),options:[{value:r,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),!t&&0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),!t&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:_,fullWidth:!0,disabled:R||!s&&(!C.name||!C.apiKey)||t&&!C.flowProfile.trim()||f&&!C.defaultModel.trim()||y&&(!E.azureEndpoint||!E.deployment||!E.organization)||z&&!G.accountId,children:R?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function K({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(j.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(j.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(j.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(j.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(j.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||k,children:k?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function L({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"science",loading:"testing"===k,onClick:r,disabled:!h.trim()||"testing"===k,children:"testing"===k?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===k&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(j.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(j.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}J.propTypes={isOpen:z().bool.isRequired,provider:z().string,providerName:z().string,isCompatible:z().bool,isAnthropic:z().bool,authType:z().string,authHint:z().string,website:z().string,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string})),error:z().string,onSave:z().func.isRequired,onBulkDone:z().func,onClose:z().func.isRequired},K.propTypes={isOpen:z().bool.isRequired,node:z().shape({id:z().string,name:z().string,prefix:z().string,apiType:z().string,baseUrl:z().string}),onSave:z().func.isRequired,onClose:z().func.isRequired,isAnthropic:z().bool},L.propTypes={isOpen:z().bool.isRequired,providerAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,onSave:z().func.isRequired,onClose:z().func.isRequired};let M="/api/providers/codebuddy/discover-models",N={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},O={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function P(a,b){return a?.error||b}function Q({isOpen:a,connections:b,onModelsAdded:c,onClose:f}){let g=(0,e.useMemo)(()=>b.filter(a=>"codebuddy"===a.provider&&!1!==a.isActive),[b]),[h,i]=(0,e.useState)(null),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(()=>new Set),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(()=>new Set),C=(0,e.useCallback)(async()=>{l(!0),n(""),p(""),v(!1),z([]);try{let a=await fetch(M,{cache:"no-store"}),b=await a.json();if(!a.ok)throw Error(P(b,"Could not refresh model candidates"));i(b),r(new Set((b.hidden||[]).map(a=>a.id)))}catch(a){n(a.message)}finally{l(!1)}},[]),D=async()=>{if(s&&0!==q.size&&!w){x(!0),n(""),p("");try{let a=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:s,models:[...q]})}),b=await a.json();if(!a.ok)throw Error(P(b,"Hidden model scan failed"));z(b.results||[]),v(!1)}catch(a){n(a.message)}finally{x(!1)}}},E=(0,e.useMemo)(()=>new Map(y.map(a=>[a.id,a])),[y]),F=(0,e.useMemo)(()=>(h?.hidden||[]).filter(a=>{let b=E.get(a.id)?.status;return a.previouslyVerified||"verified"===b||"recognized"===b}),[h,E]),G=async a=>{let b=a.filter(a=>!A.has(a.id));if(!b.length)return;B(a=>new Set([...a,...b.map(a=>a.id)])),n(""),p("");let d=[];try{for(let a of b){let b=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"cb",id:a.id,type:"llm",name:a.name})}),c=await b.json();if(!b.ok)throw Error(P(c,`Could not add ${a.id}`));d.push(a)}window.dispatchEvent(new Event("customModelChanged")),await c?.(d),p(`${d.length} model${1===d.length?"":"s"} added to CodeBuddy Global.`)}catch(a){d.length&&(window.dispatchEvent(new Event("customModelChanged")),await c?.(d)),n(a.message)}finally{B(a=>{let c=new Set(a);return b.forEach(a=>c.delete(a.id)),c})}},H=F.filter(a=>q.has(a.id));return(0,d.jsx)(j.aF,{isOpen:a,onClose:f,title:"Discover CodeBuddy Global Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsx)("div",{className:"overflow-hidden rounded-xl border border-cyan-500/20 bg-gradient-to-br from-cyan-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Live package candidates"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"Refreshing reads Tencent's current CLI manifests and does not call a model or use credits."}),h?.version&&(0,d.jsxs)("p",{className:"mt-2 font-mono text-xs text-cyan-700 dark:text-cyan-300",children:["codebuddy-code@",h.version]})]}),(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:k,onClick:C,children:"Refresh Candidates"})]})}),m&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:m}),o&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:o}),h?.warnings?.map(a=>(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:a},a)),h&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.official?.length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Official Global"})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.hidden?.length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Hidden candidates"})]}),(0,d.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:h.hidden?.filter(a=>a.previouslyVerified).length||0}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Previously verified"})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Hidden route candidates"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"From alternate official manifests; availability is not guaranteed on Global SaaS."})]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>r(q.size===(h.hidden?.length||0)?new Set:new Set(h.hidden.map(a=>a.id))),children:q.size===(h.hidden?.length||0)?"Clear":"Select all"})]}),(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:(h.hidden||[]).map(a=>{let b=E.get(a.id);return(0,d.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:q.has(a.id),onChange:()=>{var b;return b=a.id,void r(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-1 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:a.name}),(0,d.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:a.id}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:a.sources.length?a.sources.join(" + "):"request history"})]}),(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[a.previouslyVerified&&(0,d.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"previous success"}),b&&(0,d.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${O[b.status]||O.error}`,children:N[b.status]||b.status}),(a.previouslyVerified||["verified","recognized"].includes(b?.status))&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),G([a])},className:"text-xs font-semibold text-primary hover:underline",disabled:A.has(a.id),children:A.has(a.id)?"Adding...":"Add"})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-amber-500/25 bg-amber-500/[0.07] p-4",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,d.jsx)(j.l6,{label:"CodeBuddy Global connection",value:s,onChange:a=>t(a.target.value),options:g.map(a=>({value:a.id,label:a.name||a.email||a.id})),placeholder:"No active Global connection",disabled:!g.length||w,hint:"Every probe is pinned to this connection."}),(0,d.jsxs)(j.$n,{size:"sm",icon:"radar",onClick:()=>v(!0),disabled:!s||0===q.size||w,children:["Scan Hidden Models (",q.size,")"]})]}),!g.length&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a CodeBuddy Global connection before scanning."}),u&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-amber-500/40 bg-surface px-3 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using scan"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion probes and may consume CodeBuddy credits. Scanning uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,d.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>v(!1),disabled:w,children:"Cancel"}),(0,d.jsx)(j.$n,{size:"sm",icon:"science",loading:w,onClick:D,children:"Start Credit Scan"})]})]})]}),y.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[y.filter(a=>"verified"===a.status).length," verified, ",y.filter(a=>"recognized"===a.status).length," recognized, ",y.filter(a=>"unavailable"===a.status).length," unavailable"]}),(0,d.jsxs)(j.$n,{size:"sm",icon:"playlist_add",onClick:()=>G(H),disabled:!H.length||A.size>0,children:["Add Selected Available (",H.length,")"]})]})]})]})})}Q.propTypes={isOpen:z().bool.isRequired,connections:z().arrayOf(z().object).isRequired,onModelsAdded:z().func,onClose:z().func.isRequired};let R="/api/providers/opencode/discover-models",S={verified:"Verified (200 OK)",overloaded:"Overloaded (503)",unavailable:"Unavailable",deprecated:"Deprecated (410)",unsupported:"Protocol Unsupported",error:"Error"},T={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",overloaded:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",unavailable:"border-zinc-500/30 bg-zinc-500/[0.08] text-zinc-600 dark:text-zinc-400",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",error:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300"};function U({isOpen:a,onModelsAdded:b,onClose:c}){let[f,g]=(0,e.useState)([]),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>new Set),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(()=>new Set),[w,x]=(0,e.useState)(()=>new Set),y=(0,e.useCallback)(async()=>{i(!0),l(""),n(""),t([]);try{let a=await fetch(R,{cache:"no-store"}),b=await a.json();if(!a.ok)throw Error(b?.error||"Could not fetch OpenCode models");let c=b.candidates||[];g(c),p(new Set(c.map(a=>a.id))),x(new Set(c.filter(a=>a.isConfigured).map(a=>a.id)))}catch(a){l(a.message)}finally{i(!1)}},[]),z=async()=>{if(0!==o.size&&!q){r(!0),l(""),n("");try{let a=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:[...o]})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Live probe failed");t(b.results||[])}catch(a){l(a.message)}finally{r(!1)}}},A=(0,e.useMemo)(()=>new Map(s.map(a=>[a.id,a])),[s]),B=async a=>{let c=a.filter(a=>!u.has(a.id)&&!w.has(a.id));if(!c.length)return;v(a=>new Set([...a,...c.map(a=>a.id)])),l(""),n("");let d=[];try{for(let a of c){let b=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"oc",id:a.id,type:"llm",name:a.name||a.id})}),c=await b.json();if(!b.ok)throw Error(c?.error||`Could not add ${a.id}`);d.push(a)}window.dispatchEvent(new Event("customModelChanged")),x(a=>new Set([...a,...d.map(a=>a.id)])),await b?.(d),n(`${d.length} model${1===d.length?"":"s"} added to OpenCode Free!`)}catch(a){d.length&&(window.dispatchEvent(new Event("customModelChanged")),x(a=>new Set([...a,...d.map(a=>a.id)])),await b?.(d)),l(a.message)}finally{v(a=>{let b=new Set(a);return c.forEach(a=>b.delete(a.id)),b})}},C=(0,e.useMemo)(()=>f.filter(a=>{let b=A.get(a.id);return b?.ok&&!w.has(a.id)}),[f,A,w]);return(0,d.jsx)(j.aF,{isOpen:a,onClose:c,title:"Live Probe OpenCode Free Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsx)("div",{className:"overflow-hidden rounded-xl border border-orange-500/20 bg-gradient-to-br from-orange-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Upstream Catalog Live Probe"}),(0,d.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["Pulls candidates directly from ",(0,d.jsx)("span",{className:"font-mono",children:"opencode.ai/zen/v1/models"})," and tests real-time completions to verify which free models are alive."]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:h,onClick:y,children:"Refresh Catalog"}),(0,d.jsx)(j.$n,{size:"sm",icon:"radar",loading:q,disabled:0===o.size||q,onClick:z,className:"bg-orange-600 hover:bg-orange-700 text-white",children:q?"Probing Upstream...":`Live Probe (${o.size})`})]})]})}),k&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:k}),m&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:m}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Total Candidates: ",(0,d.jsx)("strong",{className:"text-text-main",children:f.length})]}),s.length>0&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["• Verified Live: ",(0,d.jsx)("strong",{className:"text-green-600",children:s.filter(a=>a.ok).length})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[C.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>B(C),disabled:u.size>0,className:"text-xs font-semibold text-primary hover:underline",children:["+ Add All Verified (",C.length,")"]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>p(o.size===f.length?new Set:new Set(f.map(a=>a.id))),children:o.size===f.length?"Deselect All":"Select All"})]})]}),(0,d.jsx)("div",{className:"max-h-96 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:f.map(a=>{let b=A.get(a.id),c=w.has(a.id),e=u.has(a.id);return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[(0,d.jsx)("input",{type:"checkbox",checked:o.has(a.id),onChange:()=>{var b;return b=a.id,void p(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"accent-orange-500"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:a.name}),c&&(0,d.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Active in Router"})]}),(0,d.jsxs)("span",{className:"block font-mono text-[11px] text-text-muted truncate",children:["oc/",a.id]})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[b?(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`rounded-full border px-2.5 py-0.5 text-[11px] font-medium ${T[b.status]||T.error}`,title:b.message,children:S[b.status]||b.statusText}),b.latencyMs>0&&(0,d.jsxs)("span",{className:"text-[11px] text-text-muted font-mono",children:[b.latencyMs,"ms"]})]}):(0,d.jsx)("span",{className:"text-[11px] text-text-muted italic",children:"Ready to probe"}),!c&&(0,d.jsx)("button",{type:"button",onClick:()=>B([a]),disabled:e,className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:e?"Adding...":"+ Add"})]})]},a.id)})}),(0,d.jsx)("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",onClick:c,children:"Close"})})]})})}U.propTypes={isOpen:z().bool.isRequired,onModelsAdded:z().func,onClose:z().func.isRequired};let V="/api/providers/kiro/discover-models",W={verified:"Verified",recognized:"Recognized (quota)",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},X={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"},Y={live:"live catalog",saved:"saved on account",alias:"your alias"};function Z(a){return a?a>=1e6?`${a/1e6}M`:`${Math.round(a/1e3)}K`:null}function $({isOpen:a,connections:b,onClose:c}){let f=(0,e.useMemo)(()=>b.filter(a=>"kiro"===a.provider&&!1!==a.isActive&&!a.quarantinedAt),[b]),[g,h]=(0,e.useState)(""),[i,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(()=>new Set),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async a=>{if(a){m(!0),o(""),A(""),s(!1),w([]);try{let b=await fetch(`${V}?connectionId=${encodeURIComponent(a)}`,{cache:"no-store"}),c=await b.json();if(!b.ok)throw Error(c?.error||"Could not refresh Kiro candidates");k(c),q(new Set((c.candidates||[]).filter(a=>!a.inLive).map(a=>a.id)))}catch(a){k(null),o(a.message)}finally{m(!1)}}},[]),C=async()=>{if(g&&0!==p.size&&!t){u(!0),o("");try{let a=await fetch(V,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:[...p]})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Kiro model probe failed");w(b.results||[]),s(!1)}catch(a){o(a.message)}finally{u(!1)}}},D=(0,e.useMemo)(()=>new Map(v.map(a=>[a.id,a])),[v]),E=i?.candidates||[],F=E.filter(a=>a.inLive).length,G=E.length-F,H=v.filter(a=>"verified"===a.status).map(a=>a.id),I=!!i&&!i.hasProfile&&H.length>0,J=async()=>{if(I&&!x){y(!0),o(""),A("");try{let a=await fetch(V,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:H})}),b=await a.json();if(!a.ok)throw Error(b?.error||"Saving verified models failed");A(`${b.saved.length} verified model${1===b.saved.length?"":"s"} saved to this connection.`)}catch(a){o(a.message)}finally{y(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:c,title:"Live Probe Kiro Models",size:"full",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"overflow-hidden rounded-xl border border-violet-500/20 bg-gradient-to-br from-violet-500/[0.10] via-transparent to-amber-500/[0.08] p-4",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,d.jsx)(j.l6,{label:"Kiro connection",value:g,onChange:a=>h(a.target.value),options:f.map(a=>({value:a.id,label:a.name||a.email||a.id})),placeholder:"No active Kiro connection",disabled:!f.length||t,hint:"The catalog and every probe are pinned to this connection."}),(0,d.jsx)(j.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:l,disabled:!g||t,onClick:()=>B(g),children:"Refresh Catalog"})]}),(0,d.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing calls Kiro's ListAvailableModels for this account and does not use credits."}),!f.length&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Kiro connection first."})]}),n&&(0,d.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:n}),z&&(0,d.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:z}),i?.warnings?.map(a=>(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:a},a)),i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:F}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"In live catalog"})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:G}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Saved / alias only"})]}),(0,d.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,d.jsx)("p",{className:`text-sm font-semibold ${i.liveCatalog?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:i.liveCatalog?"Live catalog readable":"Live catalog unavailable"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:i.hasProfile?"Account has a CodeWhisperer profile":"No profile (API-key login)"})]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Base models"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"-thinking and -agentic variants share their base model and are not probed separately."})]}),(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>q(p.size===E.length?new Set:new Set(E.map(a=>a.id))),children:p.size===E.length?"Clear":"Select all"})]}),(0,d.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:E.map(a=>{let b=D.get(a.id),c=[Z(a.contextLength),Z(a.maxOutputTokens)].filter(Boolean).join(" / ");return(0,d.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:p.has(a.id),onChange:()=>{var b;return b=a.id,void q(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-1 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:a.name}),(0,d.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["kr/",a.id]}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.sources.map(a=>Y[a]||a).join(" + "),c&&` \xb7 ${c}`,a.rateMultiplier&&1!==a.rateMultiplier&&` \xb7 ${a.rateMultiplier}x credit`]})]}),(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[a.inLive&&(0,d.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"live"}),b&&(0,d.jsxs)("span",{title:b.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${X[b.status]||X.error}`,children:[W[b.status]||b.status,"verified"===b.status&&Number.isFinite(b.latencyMs)&&` \xb7 ${b.latencyMs}ms`]})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-amber-500/25 bg-amber-500/[0.07] p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:v.length>0?`${v.filter(a=>"verified"===a.status).length} verified, ${v.filter(a=>"unavailable"===a.status).length} unavailable, ${v.filter(a=>!["verified","unavailable"].includes(a.status)).length} other`:"Probe sends one real completion per selected model."}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[I&&(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"save",loading:x,onClick:J,children:["Save Verified to Connection (",H.length,")"]}),(0,d.jsxs)(j.$n,{size:"sm",icon:"radar",onClick:()=>s(!0),disabled:!g||0===p.size||t,children:["Probe Selected (",p.size,")"]})]})]}),r&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-amber-500/40 bg-surface px-3 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion requests and may consume Kiro credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,d.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>s(!1),disabled:t,children:"Cancel"}),(0,d.jsx)(j.$n,{size:"sm",icon:"science",loading:t,onClick:C,children:"Start Probe"})]})]})]})]})]})})}function _({showAutomation:a,showAddConnection:b,onOpenAutomation:c,onAddConnection:e}){return a||b?(0,d.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:flex-wrap sm:justify-end",children:[a?(0,d.jsx)(j.$n,{size:"sm",icon:"automation",variant:"secondary",onClick:c,className:"w-full sm:w-auto",children:"Open Automation"}):null,b?(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:e,className:"w-full sm:w-auto",children:"Add Connection"}):null]}):null}$.propTypes={isOpen:z().bool.isRequired,connections:z().arrayOf(z().object).isRequired,onClose:z().func.isRequired},_.propTypes={showAutomation:z().bool.isRequired,showAddConnection:z().bool.isRequired,onOpenAutomation:z().func.isRequired,onAddConnection:z().func.isRequired};let aa={claude:"claudeAutoPing",codex:"codexAutoPing"};function ab(a){return["completed","cancelled","failed"].includes(a)}async function ac(a){let b=new AbortController,c=window.setTimeout(()=>b.abort(),8e3);try{let c=await fetch(a,{cache:"no-store",signal:b.signal}),d=null;try{d=await c.json()}catch{d=null}return{response:c,data:d}}finally{window.clearTimeout(c)}}function ad(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[l,y]=(0,e.useState)([]),[z,B]=(0,e.useState)(!0),[C,E]=(0,e.useState)(""),[F,H]=(0,e.useState)(null),[I,M]=(0,e.useState)([]),[N,O]=(0,e.useState)(!1),[P,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!1),[Z,ad]=(0,e.useState)(""),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(null),[am,an]=(0,e.useState)({}),[ao,ap]=(0,e.useState)(!1),[aq,ar]=(0,e.useState)({}),[as,at]=(0,e.useState)({}),[au,av]=(0,e.useState)(()=>new Set),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)(!1),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)("__none__"),[aI,aJ]=(0,e.useState)(!1),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(null),[aO,aP]=(0,e.useState)(""),[aQ,aR]=(0,e.useState)("auto"),[aS,aT]=(0,e.useState)({}),[aU,aV]=(0,e.useState)([]),[aW,aX]=(0,e.useState)([]),[aY,aZ]=(0,e.useState)([]),[a$,a_]=(0,e.useState)(null),[a0,a1]=(0,e.useState)(!1),[a2,a3]=(0,e.useState)(null),[a4,a5]=(0,e.useState)(!1),[a6,a7]=(0,e.useState)(!1),[a8,a9]=(0,e.useState)(null),[ba,bb]=(0,e.useState)({}),[bc,bd]=(0,e.useState)(null),be=(0,e.useRef)(!1),bf=(0,e.useRef)(null),bg=(0,e.useRef)("1"),[bh,bi]=(0,e.useState)(!1),[bj,bk]=(0,e.useState)(null),[bl,bm]=(0,e.useState)(""),[bn,bo]=(0,e.useState)(1),[bp,bq]=(0,e.useState)(20),[br,bs]=(0,e.useState)("all"),[bt,bu]=(0,e.useState)(""),[bv,bw]=(0,e.useState)(1),[bx,by]=(0,e.useState)(20),{copied:bz,copy:bA}=(0,p.C)(),bB=(0,e.useRef)(0),bC=(0,e.useRef)([]),bD=(0,e.useRef)(!0),bE=(0,e.useRef)(null),bF=(0,x.i)(a=>a.error),bG=(0,e.useCallback)(()=>{bk(null),bm(""),bB.current=0},[]),bH=()=>{O(!0)},bI=()=>{"kiro"===g&&bj?.jobId&&ab(bj.status)&&bG(),c.push(n(g))},bJ=F?{id:F.id,name:F.name||("anthropic-compatible"===F.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===F.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===F.type?"AC":"OC",apiType:F.apiType,baseUrl:F.baseUrl,type:F.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],bK=bJ?.authModes||[],bL=!!k.zN[g]||!!k.IS[g]||bK.includes("oauth"),bM=!!k.fg[g]||bK.includes("apikey"),bN=!!k.IS[g]?.noAuth,bO=(0,r.F)("kiro"===g),bP=(0,o.KC)(g),bQ="kiro"===g?bO:bP,bR=(0,k.wG)(g),bS=(0,k.mq)(g),bT=(0,k.gb)(g),bU=bS||bT,bV=m(g),bW=function({providerId:a,providerInfo:b,isOAuth:c,supportsApiKeyAuth:d,isCompatible:e}){if(!b||b.noAuth||b.authModes?.includes("none"))return[];let f=[];for(let g of(c&&w(f,"oauth"),(d||e||"cookie"===b.authType||!c)&&w(f,"apikey"),u[a]||[]))w(f,g);return f.map(b=>{let c=t[b];return c?{...c,...v[a]?.[b]}:null}).filter(Boolean)}({providerId:g,providerInfo:bJ,isOAuth:bL,supportsApiKeyAuth:bM,isCompatible:bS||bT}),bX=function(a,{specializedChooser:b=!1}={}){return a.length?b?{type:"specialized"}:1===a.length?{type:"method",methodId:a[0].id}:{type:"chooser"}:{type:"none"}}(bW,{specializedChooser:"kiro"===g}),bY=bW.map(a=>"quota-cookie"===a.id&&0===l.length?{...a,disabled:!0,description:"Add a CodeBuddy connection before attaching its quota cookie."}:a),bZ=k.Q2[g]?.thinkingConfig||k.s9.extended,b$=bU?g:bR,b_=bU?F?.prefix||g:bR,b0=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{cache:"no-store"}),b=await a.json();a.ok&&aZ(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[b$]),b1=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:[a]})})).ok&&await b0()}catch(a){console.log("Error disabling model:",a)}},b2=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b0()}catch(a){console.log("Error enabling model:",a)}},b3=async a=>{a.length&&a_({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a_(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:a})})).ok&&await b0()}catch(a){console.log("Error disabling all models:",a)}}})},b4=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{method:"DELETE"})).ok&&await b0()}catch(a){console.log("Error enabling all models:",a)}},b5=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&an(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),b6=(0,e.useCallback)(async()=>{try{E("");let[a,b,c,d]=await Promise.allSettled([ac("/api/providers"),ac("/api/provider-nodes"),ac("/api/proxy-pools?isActive=true"),ac("/api/settings")]),e="fulfilled"===a.status?a.value.response:null,f="fulfilled"===a.status?a.value.data:{},h="fulfilled"===b.status?b.value.response:null,i="fulfilled"===b.status?b.value.data:{},j="fulfilled"===c.status?c.value.response:null,l="fulfilled"===c.status?c.value.data:{},m="fulfilled"===d.status?d.value.response:null,n=m?.ok&&d.value.data||{};if(e?.ok){let a=(f.connections||[]).filter(a=>a.provider===g);bC.current=a,y(a)}else E("Connections could not be loaded.");j?.ok&&M(l.proxyPools||[]);let o=(n.providerStrategies||{})[g]||{};aN(o.fallbackStrategy||null),aP(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1"),bg.current=null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1";let p=(n.providerThinking||{})[g]||{};aR(p.mode||"auto");let q=aa[g];if(aT(q&&n?.[q]?.connections||{}),h?.ok){let a=(i.nodes||[]).find(a=>a.id===g)||null;if(!a&&((0,k.mq)(g)||(0,k.gb)(g)))for(let b=0;b<3;b+=1){if(await new Promise(a=>setTimeout(a,150)),!bD.current)return;let{response:b,data:c}=await ac("/api/provider-nodes");if(!bD.current)return;if(b.ok&&(a=(c.nodes||[]).find(a=>a.id===g)||null))break}H(a)}}catch(a){console.log("Error fetching connections:",a),bD.current&&E("Connections could not be loaded.")}finally{bD.current&&B(!1)}},[g]),b7=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(H(c.node),await b6(),ah(!1))}catch(a){console.log("Error updating provider node:",a)}},b8=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},b9=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},ca=async(a,b)=>{let c=aa[g];if(!c)return;let d={...aS,[a]:b};aT(d);try{let a=await fetch("/api/settings",{cache:"no-store"}),b={...(a.ok?await a.json():{})[c]||{},connections:d};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[c]:b})})).ok)throw Error("Failed to save auto-ping setting")}catch(a){aT(aS),console.log("Error saving auto-ping config:",a)}},cb=async(a,b,c=bR)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b5();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},cc=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b5()}catch(a){console.log("Error deleting alias:",a)}},cd=async()=>{if(bh)return;let a=l.find(a=>!1!==a.isActive);if(!a)return void alert((0,q.Tl)("Please add an active Qoder connection first"));bi(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,q.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,q.Tl)("No models returned"));let e={...am},f=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${b$}/${c}`;!Object.values(e).includes(d)&&(e[c]||(await cb(c,c,b$),e[c]=d,f+=1))}0===f?alert((0,q.Tl)("All models already exist, no new models added")):alert((0,q.Tl)("Successfully added")+` ${f} `+(0,q.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,q.Tl)("Error fetching models")+": "+a.message)}finally{bi(!1)}},ce=async()=>{let a=[...l];if(a4||0===a.length)return;let b=Object.fromEntries(a.map(a=>[a.id,{state:"queued",error:null}]));be.current=!1,a5(!0),a7(!1),a9(null),bb(b),bd({total:a.length,completed:0,passed:0,failed:0,stopped:!1});let c=0,d=0;try{for(let b=0;b<a.length;b+=1){if(be.current){bd({total:a.length,completed:b,passed:c,failed:d,stopped:!0});break}let e=a[b];if(!bC.current.some(a=>a.id===e.id)){bb(a=>({...a,[e.id]:{state:"skipped",error:null}})),bd({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1});continue}a9(e.id),bb(a=>({...a,[e.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${e.id}/test`,{method:"POST"}),b=await a.json(),f=!!b.valid;f?c+=1:d+=1,bb(a=>({...a,[e.id]:{state:f?"success":"failed",error:f?null:b.error||null}}))}catch(a){d+=1,bb(b=>({...b,[e.id]:{state:"failed",error:a.message||"Test failed"}}))}bd({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1}),b<a.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{a9(null),a5(!1),a7(!1),be.current=!1}},cf=async a=>{a_({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{a_(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&y(l.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},cg=()=>{b6(),O(!1)},ch=(0,e.useCallback)(a=>{bk(a),bm("")},[bG]),ci=async a=>{ad("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b6(),Y(!1);return}ad(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),ad("Failed to save connection")}},cj=async a=>{try{(await fetch(`/api/providers/${ak.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await b6(),af(!1))}catch(a){console.log("Error updating connection:",a)}},ck=async(a,b)=>{try{let c=await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(c.ok){let d=await c.json().catch(()=>null);y(c=>c.map(c=>c.id===a?{...c,isActive:b,...d?.connection||{}}:c))}}catch(a){console.log("Error updating connection status:",a)}},cl=async(a,b)=>{let c=[...l];[c[a],c[b]]=[c[b],c[a]],y(c);try{let[d,e]=await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a+1})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b+1})})]);d.ok&&e.ok||(console.log("Priority swap rejected:",d.status,e.status),await b6())}catch(a){console.log("Error swapping priority:",a),await b6()}},cm=(0,e.useMemo)(()=>{let a=bt.trim().toLowerCase();return l.filter(b=>!!(0,s.i2)(b,br)&&(!a||[b.name,b.email,b.id,b.account,b.username,b.label,b.authType,b.notes,b.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(a)))},[l,br,bt]),cn=(0,e.useMemo)(()=>s.gJ.reduce((a,b)=>(a[b.id]="all"===b.id?l.length:l.filter(a=>(0,s.i2)(a,b.id)).length,a),{}),[l]),co=aE.filter(a=>l.some(b=>b.id===a)),cp=l.filter(a=>co.includes(a.id)),cq="codebuddy"===g?(cp.length>0?cp:l).map(a=>a.id):[],cr=cm.length>0&&cm.every(a=>co.includes(a.id)),cs=a=>{switch(a){case"oauth":bH();return;case"apikey":ad(""),Y(!0);return;case"cookie":R(!0);return;case"quota-cookie":l.length>1&&0===cp.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):T(!0);return;default:bF(`Unsupported connection method: ${a}`,"Add Connection")}},ct=a=>{null!==bE.current&&window.cancelAnimationFrame(bE.current),bE.current=window.requestAnimationFrame(()=>{bE.current=null,cs(a)})},cu=()=>{"specialized"===bX.type?bH():"method"===bX.type?cs(bX.methodId):"chooser"===bX.type&&W(!0)},cv=(()=>{if(0===cp.length)return"";let a=new Set(cp.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return"All selected currently unbound";let c=I.find(a=>a.id===b);return`All selected currently bound to ${c?.name||b}`}return"Selected connections have mixed proxy bindings"})(),cw=()=>{aI||aj(!1)},cx=async a=>{aJ(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await b6(),aj(!1)}finally{aJ(!1)}},cy=a=>cx(cp.map(b=>({connectionId:b.id,proxyPoolId:a}))),cz=a=>{let b="gsuite"===a?"GSuite (non-Gmail)":"Gmail (@gmail.com)";a_({title:`Delete ${b}`,message:`Delete ALL ${b} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{a_(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:bJ?.id||g,emailFilter:a})})).ok&&(aF([]),await b6())}catch(a){console.error("bulk delete error:",a)}}})},cA=Math.max(1,Math.ceil(cm.length/bp)),cB=Math.min(bn,cA),cC=cm.slice((cB-1)*bp,cB*bp),cD=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:cC.map((a,b)=>{let c,e=l.findIndex(b=>b.id===a.id);return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,co.includes(c)),onChange:()=>{var b;return b=a.id,void aF(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${a.name||a.email||a.id}`})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(G,{connection:a,proxyPools:I,isOAuth:bL,isFirst:0===e,isLast:e===l.length-1,onMoveUp:()=>cl(e,e-1),onMoveDown:()=>cl(e,e+1),onToggleActive:b=>ck(a.id,b),autoPingEnabled:!0===aS[a.id],onToggleAutoPing:aa[g]&&"oauth"===a.authType?b=>ca(a.id,b):void 0,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&y(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{al(a),af(!0)},onDelete:()=>cf(a.id),oneByOneStatus:ba[a.id]||null})})]},a.id)})}),cE=I.filter(a=>!0===a.isActive),cF=(0,d.jsx)(j.aF,{isOpen:ai,onClose:cw,title:`Apply Proxy (${cp.length} selected)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=I.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):cx(cp.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aI||0===cE.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>cy(null),disabled:aI,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),I.map(a=>(0,d.jsxs)("button",{onClick:()=>cy(a.id),disabled:aI||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aI&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:cw,variant:"ghost",fullWidth:!0,disabled:aI,children:"Cancel"})]})}),cG=async a=>{av(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b$}/${a}`})}),c=await b.json();ar(b=>({...b,[a]:c.ok?"ok":"error"})),at(b=>({...b,[a]:c.ok?"":c.error||"Model not reachable"}))}catch{ar(b=>({...b,[a]:"error"})),at(b=>({...b,[a]:"Network error"}))}finally{av(b=>{let c=new Set(b);return c.delete(a),c})}};return z?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bJ?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bJ.color}15`},children:ao?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bJ.color},children:bJ.textIcon||bJ.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.A,{src:bS&&bJ.apiType?"responses"===bJ.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bT?"/providers/anthropic-m.png":`/providers/${bJ.id}.png`,alt:bJ.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ap(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bJ.name}),(bJ.notice?.apiKeyUrl||bJ.notice?.signupUrl||bJ.website)&&(0,d.jsxs)("a",{href:bJ.notice?.apiKeyUrl||bJ.notice?.signupUrl||bJ.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bJ.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[l.length," connection",1===l.length?"":"s"]})]})]})]}),bJ.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bJ.deprecationNotice})]}),bJ.notice?.text&&!bJ.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bJ.notice.text}),bJ.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bJ.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 →"})]}),bU&&F&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bT?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bT?"Messages API":"responses"===F.apiType?"Responses API":"Chat Completions"," \xb7 ",(F.baseUrl||"").replace(/\/$/,""),"/",bT?"messages":"responses"===F.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{ad(""),Y(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ah(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a_({title:"Delete Compatible Node",message:`Delete this ${bT?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a_(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bN?(0,d.jsx)(j.gw,{providerId:g}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[l.length>0&&I.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===cp.length)return;let a=[...new Set(cp.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"))];aH(1===a.length?a[0]:"__none__"),aj(!0)},disabled:0===cp.length,children:"Apply Proxy"}),l.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ce,disabled:a4,children:a4?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a4&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a4&&(be.current=!0,a7(!0))},disabled:a6,children:a6?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Thinking"}),(0,d.jsx)("select",{value:aQ,onChange:a=>{var b;aR(b=a.target.value),b9(b)},className:"text-xs px-2 py-1 border border-border rounded-md bg-background focus:outline-none focus:border-primary",title:"Forces reasoning_effort on requests; model chips copy as alias/model(level)",children:(bZ?.options||k.mt).map(a=>(0,d.jsx)("option",{value:a,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(j.lM,{checked:"round-robin"===aM,onChange:a=>{let b=a?"round-robin":null,c=a?aO||"1":aO;a&&!aO&&aP("1"),bg.current=c,bf.current&&(clearTimeout(bf.current),bf.current=null),aN(b),b8(b,c)}}),"round-robin"===aM&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aO,onChange:a=>{var b;aP(b=a.target.value),bg.current=b,bf.current&&clearTimeout(bf.current),bf.current=setTimeout(()=>{b8("round-robin",bg.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),l.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr,onChange:()=>{cr?aF(a=>a.filter(a=>!cm.some(b=>b.id===a))):aF(a=>Array.from(new Set([...a,...cm.map(a=>a.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),cr?"Unselect visible":"Select visible"]}),(0,d.jsxs)(j.Ex,{variant:"default",children:[cm.length," visible"]}),cp.length>0&&(0,d.jsxs)(j.Ex,{variant:"default",children:[cp.length," selected"]}),cv&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:cv}),cp.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>{aF([]),aH("__none__")},children:"Clear"}),cp.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==cp.length&&a_({title:"Delete Selected Connections",message:`Delete ${cp.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{a_(null);let a=[],b=0;for(let c of cp)try{(await fetch(`/api/providers/${c.id}`,{method:"DELETE"})).ok?a.push(c.id):b+=1}catch(a){console.log("Error deleting selected connection:",a),b+=1}aF(b=>b.filter(b=>!a.includes(b))),b>0&&alert(`Deleted ${a.length} connection(s); ${b} failed.`),await b6()}})},children:["Delete Selected (",cp.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>cz("gsuite"),children:"Delete GSuite"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>cz("gmail"),children:"Delete Gmail"})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.gJ.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>bs(a.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${br===a.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[a.label,(0,d.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:cn[a.id]||0})]},a.id))}),l.length>=20&&(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:bt,onChange:a=>bu(a.target.value),placeholder:`Search ${l.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),C?(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:C})]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{B(!0),b6()},children:"Retry"})]}):0===l.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bL?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bW.length>1?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add Connection lists every available authentication method."}):null]})]}),(0,d.jsx)(_,{showAutomation:bV,showAddConnection:"none"!==bX.type,onOpenAutomation:bI,onAddConnection:cu})]}),"kiro"===g&&bj?.jobId&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",bj.status," | Success: ",bj.summary?.success||0," | Running: ",bj.summary?.running||0," | Queued: ",bj.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),ab(bj.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bG,children:"Clear"})]})]}),"kiro"===g&&!bj?.jobId&&bl&&(0,d.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:bl})]}):(0,d.jsxs)(d.Fragment,{children:[bc&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bc.total]}),(0,d.jsxs)("span",{children:["Completed: ",bc.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bc.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bc.failed]}),bc.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a4&&a8&&(0,d.jsxs)("span",{children:["Running: ",l.find(a=>a.id===a8)?.name||a8]})]})}),"kiro"===g&&bj?.jobId&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",bj.status," | Success: ",bj.summary?.success||0," | Running: ",bj.summary?.running||0," | Queued: ",bj.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),ab(bj.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bG,children:"Clear"})]})]}),"kiro"===g&&!bj?.jobId&&bl&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:bl}),cD,"kiro"===g&&cA>1&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",cB," of ",cA," • Showing ",(cB-1)*bp+1,"-",Math.min(cB*bp,cm.length)," of ",cm.length," connections"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cB<=1,onClick:()=>bo(a=>Math.max(1,a-1)),children:"Previous"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cB>=cA,onClick:()=>bo(a=>Math.min(cA,a+1)),children:"Next"})]})]}),"kiro"!==g&&cm.length>0&&(0,d.jsx)(j.dK,{currentPage:cB,pageSize:bp,totalItems:cm.length,onPageChange:bo,onPageSizeChange:a=>{bq(a),bo(1)},className:"mt-2"}),l.length>0&&0===cm.length&&(0,d.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(_,{showAutomation:bV,showAddConnection:"none"!==bX.type,onOpenAutomation:bI,onAddConnection:cu})})]})]}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!bU&&(a=[...bQ,...aW.filter(a=>!bQ.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aY.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aY.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:b4,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>b3(a),children:"Disable All"})]}))]}),Object.values(as).some(Boolean)&&(0,d.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(as).filter(([,a])=>!!a).map(([a,b])=>(0,d.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[a,": ",b]},a))}),(()=>{let a,b,c;if(bU)return(0,d.jsx)(D,{providerStorageAlias:b$,providerDisplayAlias:b_,modelAliases:am,copied:bz,onCopy:bA,onSetAlias:cb,onDeleteAlias:cc,onAliasesChanged:b5,connections:l,isAnthropic:bT});let e=[...bQ,...aW.filter(a=>!bQ.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),f=new Set(aY),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),k=Object.entries(am).filter(([a,b])=>{let c=`${b$}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return bJ.passthroughModels?!bQ.some(a=>a.id===d):!bQ.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${b$}/`.length),alias:a,fullModel:b})),m=Math.min(bv,Math.max(1,Math.ceil(h.length/bx))),n=h.slice((m-1)*bx,m*bx);return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[k.map(a=>(0,d.jsx)(A,{model:{id:a.id},fullModel:`${b_}/${a.id}`,alias:a.alias,copied:bz,onCopy:bA,onSetAlias:()=>{},onDeleteAlias:()=>cc(a.alias),testStatus:aq[a.id],onTest:l.length>0||bN?()=>cG(a.id):void 0,isTesting:au.has(a.id),isCustom:!0,isFree:!1,thinkingSuffix:aQ&&"auto"!==aQ&&"off"!==aQ&&"none"!==aQ?aQ:null},a.id)),n.map(a=>{let b=`${b$}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(am).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(A,{model:a,fullModel:`${b_}/${a.id}`,alias:e,copied:bz,onCopy:bA,onSetAlias:b=>cb(a.id,b,b$),onDeleteAlias:()=>cc(e),testStatus:aq[a.id],onTest:l.length>0||bN?()=>cG(a.id):void 0,isTesting:au.has(a.id),isFree:a.isFree,onDisable:()=>b1(a.id),thinkingSuffix:aQ&&"auto"!==aQ&&"off"!==aQ&&"none"!==aQ?aQ:null},a.id)}),h.length>bx&&(0,d.jsx)("div",{className:"w-full",children:(0,d.jsx)(j.dK,{currentPage:m,pageSize:bx,totalItems:h.length,onPageChange:bw,onPageSizeChange:a=>{by(a),bw(1)}})}),(0,d.jsxs)("button",{onClick:()=>ax(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"codebuddy"===g&&(0,d.jsxs)("button",{onClick:()=>az(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-cyan-500/50 px-3 py-2 text-xs text-cyan-700 transition-colors hover:border-cyan-500 hover:bg-cyan-500/[0.07] dark:text-cyan-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Discover Models"]}),"opencode"===g&&(0,d.jsxs)("button",{onClick:()=>aB(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-orange-500/50 px-3 py-2 text-xs text-orange-700 transition-colors hover:border-orange-500 hover:bg-orange-500/[0.07] dark:text-orange-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"kiro"===g&&(0,d.jsxs)("button",{onClick:()=>aD(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-violet-500/50 px-3 py-2 text-xs text-violet-700 transition-colors hover:border-violet-500 hover:bg-violet-500/[0.07] dark:text-violet-300 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"qoder"===g&&l.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:cd,disabled:bh,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bh?{animation:"spin 1s linear infinite"}:void 0,children:bh?"progress_activity":"download"}),bh?(0,q.Tl)("Fetching..."):(0,q.Tl)("Fetch Qoder Models")]}),aU.length>0&&(a=new Set(Object.values(am)),b=new Set(bQ.map(a=>a.id)),0===(c=aU.filter(c=>!a.has(`${b$}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{let b=a.id.split("/").pop();await cb(a.id,b,b$)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>b2(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),ai&&cF,V&&(0,d.jsx)(j.mz,{isOpen:!0,providerName:bJ.name,methods:bY,onSelect:a=>{W(!1),ct(a)},onClose:()=>W(!1)}),N&&("kiro"===g?(0,d.jsx)(j.Mh,{isOpen:!0,providerInfo:bJ,onSuccess:cg,onRefresh:b6,initialBulkJobId:bj?.jobId||null,onBulkJobChange:ch,onClose:()=>O(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:!0,onSuccess:cg,onClose:()=>O(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:!0,providerInfo:bJ,onSuccess:cg,onClose:()=>O(!1)}):(0,d.jsx)(j.LF,{isOpen:!0,provider:g,providerInfo:bJ,onSuccess:cg,onClose:()=>O(!1)})),"iflow"===g&&P&&(0,d.jsx)(j.vE,{isOpen:!0,onSuccess:()=>{b6(),R(!1)},onClose:()=>R(!1)}),"codebuddy"===g&&S&&(0,d.jsx)(j.xl,{isOpen:!0,connectionIds:cq,onSuccess:()=>{b6(),T(!1)},onClose:()=>T(!1)}),X&&(0,d.jsx)(J,{isOpen:!0,provider:g,providerName:bJ.name,isCompatible:bU,isAnthropic:bT,authType:bJ?.authType,authHint:bJ?.authHint,website:bJ?.website,proxyPools:I,error:Z,onSave:ci,onBulkDone:b6,onClose:()=>{ad(""),Y(!1)}}),ae&&ak&&(0,d.jsx)(j.wI,{isOpen:!0,connection:ak,proxyPools:I,onSave:cj,onClose:()=>af(!1)}),bU&&ag&&(0,d.jsx)(K,{isOpen:!0,node:F,onSave:b7,onClose:()=>ah(!1),isAnthropic:bT}),!bU&&aw&&(0,d.jsx)(L,{isOpen:!0,providerAlias:b$,providerDisplayAlias:b_,onSave:async a=>{let b=bJ?.passthroughModels?a.split("/").pop():a;await cb(a,b,b$),ax(!1)},onClose:()=>ax(!1)}),"codebuddy"===g&&ay&&(0,d.jsx)(Q,{isOpen:!0,connections:l,onModelsAdded:async a=>{for(let b of a)await cb(b.id,b.id,"cb");await b5()},onClose:()=>az(!1)}),"opencode"===g&&aA&&(0,d.jsx)(U,{isOpen:!0,onModelsAdded:async a=>{for(let b of a)await cb(b.id,b.id,"oc");await b5()},onClose:()=>aB(!1)}),"kiro"===g&&aC&&(0,d.jsx)($,{isOpen:!0,connections:l,onClose:()=>aD(!1)}),a0&&(0,d.jsx)(j.uo,{isOpen:!0,onClose:()=>a1(!1),onConfirm:()=>{a1(!1),a3(null),ct(a2||"oauth")},title:"Risk Notice",message:bJ?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),a$&&(0,d.jsx)(j.uo,{isOpen:!0,onClose:()=>{aK||a_(null)},onConfirm:async()=>{if(aK)return;let a=a$?.onConfirm;if(a){aL(!0);try{await a()}finally{aL(!1)}}},title:a$?.title||"Confirm",message:a$?.message,variant:"danger",loading:aK})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,2430,6686,2760,492,3999,5024,3477,5681,1131,412,1756],()=>b(b.s=20893));module.exports=c})();