prozygent 0.7.6 → 0.7.8

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 (365) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  31. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  40. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  41. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  42. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  43. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  44. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  46. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  47. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  75. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  91. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  97. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/settings/migrate-9router/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/version/hot-update/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  151. package/app/.next-cli-build/server/app/callback.html +1 -1
  152. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  153. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  154. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  155. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  156. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  157. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  158. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  160. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  161. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  162. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  163. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  164. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  165. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  166. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  167. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  168. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  169. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  170. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  171. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  172. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  173. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  174. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  175. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  176. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  177. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  178. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  181. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  182. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  183. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  185. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  186. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  187. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  188. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  191. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  192. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  193. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  194. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  195. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  196. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  197. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  198. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  201. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  202. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  203. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  204. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  207. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  208. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  209. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  212. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  213. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  217. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  218. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  219. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  222. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  223. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  227. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  228. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  229. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  232. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  233. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  238. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  239. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  240. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  243. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  244. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  248. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  250. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  253. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  254. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  258. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  260. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  262. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  263. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  264. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  267. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  268. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  270. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  274. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  275. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  277. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  284. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  285. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  288. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  289. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  291. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  294. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  295. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  298. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  299. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  301. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  304. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  305. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  308. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  309. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  311. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  313. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  314. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  315. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  317. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  318. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  320. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/index.html +1 -1
  322. package/app/.next-cli-build/server/app/index.rsc +4 -4
  323. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  325. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  327. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  329. package/app/.next-cli-build/server/app/landing.html +1 -1
  330. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  331. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  332. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  334. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  335. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  338. package/app/.next-cli-build/server/app/login.html +1 -1
  339. package/app/.next-cli-build/server/app/login.rsc +5 -5
  340. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  341. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  343. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  345. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  347. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  348. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  349. package/app/.next-cli-build/server/chunks/318.js +1 -1
  350. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  351. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  352. package/app/.next-cli-build/server/chunks/4914.js +1 -1
  353. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  354. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  355. package/app/.next-cli-build/server/pages/404.html +1 -1
  356. package/app/.next-cli-build/server/pages/500.html +1 -1
  357. package/app/.next-cli-build/static/chunks/{1321-594b9ebf524927c0.js → 1321-c92521c521198813.js} +1 -1
  358. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-659a15ad49007b59.js → page-d866638fd9eb3ae9.js} +1 -1
  359. package/app/cli/.build-home/.prozygent/db/backups/{upgrade-0.7.1-to-0.7.2-0.7.2-20260704-005521 → upgrade-0.7.6-to-0.7.7-0.7.7-20260705-203906}/data.sqlite +0 -0
  360. package/app/cli/.build-home/.prozygent/db/backups/{upgrade-0.7.2-to-0.7.3-0.7.3-20260704-010910 → upgrade-0.7.7-to-0.7.8-0.7.8-20260705-212632}/data.sqlite +0 -0
  361. package/app/cli/.build-home/.prozygent/db/data.sqlite +0 -0
  362. package/app/package.json +1 -1
  363. package/package.json +1 -1
  364. /package/app/.next-cli-build/static/{z4k_m2L8-kwH51MBg9qO7 → bNj_rmqgQqKXa9NPatImK}/_buildManifest.js +0 -0
  365. /package/app/.next-cli-build/static/{z4k_m2L8-kwH51MBg9qO7 → bNj_rmqgQqKXa9NPatImK}/_ssgManifest.js +0 -0
@@ -7,4 +7,4 @@ sk-key-only-auto-named`;function A({isOpen:e,provider:t,providerName:s,isCompati
7
7
  "idToken": "eyJhbGc...",
8
8
  "email": "user@example.com"
9
9
  }
10
- ]`;function P({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),h=()=>{n||(r(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,u.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{o(!1)}},g=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:l,onChange:e=>r(e.target.value),disabled:n}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:n,children:(0,u.Tl)("Close")})]})]})})}function E(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,{getCaps:h}=(0,x.y)(),[y,b]=(0,i.useState)([]),[j,N]=(0,i.useState)(!0),[k,S]=(0,i.useState)(null),[O,E]=(0,i.useState)([]),[I,R]=(0,i.useState)(!1),[D,U]=(0,i.useState)(!1),[_,M]=(0,i.useState)(!1),[q,z]=(0,i.useState)(""),[F,K]=(0,i.useState)(!1),[L,J]=(0,i.useState)(!1),[W,B]=(0,i.useState)(!1),[H,G]=(0,i.useState)(!1),[V,Q]=(0,i.useState)(null),[Z,X]=(0,i.useState)({}),[Y,ee]=(0,i.useState)([]),[et,es]=(0,i.useState)(!1),[ea,ei]=(0,i.useState)({}),[el,er]=(0,i.useState)(""),[en,eo]=(0,i.useState)(()=>new Set),[ed,ec]=(0,i.useState)(!1),[em,ep]=(0,i.useState)([]),[ex,eu]=(0,i.useState)("__none__"),[eh,ef]=(0,i.useState)(!1),[eg,ey]=(0,i.useState)(null),[eb,ev]=(0,i.useState)(""),[ej,ew]=(0,i.useState)("auto"),[eN,ek]=(0,i.useState)({enabled:!1,connections:{}}),[eC,eS]=(0,i.useState)([]),[eA,e$]=(0,i.useState)([]),[eT,eO]=(0,i.useState)([]),[eP,eE]=(0,i.useState)(null),[eI,eR]=(0,i.useState)(!1),[eD,eU]=(0,i.useState)(!1),[e_,eM]=(0,i.useState)(!1),[eq,ez]=(0,i.useState)(null),[eF,eK]=(0,i.useState)({}),[eL,eJ]=(0,i.useState)(null),eW=(0,i.useRef)(!1),[eB,eH]=(0,i.useState)(!1),[eG,eV]=(0,i.useState)(!1),[eQ,eZ]=(0,i.useState)(null),[eX,eY]=(0,i.useState)(new Set),{copied:e0,copy:e1}=(0,p.C)(),e5="ag_risk_confirmed",e2=()=>{R(!0)},e4=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(e5)?eR(!0):e9?e2():(z(""),M(!0))},e3=()=>{z(""),M(!0)},e6=()=>{e9?e4():e3()},e7=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r]||c.br[r],e8=e7?.authModes||[],e9=!!c.zN[r]||!!c.IS[r]||e8.includes("oauth"),te=!!c.fg[r]||e8.includes("apikey"),tt=!!c.IS[r]?.noAuth,ts=(0,m.KC)(r),ta=(0,c.wG)(r),ti=(0,c.mq)(r),tl=(0,c.gb)(r),tr=ti||tl,tn=!tr&&e9&&te,to="xai"===r?"Grok Build OAuth":"OAuth",td="xai"===r?"xAI API Key":"API Key";c.Q2[r]?.thinkingConfig||c.s9.extended;let tc=tr?r:ta,tm=tr?k?.prefix||r:ta,tp=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}`,{cache:"no-store"}),t=await e.json();e.ok&&eO(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tc]),tx=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tc,ids:[e]})})).ok&&await tp()}catch(e){console.log("Error disabling model:",e)}},tu=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tp()}catch(e){console.log("Error enabling model:",e)}},th=async e=>{e.length&&eE({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eE(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tc,ids:e})})).ok&&await tp()}catch(e){console.log("Error disabling all models:",e)}}})},tf=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}`,{method:"DELETE"})).ok&&await tp()}catch(e){console.log("Error enabling all models:",e)}},tg=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&X(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),ty=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ee(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e$(e.models)}).catch(()=>{})},[r]);let tb=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),n=await s.json(),o=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===r);b(e)}s.ok&&E(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};ey(d.fallbackStrategy||null),ev(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};ew(c.mode||"auto");let m=o.claudeAutoPing||{};if(ek({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&tr)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{N(!1)}},[r,tr]),tv=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(S(s.node),await tb(),B(!1))}catch(e){console.log("Error updating provider node:",e)}},tj=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[r]:l[r]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tw=async e=>{ek(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,i.useEffect)(()=>{tb(),tg(),ty(),tp()},[tb,tg,ty,tp]),(0,i.useEffect)(()=>{let e=(c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r])?.modelsFetcher;e&&f(e).then(eS)},[r]);let tN=async(e,t,s=ta)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tg();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tk=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tg()}catch(e){console.log("Error deleting alias:",e)}},tC=async(e,t="llm",s=tc)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await ty(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tS=async(e,t="llm",s=tc)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await ty(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tA=async()=>{if(eB)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eH(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,u.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,u.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");Y.some(e=>e.providerAlias===tc&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(Z).includes(`${tc}/${s}`)||(await tC(s,"llm",tc),i+=1)}0===i?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${i} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eH(!1)}},t$=async()=>{if(!eG&&0!==y.length){eV(!0),eZ(null),eY(new Set);try{let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active connection first"));let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void eZ({type:"error",message:s.error||"Failed to fetch models"});let a=s.models||[],i=new Set(a.map(e=>(e.id||e.name||e.model||"").toLowerCase())),l=new Set(ts.map(e=>e.id)),r=new Set(Y.filter(e=>e.providerAlias===tc).map(e=>e.id)),n=new Set([...l,...r]),o=new Set;for(let e of n)i.has(e.toLowerCase())||o.add(e);eY(o);let d=a.filter(e=>{let t=e.id||e.name||e.model;return t&&!n.has(t)}),c=0;for(let e of d){let t=e.id||e.name||e.model;t&&(await tC(t,"llm",tc),c+=1)}eZ({type:"success",added:c,missing:[...o],newModels:d.map(e=>e.id||e.name||e.model)})}catch(e){eZ({type:"error",message:e.message})}finally{eV(!1)}}},tT=async()=>{if(eD||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,eU(!0),eM(!1),ez(null),eK(e),eJ({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(eW.current){eJ({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=y[e];ez(a.id),eK(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eK(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eK(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eJ({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{ez(null),eU(!1),eM(!1),eW.current=!1}},tO=async e=>{eE({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eE(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(y.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tP=()=>{tb(),R(!1)},tE=async e=>{z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tb(),M(!1);return}z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),z("Failed to save connection")}},tI=async e=>{try{(await fetch(`/api/providers/${V.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tb(),J(!1))}catch(e){console.log("Error updating connection:",e)}},tR=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tD=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tb()}},tU=y.filter(e=>em.includes(e.id));y.length>0&&(em.length,y.length),(0,i.useEffect)(()=>{ep(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===tU.length)return;let e=new Set(tU.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=O.find(e=>e.id===t);return s?.name}})();let t_=()=>{eh||G(!1)},tM=async e=>{ef(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tb(),G(!1)}finally{ef(!1)}},tq=e=>tM(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),tz=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:y.map((e,t)=>(0,a.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(C,{connection:e,proxyPools:O,isOAuth:e9,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>tD(t,t-1),onMoveDown:()=>tD(t,t+1),onToggleActive:t=>tR(e.id,t),autoPing:"claude"===r&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var s;return s=e.id,void tw({...eN,connections:{...eN.connections,[s]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Q(e),J(!0)},onDelete:()=>tO(e.id),oneByOneStatus:eF[e.id]||null})})},e.id))}),tF=O.filter(e=>!0===e.isActive),tK=(0,a.jsx)(d.aF,{isOpen:H,onClose:t_,title:`Apply Proxy (${y.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=O.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tM(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eh||0===tF.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,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>tq(null),disabled:eh,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,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),O.map(e=>(0,a.jsxs)("button",{onClick:()=>tq(e.id),disabled:eh||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eh&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:t_,variant:"ghost",fullWidth:!0,disabled:eh,children:"Cancel"})]})}),tL=async e=>{if(!en.has(e)){eo(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tc}/${e}`})}),s=await t.json();ei(t=>({...t,[e]:s.ok?"ok":"error"})),er(s.ok?"":s.error||"Model not reachable")}catch{ei(t=>({...t,[e]:"error"})),er("Network error")}finally{eo(t=>{let s=new Set(t);return s.delete(e),s})}}};return j?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e7?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e7.color}15`},children:et?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e7.color},children:e7.textIcon||e7.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:ti&&e7.apiType?"responses"===e7.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tl?"/providers/anthropic-m.png":`/providers/${e7.id}.png`,alt:e7.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>es(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e7.name}),(e7.notice?.apiKeyUrl||e7.notice?.signupUrl||e7.website)&&(0,a.jsxs)("a",{href:e7.notice?.apiKeyUrl||e7.notice?.signupUrl||e7.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e7.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),e7.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e7.deprecationNotice})]}),e7.notice?.text&&!e7.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e7.notice.text}),e7.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e7.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 →"})]}),tr&&k&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tl?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tl?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tl?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{z(""),M(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>B(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eE({title:"Delete Compatible Node",message:`Delete this ${tl?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eE(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tt?(0,a.jsx)(d.gw,{providerId:r}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&O.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>G(!0),children:"Apply Proxy"}),y.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tT,disabled:eD,children:eD?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eD&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eD&&(eW.current=!0,eM(!0))},disabled:e_,children:e_?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===eg,onChange:e=>{let t=e?"round-robin":null,s=e?eb||"1":eb;e&&!eb&&ev("1"),ey(t),tj(t,s)}}),"round-robin"===eg&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eb,onChange:e=>{var t;ev(t=e.target.value),tj("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e9?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tn&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",to," or ",td,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:to}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e3,children:td})]}):(0,a.jsxs)(a.Fragment,{children:[!tr&&"iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),children:(0,u.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e6,children:tr?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eL&&(0,a.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,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eL.total]}),(0,a.jsxs)("span",{children:["Completed: ",eL.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eL.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eL.failed]}),eL.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eD&&eq&&(0,a.jsxs)("span",{children:["Running: ",y.find(e=>e.id===eq)?.name||eq]})]})}),tz,!tr&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:to}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e3,className:"w-full sm:w-auto",children:td})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e6,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!tr&&(e=[...ts,...eA.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eT.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eT.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tf,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>th(e),children:"Disable All"})]}))]}),!!el&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:el}),(()=>{let e,t,s;if(tr)return(0,a.jsx)(w,{providerStorageAlias:tc,providerDisplayAlias:tm,modelAliases:Z,customModels:Y,copied:e0,onCopy:e1,onSetAlias:tN,onDeleteAlias:tk,onAddCustomModel:e=>tC(e,"llm",tc),onDeleteCustomModel:e=>tS(e,"llm",tc),connections:y,isAnthropic:tl});let i=[...ts,...eA.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eT),n=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),d=g({customModels:Y,modelAliases:Z,providerAlias:tc,builtInModels:ts,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${tm}/${e.id}`,alias:e.alias,copied:e0,onCopy:e1,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tS(e.id,"llm",tc):tk(e.alias)},testStatus:ea[e.id],onTest:y.length>0||tt?()=>tL(e.id):void 0,isTesting:en.has(e.id),isCustom:!0,isFree:!1,caps:h(`${r}/${e.id}`),isMissing:eX.has(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tc}/${e.id}`,s=`${r}/${e.id}`,i=Object.entries(Z).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${tm}/${e.id}`,alias:i,copied:e0,onCopy:e1,onSetAlias:t=>tN(e.id,t,tc),onDeleteAlias:()=>tk(i),testStatus:ea[e.id],onTest:y.length>0||tt?()=>tL(e.id):void 0,isTesting:en.has(e.id),isFree:e.isFree,onDisable:()=>tx(e.id),caps:h(`${r}/${e.id}`),isMissing:eX.has(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>ec(!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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t$,disabled:eG,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-green-500/40 px-3 py-2 text-xs text-green-600 dark:text-green-400 transition-colors hover:border-green-500 hover:bg-green-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eG?{animation:"spin 1s linear infinite"}:void 0,children:eG?"progress_activity":"sync"}),eG?(0,u.Tl)("Updating..."):(0,u.Tl)("Update Models")]}),eQ&&(0,a.jsxs)("div",{className:`w-full flex flex-col gap-1.5 p-2.5 rounded-lg text-xs ${"error"===eQ.type?"bg-red-500/10 border border-red-500/30":"bg-green-500/10 border border-green-500/30"}`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-sm ${"error"===eQ.type?"text-red-500":"text-green-500"}`,children:"error"===eQ.type?"error":"check_circle"}),(0,a.jsx)("span",{className:"error"===eQ.type?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400",children:"error"===eQ.type?eQ.message:`${eQ.added} model(s) added`}),(0,a.jsx)("button",{onClick:()=>eZ(null),className:"ml-auto text-text-muted hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),"success"===eQ.type&&eQ.missing?.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Missing:"}),eQ.missing.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-red-500/10 text-red-600 dark:text-red-400 text-[10px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"circle"}),e]},e))]}),"success"===eQ.type&&eQ.newModels?.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"New:"}),eQ.newModels.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 dark:text-green-400 text-[10px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"add_circle"}),e]},e))]})]}),"qoder"===r&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:tA,disabled:eB,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,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eB?{animation:"spin 1s linear infinite"}:void 0,children:eB?"progress_activity":"download"}),eB?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eC.length>0&&(e=new Set([...Object.values(Z),...d.map(e=>e.fullModel)]),t=new Set(ts.map(e=>e.id)),0===(s=eC.filter(s=>!e.has(`${tc}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tC(e.id,"llm",tc)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,a.jsxs)("button",{onClick:()=>tu(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tK,"kiro"===r?(0,a.jsx)(d.Mh,{isOpen:I,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}):"cursor"===r?(0,a.jsx)(d.G9,{isOpen:I,onSuccess:tP,onClose:()=>R(!1)}):"gitlab"===r?(0,a.jsx)(d.vj,{isOpen:I,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}):(0,a.jsx)(d.LF,{isOpen:I,provider:r,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}),"iflow"===r&&(0,a.jsx)(d.vE,{isOpen:D,onSuccess:()=>{tb(),U(!1)},onClose:()=>U(!1)}),(0,a.jsx)(A,{isOpen:_,provider:r,providerName:e7.name,isCompatible:tr,isAnthropic:tl,authType:e7?.authType,authHint:e7?.authHint,website:e7?.website,proxyPools:O,error:q,onSave:tE,onBulkDone:tb,onClose:()=>{z(""),M(!1)}}),(0,a.jsx)(d.wI,{isOpen:L,connection:V,proxyPools:O,onSave:tI,onClose:()=>J(!1)}),tr&&(0,a.jsx)($,{isOpen:W,node:k,onSave:tv,onClose:()=>B(!1),isAnthropic:tl}),!tr&&(0,a.jsx)(T,{isOpen:ed,providerAlias:tc,providerDisplayAlias:tm,onSave:async e=>{await tC(e,"llm",tc),ec(!1)},onClose:()=>ec(!1)}),"codex"===r&&(0,a.jsx)(P,{isOpen:F,onClose:()=>K(!1),onSuccess:tb}),(0,a.jsx)(d.uo,{isOpen:eI,onClose:()=>eR(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eR(!1),e9)?e2():e3()},title:"Risk Notice",message:e7?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eP,onClose:()=>eE(null),onConfirm:eP?.onConfirm,title:eP?.title||"Confirm",message:eP?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}P.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func}},96083:(e,t,s)=>{Promise.resolve().then(s.bind(s,78907))}},e=>{e.O(0,[8637,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=96083)),_N_E=e.O()}]);
10
+ ]`;function P({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),h=()=>{n||(r(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,u.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{o(!1)}},g=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:l,onChange:e=>r(e.target.value),disabled:n}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:n,children:(0,u.Tl)("Close")})]})]})})}function E(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,{getCaps:h}=(0,x.y)(),[y,b]=(0,i.useState)([]),[j,N]=(0,i.useState)(!0),[k,S]=(0,i.useState)(null),[O,E]=(0,i.useState)([]),[I,R]=(0,i.useState)(!1),[D,U]=(0,i.useState)(!1),[_,M]=(0,i.useState)(!1),[q,z]=(0,i.useState)(""),[F,K]=(0,i.useState)(!1),[L,J]=(0,i.useState)(!1),[W,B]=(0,i.useState)(!1),[H,G]=(0,i.useState)(!1),[V,Q]=(0,i.useState)(null),[Z,X]=(0,i.useState)({}),[Y,ee]=(0,i.useState)([]),[et,es]=(0,i.useState)(!1),[ea,ei]=(0,i.useState)({}),[el,er]=(0,i.useState)(""),[en,eo]=(0,i.useState)(()=>new Set),[ed,ec]=(0,i.useState)(!1),[em,ep]=(0,i.useState)([]),[ex,eu]=(0,i.useState)("__none__"),[eh,ef]=(0,i.useState)(!1),[eg,ey]=(0,i.useState)(null),[eb,ev]=(0,i.useState)(""),[ej,ew]=(0,i.useState)("auto"),[eN,ek]=(0,i.useState)({enabled:!1,connections:{}}),[eC,eS]=(0,i.useState)([]),[eA,e$]=(0,i.useState)([]),[eT,eO]=(0,i.useState)([]),[eP,eE]=(0,i.useState)(null),[eI,eR]=(0,i.useState)(!1),[eD,eU]=(0,i.useState)(!1),[e_,eM]=(0,i.useState)(!1),[eq,ez]=(0,i.useState)(null),[eF,eK]=(0,i.useState)({}),[eL,eJ]=(0,i.useState)(null),eW=(0,i.useRef)(!1),[eB,eH]=(0,i.useState)(!1),[eG,eV]=(0,i.useState)(!1),[eQ,eZ]=(0,i.useState)(null),[eX,eY]=(0,i.useState)(new Set),{copied:e0,copy:e1}=(0,p.C)(),e5="ag_risk_confirmed",e2=()=>{R(!0)},e4=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(e5)?eR(!0):e9?e2():(z(""),M(!0))},e3=()=>{z(""),M(!0)},e6=()=>{e9?e4():e3()},e7=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r]||c.br[r],e8=e7?.authModes||[],e9=!!c.zN[r]||!!c.IS[r]||e8.includes("oauth"),te=!!c.fg[r]||e8.includes("apikey"),tt=!!c.IS[r]?.noAuth,ts=(0,m.KC)(r),ta=(0,c.wG)(r),ti=(0,c.mq)(r),tl=(0,c.gb)(r),tr=ti||tl,tn=!tr&&e9&&te,to="xai"===r?"Grok Build OAuth":"OAuth",td="xai"===r?"xAI API Key":"API Key";c.Q2[r]?.thinkingConfig||c.s9.extended;let tc=tr?r:ta,tm=tr?k?.prefix||r:ta,tp=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}`,{cache:"no-store"}),t=await e.json();e.ok&&eO(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tc]),tx=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tc,ids:[e]})})).ok&&await tp()}catch(e){console.log("Error disabling model:",e)}},tu=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tp()}catch(e){console.log("Error enabling model:",e)}},th=async e=>{e.length&&eE({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eE(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tc,ids:e})})).ok&&await tp()}catch(e){console.log("Error disabling all models:",e)}}})},tf=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tc)}`,{method:"DELETE"})).ok&&await tp()}catch(e){console.log("Error enabling all models:",e)}},tg=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&X(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),ty=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ee(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e$(e.models)}).catch(()=>{})},[r]);let tb=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),n=await s.json(),o=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===r);b(e)}s.ok&&E(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};ey(d.fallbackStrategy||null),ev(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};ew(c.mode||"auto");let m=o.claudeAutoPing||{};if(ek({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&tr)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{N(!1)}},[r,tr]),tv=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(S(s.node),await tb(),B(!1))}catch(e){console.log("Error updating provider node:",e)}},tj=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[r]:l[r]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tw=async e=>{ek(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,i.useEffect)(()=>{tb(),tg(),ty(),tp()},[tb,tg,ty,tp]),(0,i.useEffect)(()=>{let e=(c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r])?.modelsFetcher;e&&f(e).then(eS)},[r]);let tN=async(e,t,s=ta)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tg();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tk=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tg()}catch(e){console.log("Error deleting alias:",e)}},tC=async(e,t="llm",s=tc)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await ty(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tS=async(e,t="llm",s=tc)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await ty(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tA=async()=>{if(eB)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eH(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,u.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,u.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");Y.some(e=>e.providerAlias===tc&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(Z).includes(`${tc}/${s}`)||(await tC(s,"llm",tc),i+=1)}0===i?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${i} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eH(!1)}},t$=async()=>{if(!eG&&0!==y.length){eV(!0),eZ(null),eY(new Set);try{let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active connection first"));let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void eZ({type:"error",message:s.error||"Failed to fetch models"});let a=s.models||[];if(0===a.length)return void eZ({type:"success",added:0,missing:[],newModels:[],message:"Provider does not support model listing — nothing to compare"});let i=new Set(a.map(e=>(e.id||e.name||e.model||"").toLowerCase())),l=new Set(ts.map(e=>e.id)),r=new Set(Y.filter(e=>e.providerAlias===tc).map(e=>e.id)),n=new Set([...l,...r]),o=new Set;for(let e of n)i.has(e.toLowerCase())||o.add(e);eY(o);let d=a.filter(e=>{let t=e.id||e.name||e.model;return t&&!n.has(t)}),c=0;for(let e of d){let t=e.id||e.name||e.model;t&&(await tC(t,"llm",tc),c+=1)}eZ({type:"success",added:c,missing:[...o],newModels:d.map(e=>e.id||e.name||e.model)})}catch(e){eZ({type:"error",message:e.message})}finally{eV(!1)}}},tT=async()=>{if(eD||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,eU(!0),eM(!1),ez(null),eK(e),eJ({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(eW.current){eJ({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=y[e];ez(a.id),eK(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eK(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eK(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eJ({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{ez(null),eU(!1),eM(!1),eW.current=!1}},tO=async e=>{eE({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eE(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(y.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tP=()=>{tb(),R(!1)},tE=async e=>{z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tb(),M(!1);return}z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),z("Failed to save connection")}},tI=async e=>{try{(await fetch(`/api/providers/${V.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tb(),J(!1))}catch(e){console.log("Error updating connection:",e)}},tR=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tD=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tb()}},tU=y.filter(e=>em.includes(e.id));y.length>0&&(em.length,y.length),(0,i.useEffect)(()=>{ep(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===tU.length)return;let e=new Set(tU.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=O.find(e=>e.id===t);return s?.name}})();let t_=()=>{eh||G(!1)},tM=async e=>{ef(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tb(),G(!1)}finally{ef(!1)}},tq=e=>tM(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),tz=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:y.map((e,t)=>(0,a.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(C,{connection:e,proxyPools:O,isOAuth:e9,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>tD(t,t-1),onMoveDown:()=>tD(t,t+1),onToggleActive:t=>tR(e.id,t),autoPing:"claude"===r&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var s;return s=e.id,void tw({...eN,connections:{...eN.connections,[s]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Q(e),J(!0)},onDelete:()=>tO(e.id),oneByOneStatus:eF[e.id]||null})})},e.id))}),tF=O.filter(e=>!0===e.isActive),tK=(0,a.jsx)(d.aF,{isOpen:H,onClose:t_,title:`Apply Proxy (${y.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=O.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tM(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eh||0===tF.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,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>tq(null),disabled:eh,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,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),O.map(e=>(0,a.jsxs)("button",{onClick:()=>tq(e.id),disabled:eh||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eh&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:t_,variant:"ghost",fullWidth:!0,disabled:eh,children:"Cancel"})]})}),tL=async e=>{if(!en.has(e)){eo(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tc}/${e}`})}),s=await t.json();ei(t=>({...t,[e]:s.ok?"ok":"error"})),er(s.ok?"":s.error||"Model not reachable")}catch{ei(t=>({...t,[e]:"error"})),er("Network error")}finally{eo(t=>{let s=new Set(t);return s.delete(e),s})}}};return j?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e7?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e7.color}15`},children:et?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e7.color},children:e7.textIcon||e7.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:ti&&e7.apiType?"responses"===e7.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tl?"/providers/anthropic-m.png":`/providers/${e7.id}.png`,alt:e7.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>es(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e7.name}),(e7.notice?.apiKeyUrl||e7.notice?.signupUrl||e7.website)&&(0,a.jsxs)("a",{href:e7.notice?.apiKeyUrl||e7.notice?.signupUrl||e7.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e7.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),e7.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e7.deprecationNotice})]}),e7.notice?.text&&!e7.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e7.notice.text}),e7.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e7.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 →"})]}),tr&&k&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tl?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tl?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tl?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{z(""),M(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>B(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eE({title:"Delete Compatible Node",message:`Delete this ${tl?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eE(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tt?(0,a.jsx)(d.gw,{providerId:r}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&O.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>G(!0),children:"Apply Proxy"}),y.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tT,disabled:eD,children:eD?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eD&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eD&&(eW.current=!0,eM(!0))},disabled:e_,children:e_?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===eg,onChange:e=>{let t=e?"round-robin":null,s=e?eb||"1":eb;e&&!eb&&ev("1"),ey(t),tj(t,s)}}),"round-robin"===eg&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eb,onChange:e=>{var t;ev(t=e.target.value),tj("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e9?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tn&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",to," or ",td,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:to}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e3,children:td})]}):(0,a.jsxs)(a.Fragment,{children:[!tr&&"iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),children:(0,u.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e6,children:tr?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eL&&(0,a.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,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eL.total]}),(0,a.jsxs)("span",{children:["Completed: ",eL.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eL.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eL.failed]}),eL.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eD&&eq&&(0,a.jsxs)("span",{children:["Running: ",y.find(e=>e.id===eq)?.name||eq]})]})}),tz,!tr&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:to}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e3,className:"w-full sm:w-auto",children:td})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e6,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!tr&&(e=[...ts,...eA.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eT.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eT.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tf,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>th(e),children:"Disable All"})]}))]}),!!el&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:el}),(()=>{let e,t,s;if(tr)return(0,a.jsx)(w,{providerStorageAlias:tc,providerDisplayAlias:tm,modelAliases:Z,customModels:Y,copied:e0,onCopy:e1,onSetAlias:tN,onDeleteAlias:tk,onAddCustomModel:e=>tC(e,"llm",tc),onDeleteCustomModel:e=>tS(e,"llm",tc),connections:y,isAnthropic:tl});let i=[...ts,...eA.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eT),n=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),d=g({customModels:Y,modelAliases:Z,providerAlias:tc,builtInModels:ts,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${tm}/${e.id}`,alias:e.alias,copied:e0,onCopy:e1,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tS(e.id,"llm",tc):tk(e.alias)},testStatus:ea[e.id],onTest:y.length>0||tt?()=>tL(e.id):void 0,isTesting:en.has(e.id),isCustom:!0,isFree:!1,caps:h(`${r}/${e.id}`),isMissing:eX.has(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tc}/${e.id}`,s=`${r}/${e.id}`,i=Object.entries(Z).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${tm}/${e.id}`,alias:i,copied:e0,onCopy:e1,onSetAlias:t=>tN(e.id,t,tc),onDeleteAlias:()=>tk(i),testStatus:ea[e.id],onTest:y.length>0||tt?()=>tL(e.id):void 0,isTesting:en.has(e.id),isFree:e.isFree,onDisable:()=>tx(e.id),caps:h(`${r}/${e.id}`),isMissing:eX.has(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>ec(!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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t$,disabled:eG,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-green-500/40 px-3 py-2 text-xs text-green-600 dark:text-green-400 transition-colors hover:border-green-500 hover:bg-green-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eG?{animation:"spin 1s linear infinite"}:void 0,children:eG?"progress_activity":"sync"}),eG?(0,u.Tl)("Updating..."):(0,u.Tl)("Update Models")]}),eQ&&(0,a.jsxs)("div",{className:`w-full flex flex-col gap-1.5 p-2.5 rounded-lg text-xs ${"error"===eQ.type?"bg-red-500/10 border border-red-500/30":"bg-green-500/10 border border-green-500/30"}`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-sm ${"error"===eQ.type?"text-red-500":"text-green-500"}`,children:"error"===eQ.type?"error":"check_circle"}),(0,a.jsx)("span",{className:"error"===eQ.type?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400",children:"error"===eQ.type?eQ.message:eQ.message||`${eQ.added} model(s) added`}),(0,a.jsx)("button",{onClick:()=>eZ(null),className:"ml-auto text-text-muted hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),"success"===eQ.type&&eQ.missing?.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Missing:"}),eQ.missing.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-red-500/10 text-red-600 dark:text-red-400 text-[10px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"circle"}),e]},e))]}),"success"===eQ.type&&eQ.newModels?.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"New:"}),eQ.newModels.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 dark:text-green-400 text-[10px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"add_circle"}),e]},e))]})]}),"qoder"===r&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:tA,disabled:eB,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,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eB?{animation:"spin 1s linear infinite"}:void 0,children:eB?"progress_activity":"download"}),eB?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eC.length>0&&(e=new Set([...Object.values(Z),...d.map(e=>e.fullModel)]),t=new Set(ts.map(e=>e.id)),0===(s=eC.filter(s=>!e.has(`${tc}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tC(e.id,"llm",tc)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,a.jsxs)("button",{onClick:()=>tu(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tK,"kiro"===r?(0,a.jsx)(d.Mh,{isOpen:I,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}):"cursor"===r?(0,a.jsx)(d.G9,{isOpen:I,onSuccess:tP,onClose:()=>R(!1)}):"gitlab"===r?(0,a.jsx)(d.vj,{isOpen:I,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}):(0,a.jsx)(d.LF,{isOpen:I,provider:r,providerInfo:e7,onSuccess:tP,onClose:()=>R(!1)}),"iflow"===r&&(0,a.jsx)(d.vE,{isOpen:D,onSuccess:()=>{tb(),U(!1)},onClose:()=>U(!1)}),(0,a.jsx)(A,{isOpen:_,provider:r,providerName:e7.name,isCompatible:tr,isAnthropic:tl,authType:e7?.authType,authHint:e7?.authHint,website:e7?.website,proxyPools:O,error:q,onSave:tE,onBulkDone:tb,onClose:()=>{z(""),M(!1)}}),(0,a.jsx)(d.wI,{isOpen:L,connection:V,proxyPools:O,onSave:tI,onClose:()=>J(!1)}),tr&&(0,a.jsx)($,{isOpen:W,node:k,onSave:tv,onClose:()=>B(!1),isAnthropic:tl}),!tr&&(0,a.jsx)(T,{isOpen:ed,providerAlias:tc,providerDisplayAlias:tm,onSave:async e=>{await tC(e,"llm",tc),ec(!1)},onClose:()=>ec(!1)}),"codex"===r&&(0,a.jsx)(P,{isOpen:F,onClose:()=>K(!1),onSuccess:tb}),(0,a.jsx)(d.uo,{isOpen:eI,onClose:()=>eR(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eR(!1),e9)?e2():e3()},title:"Risk Notice",message:e7?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eP,onClose:()=>eE(null),onConfirm:eP?.onConfirm,title:eP?.title||"Confirm",message:eP?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}P.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func}},96083:(e,t,s)=>{Promise.resolve().then(s.bind(s,78907))}},e=>{e.O(0,[8637,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=96083)),_N_E=e.O()}]);
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prozygent-app",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "Prozygent web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prozygent",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "Prozygent - FREE AI Router & Token Saver. Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models.",
5
5
  "bin": {
6
6
  "prozygent": "./cli.js"