zevairouter 1.1.61 → 1.1.62

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 (851) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  4. package/cli/app/.next-cli-build/build-manifest.json +3 -3
  5. package/cli/app/.next-cli-build/prerender-manifest.json +5 -5
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  64. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  65. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  66. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  67. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  68. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  70. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  71. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  74. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  75. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  77. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  78. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js +2 -2
  79. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  80. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  81. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  82. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  84. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  85. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  87. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  88. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  90. package/cli/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  91. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  92. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  93. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  94. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  95. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  97. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  99. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  100. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  101. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  102. package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  103. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  104. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  105. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  121. package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/changelog/route.js +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  133. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  135. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  139. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  141. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  143. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
  149. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  151. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  155. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +3 -3
  159. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  161. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  163. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  165. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  167. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  169. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  173. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  175. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  177. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  179. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +2 -2
  181. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js.nft.json +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  183. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  185. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +3 -3
  187. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/context/route.js +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/context/test/route.js +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/context/test/route.js.nft.json +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/health/route.js +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +2 -2
  247. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +2 -2
  253. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/metrics/route.js +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  271. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  296. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js +1 -1
  305. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  306. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js +1 -1
  307. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  308. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  309. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  310. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js +1 -1
  311. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  312. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js +1 -1
  313. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  314. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  315. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  316. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js +1 -1
  317. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  318. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js +1 -1
  319. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  320. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  321. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  322. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  323. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  324. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  325. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  326. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  327. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  328. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  329. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  330. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js +1 -1
  331. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  332. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  333. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  334. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js +1 -1
  335. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  336. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js +1 -1
  337. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  338. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  339. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  340. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js +1 -1
  341. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
  342. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/json-import/route.js +1 -1
  343. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/json-import/route.js.nft.json +1 -1
  344. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  345. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  346. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  347. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  348. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  349. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  350. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js +1 -1
  351. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  352. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  353. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  354. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js +1 -1
  355. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  356. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js +1 -1
  357. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  358. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js +1 -1
  359. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  360. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  361. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  362. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  363. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  364. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  365. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  366. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  367. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  368. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js +1 -1
  369. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  370. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  371. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  372. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js +1 -1
  373. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  374. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js +1 -1
  375. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  376. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js +1 -1
  377. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  378. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  379. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  380. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  381. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  382. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
  383. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  384. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
  385. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  386. package/cli/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  387. package/cli/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  388. package/cli/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  389. package/cli/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  390. package/cli/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  391. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  392. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  393. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  394. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  395. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  396. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  397. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  398. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  399. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  400. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  401. package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  402. package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  403. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  404. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  405. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  406. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  407. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  408. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  409. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
  410. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  411. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  412. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  413. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js +1 -1
  414. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js.nft.json +1 -1
  415. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js +1 -1
  416. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js.nft.json +1 -1
  417. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js +1 -1
  418. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js.nft.json +1 -1
  419. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js +1 -1
  420. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js.nft.json +1 -1
  421. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js +1 -1
  422. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js.nft.json +1 -1
  423. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/[jobId]/route.js +1 -1
  424. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/[jobId]/route.js.nft.json +1 -1
  425. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/route.js +1 -1
  426. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/route.js.nft.json +1 -1
  427. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  428. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  429. package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js +1 -1
  430. package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js.nft.json +1 -1
  431. package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js +1 -1
  432. package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js.nft.json +1 -1
  433. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  434. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js.nft.json +1 -1
  435. package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js +1 -1
  436. package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js.nft.json +1 -1
  437. package/cli/app/.next-cli-build/server/app/api/providers/route.js +2 -2
  438. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  439. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  440. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  441. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  442. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  443. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  444. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  445. package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js +1 -1
  446. package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
  447. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  448. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  449. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  450. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  451. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  452. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  453. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  454. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  455. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  456. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  457. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  458. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  459. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  460. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  461. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  462. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  463. package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  464. package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  465. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  466. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  467. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  468. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  469. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  470. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  471. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  472. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  473. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  474. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  475. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  476. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  477. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  478. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  479. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  480. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  481. package/cli/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  482. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  483. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  484. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  485. package/cli/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  486. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  487. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js +1 -1
  488. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  489. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js +1 -1
  490. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  491. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js +1 -1
  492. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  493. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js +1 -1
  494. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  495. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js +1 -1
  496. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  497. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js +1 -1
  498. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  499. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js +2 -2
  500. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  501. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js +1 -1
  502. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  503. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  504. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  505. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  506. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  507. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  508. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  509. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  510. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  511. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  512. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  513. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  514. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  515. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  516. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  517. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  518. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  519. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  520. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  521. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  522. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  523. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  524. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  525. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  526. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  527. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  528. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  529. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  530. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  531. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  532. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  533. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  534. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  535. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
  536. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  537. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  538. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  539. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  540. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  541. package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  542. package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  543. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  544. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  545. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +2 -2
  546. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js.nft.json +1 -1
  547. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  548. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  549. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  550. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  551. package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js +2 -2
  552. package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js.nft.json +1 -1
  553. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  554. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  555. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  556. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  557. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  558. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  559. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  560. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  561. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  562. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  563. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  564. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  565. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  566. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  567. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  568. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  569. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  570. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  571. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  572. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  573. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  574. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  575. package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  576. package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  577. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  578. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  579. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  580. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  581. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  582. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  583. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  584. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  585. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  586. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  587. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +2 -2
  588. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  589. package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  590. package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  591. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js +1 -1
  592. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js.nft.json +1 -1
  593. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  594. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  595. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  596. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  597. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  598. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  599. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  600. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  601. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +2 -2
  602. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  603. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  604. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  605. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  606. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  607. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  608. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  609. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  610. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  611. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  612. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  613. package/cli/app/.next-cli-build/server/app/callback/page.js +1 -1
  614. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  615. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  616. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  617. package/cli/app/.next-cli-build/server/app/callback.rsc +5 -5
  618. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  619. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  620. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  621. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  622. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  623. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +5 -5
  624. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  625. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  626. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  627. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  628. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
  629. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  630. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  631. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  632. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  633. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
  634. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  635. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  636. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  637. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  638. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
  639. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  640. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  641. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  642. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  643. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +5 -5
  644. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  645. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  646. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  647. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  648. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  649. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  650. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  651. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  652. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  653. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
  654. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  655. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  656. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  657. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  658. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
  659. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  660. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  661. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  662. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +7 -7
  663. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +7 -7
  664. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +7 -7
  665. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  666. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  667. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  668. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
  669. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  670. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  671. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  672. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  673. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
  674. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  675. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  676. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  677. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  678. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
  679. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  680. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  681. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  682. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  683. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +5 -5
  684. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  685. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  686. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  687. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  688. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
  689. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  690. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  691. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  692. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +5 -5
  693. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +5 -5
  694. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +5 -5
  695. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  696. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  697. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  698. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  699. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  700. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  701. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  702. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  703. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
  704. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  705. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  706. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  707. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  708. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
  709. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  710. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  711. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  712. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  713. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
  714. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  715. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  716. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  717. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  718. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
  719. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  720. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  721. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  722. package/cli/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  723. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  724. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  725. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  726. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  727. package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
  728. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  729. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  730. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  731. package/cli/app/.next-cli-build/server/app/landing/page.js +1 -1
  732. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  733. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  734. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  735. package/cli/app/.next-cli-build/server/app/landing.rsc +5 -5
  736. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  737. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  738. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  739. package/cli/app/.next-cli-build/server/app/login/page.js +1 -1
  740. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  741. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  742. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  743. package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
  744. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  745. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  746. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  747. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  748. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  749. package/cli/app/.next-cli-build/server/app/page.js +1 -1
  750. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  751. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  752. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js +2 -2
  753. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js.nft.json +1 -1
  754. package/cli/app/.next-cli-build/server/app/skills/[skill]/SKILL.md/route.js +1 -1
  755. package/cli/app/.next-cli-build/server/app/skills/[skill]/SKILL.md/route.js.nft.json +1 -1
  756. package/cli/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  757. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  758. package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
  759. package/cli/app/.next-cli-build/server/chunks/1809.js +1 -0
  760. package/cli/app/.next-cli-build/server/chunks/2970.js +2 -2
  761. package/cli/app/.next-cli-build/server/chunks/3190.js +1 -1
  762. package/cli/app/.next-cli-build/server/chunks/3711.js +1 -0
  763. package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
  764. package/cli/app/.next-cli-build/server/chunks/5019.js +1 -1
  765. package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
  766. package/cli/app/.next-cli-build/server/chunks/5728.js +1 -1
  767. package/cli/app/.next-cli-build/server/chunks/5905.js +3 -3
  768. package/cli/app/.next-cli-build/server/chunks/{4721.js → 6133.js} +2 -2
  769. package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
  770. package/cli/app/.next-cli-build/server/chunks/7319.js +9 -9
  771. package/cli/app/.next-cli-build/server/chunks/7726.js +1 -1
  772. package/cli/app/.next-cli-build/server/chunks/7793.js +1 -1
  773. package/cli/app/.next-cli-build/server/chunks/8238.js +1 -1
  774. package/cli/app/.next-cli-build/server/chunks/8852.js +1 -0
  775. package/cli/app/.next-cli-build/server/chunks/8895.js +4 -4
  776. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  777. package/cli/app/.next-cli-build/server/middleware.js +10 -10
  778. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  779. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  780. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  781. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  782. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  783. package/cli/app/.next-cli-build/static/chunks/{620-6bc0743e08675b16.js → 620-8b24dc33f653e657.js} +1 -1
  784. package/cli/app/.next-cli-build/static/chunks/6202-e364f4d5fefadd3f.js +3 -0
  785. package/cli/app/.next-cli-build/static/chunks/{9126-449f231ec89e0c8b.js → 9041-70659da305d33949.js} +1 -1
  786. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/automation/{page-71a382ed81559482.js → page-bd1157fec388ec95.js} +1 -1
  787. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-59b4e1d04b034922.js +1 -0
  788. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-25b44f613f1ad6ab.js +1 -0
  789. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-2b90c3377dc1b803.js +1 -0
  790. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-b73e02cc2f278a1c.js +1 -0
  791. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-4d578c66f4f83c4b.js +1 -0
  792. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/context/{page-b80f4b05920eb3eb.js → page-e0feb2dcf297b1d3.js} +1 -1
  793. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-14ff4e34b3569e7d.js +1 -0
  794. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-f6d7c9ab2bbcaa0c.js → page-6822935d3352c990.js} +2 -2
  795. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-83103184cbba481f.js → page-6ebcd05a89f2c192.js} +1 -1
  796. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-739bdc9961949f1b.js → page-a4cb0e8fb5edb847.js} +1 -1
  797. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-ce6dece0a314f25b.js +1 -0
  798. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-291c6ac2c795f8c8.js → page-f2473ffe65aa2418.js} +1 -1
  799. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-fc2385100618cb11.js +1 -0
  800. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-8345390557a29481.js +1 -0
  801. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-52350091b31c2ec1.js +1 -0
  802. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-7f6579c9e603c1c7.js → page-d9769ad72eaab7ff.js} +2 -2
  803. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-40562bf4cd105f0a.js → page-663d97e32ff4abb9.js} +1 -1
  804. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-542de72fb45553c1.js → page-9eddc754a0ed05c4.js} +1 -1
  805. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-6a803728f5920906.js → page-834c9924ad1adfea.js} +2 -2
  806. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-27b424c2fe11112c.js → page-3e98755c0114d653.js} +1 -1
  807. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-29126aa56241d330.js +1 -0
  808. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-3ed909159e70307f.js → page-aedd94cfeaef7612.js} +1 -1
  809. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-d401da171aaa05ac.js +1 -0
  810. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/terminal/{page-99f08859cae41572.js → page-f20641b18fe31018.js} +1 -1
  811. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-c70ac5f25262fb6f.js +1 -0
  812. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-a855862272bd37db.js +1 -0
  813. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-a205615e648f47a1.js → page-7ed7a9155f0550b3.js} +1 -1
  814. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-baca0356b5cacc31.js → layout-4cc7b6fd22e7992c.js} +1 -1
  815. package/cli/app/.next-cli-build/static/chunks/app/_not-found/page-2b9bf697de64adcf.js +1 -0
  816. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-de0023d65aebf11f.js +1 -0
  817. package/cli/app/.next-cli-build/static/chunks/app/callback/{page-b1ca389e20348cce.js → page-ba0d852b637994d3.js} +1 -1
  818. package/cli/app/.next-cli-build/static/chunks/app/landing/{page-4e2e956db07b7959.js → page-0a01ecaa2116b10b.js} +1 -1
  819. package/cli/app/.next-cli-build/static/chunks/app/layout-8a7a8baa77f1b488.js +1 -0
  820. package/cli/app/.next-cli-build/static/chunks/app/login/page-dda88ecbdba79a80.js +1 -0
  821. package/cli/app/.next-cli-build/static/chunks/{main-app-88e09177034d71e7.js → main-app-e20479f3b5d674b0.js} +1 -1
  822. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-db43f3befc51b654.js +1 -0
  823. package/cli/app/CHANGELOG.md +7 -0
  824. package/cli/app/package.json +1 -1
  825. package/cli/package.json +1 -1
  826. package/package.json +1 -1
  827. package/cli/app/.next-cli-build/server/chunks/1384.js +0 -1
  828. package/cli/app/.next-cli-build/server/chunks/4039.js +0 -1
  829. package/cli/app/.next-cli-build/server/chunks/5469.js +0 -1
  830. package/cli/app/.next-cli-build/static/chunks/523-3899a7f5cde3f3e8.js +0 -3
  831. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-f7c8c91f9fb6de93.js +0 -1
  832. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-f5fc4b8a8801e804.js +0 -1
  833. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-bccb233dc48b2cf1.js +0 -1
  834. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a2bfbf57ba4e0369.js +0 -1
  835. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-58c9f8c35b7eaed8.js +0 -1
  836. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-a1e30adbdbf2cafd.js +0 -1
  837. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-39062565f11d2c60.js +0 -1
  838. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-92cf3c5c13a0ea25.js +0 -1
  839. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-27ec8458a4c8bcb2.js +0 -1
  840. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-e629adca114de10a.js +0 -1
  841. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a0e271ee32723312.js +0 -1
  842. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-608c603e6ece959c.js +0 -1
  843. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-b523fbffb64dcdae.js +0 -1
  844. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-511564f8398ceb23.js +0 -1
  845. package/cli/app/.next-cli-build/static/chunks/app/_not-found/page-499de2bdd91e139f.js +0 -1
  846. package/cli/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-847859b983aaa314.js +0 -1
  847. package/cli/app/.next-cli-build/static/chunks/app/layout-f31fedc5a6f6c6a1.js +0 -1
  848. package/cli/app/.next-cli-build/static/chunks/app/login/page-764e655e11326b92.js +0 -1
  849. package/cli/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-06f8cd887d9b83e5.js +0 -1
  850. /package/cli/app/.next-cli-build/static/{Vn1udaE2xDihgrgbIZTef → p5nLDGqmrEZKLp2847bs8}/_buildManifest.js +0 -0
  851. /package/cli/app/.next-cli-build/static/{Vn1udaE2xDihgrgbIZTef → p5nLDGqmrEZKLp2847bs8}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{28915:(e,t,s)=>{"use strict";s.d(t,{x6:()=>a.fetchJson,E2:()=>r,gs:()=>i});var a=s(68211);function r(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function i(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}},42911:(e,t,s)=>{Promise.resolve().then(s.bind(s,68612))},68211:(e,t,s)=>{"use strict";s.d(t,{fetchJson:()=>r});let a={"Content-Type":"application/json"};async function r(e,t={}){let{body:s,headers:i,...n}=t,l={...n,headers:{...a,...i}};void 0!==s&&"string"!=typeof s?l.body=JSON.stringify(s):void 0!==s&&(l.body=s);let o=await fetch(e,l),d=await o.text(),c=null;if(d)try{c=JSON.parse(d)}catch{let t=Error(`Non-JSON response from ${e} (HTTP ${o.status})`);throw t.status=o.status,t.rawBody=d.slice(0,300),t}if(!o.ok){let e=c&&(c.error?.message||c.error||c.message)||`Request failed (HTTP ${o.status})`,t=Error("string"==typeof e?e:`HTTP ${o.status}`);throw t.status=o.status,t.data=c,t}return c}r.get=(e,t)=>r(e,{...t,method:"GET"}),r.post=(e,t,s)=>r(e,{...s,method:"POST",body:t}),r.put=(e,t,s)=>r(e,{...s,method:"PUT",body:t}),r.patch=(e,t,s)=>r(e,{...s,method:"PATCH",body:t}),r.del=(e,t)=>r(e,{...t,method:"DELETE"})},68612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eF});var a=s(95155),r=s(12115),i=s(73321),n=s(98500),l=s.n(n),o=s(5772),d=s(35497),c=s(1791);let m=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function u(e){return m.includes(String(e||""))}function x(e){let t=String(e||"").trim();return t&&u(t)?`/dashboard/automation?provider=${encodeURIComponent(t)}`:"/dashboard/automation"}var p=s(28777),h=s(11059),b=s(73006);let f=new Map;async function g(e){if(!e?.url||!e?.type)return[];let t=f.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return f.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var y=s(12252),v=s(70217),j=s(51716);let k=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),w=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),"codebuddy-cn":Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),N=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),"qoder-cn":Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})}),kimi:Object.freeze({oauth:Object.freeze({label:"Kimi Coding OAuth"}),apikey:Object.freeze({label:"Kimi API Key"})}),muse:Object.freeze({oauth:Object.freeze({label:"OAuth"}),apikey:Object.freeze({label:"API Key"})}),"grok-cli":Object.freeze({oauth:Object.freeze({label:"Grok CLI Device Login"})})});function C(e,t){e.includes(t)||e.push(t)}var S=s(65921),$=s(7031),A=s(14051),O=s.n(A);function T({model:e,fullModel:t,alias:s,copied:r,onCopy:i,testStatus:n,isCustom:l,isFree:o,onDeleteAlias:d,onTest:c,isTesting:m,onDisable:u,thinkingSuffix:x}){let p="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0,h=x?`${t}(${x})`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:p?{color:p}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:h}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(h,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),l?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({models:e,modelAliases:t,providerStorageAlias:s,providerDisplayAlias:a}){let r={...t||{}},i=new Set(Object.values(r)),n=[];for(let t of Array.isArray(e)?e:[]){let e=function(e){if(!e)return"";if("string"==typeof e)return e.trim();let t=e.id||e.name||e.model;return"string"==typeof t?t.trim():""}(t);if(!e)continue;let l=`${s}/${e}`;if(i.has(l))continue;let o=function(e,t,s){let a=e.split("/"),r=a[a.length-1];if(!r)return"";if(!t[r])return r;let i=`${s}-${r}`;if(!t[i])return i;let n=2;for(;t[`${i}-${n}`];)n+=1;return`${i}-${n}`}(e,r,a);o&&(n.push({alias:o,model:l,modelId:e}),r[o]=l,i.add(l))}return n}function I({modelId:e,fullModel:t,copied:s,onCopy:r,onDeleteAlias:i,onTest:n,testStatus:l,isTesting:o}){let d="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function z({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:i,onCopy:n,onSetAlias:l,onDeleteAlias:o,onAliasesChanged:c,connections:m,isAnthropic:u}){let[x,p]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(()=>new Set),[j,k]=(0,r.useState)({}),w=async t=>{let s=`${e}/${t}`;v(e=>new Set(e).add(t));try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s})}),t=await e.json();k(e=>({...e,[s]:t.ok?"ok":"error"}))}catch{k(e=>({...e,[s]:"error"}))}finally{v(e=>{let s=new Set(e);return s.delete(t),s})}},N=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),C=async()=>{if(!x.trim()||h)return;let a=x.trim(),[r]=P({models:[{id:a}],modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(!r)return void alert("This model already exists.");b(!0);try{await l(a,r.alias,e),p("")}catch(e){console.log("Error adding model:",e),alert(e?.message||`Failed to add model "${a}".`)}finally{b(!1)}},S=async()=>{if(f)return;let a=m.find(e=>!1!==e.isActive);if(a){g(!0);try{let r=await fetch(`/api/providers/${a.id}/models`),i=await r.json();if(!r.ok)return void alert(i.error||"Failed to import models");let n=i.models||[];if(0===n.length)return void alert("No models returned from /models.");let l=P({models:n,modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(0===l.length)return void alert("No new models were added.");let o=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:l.map(({alias:e,model:t})=>({alias:e,model:t}))})}),d=await o.json();if(!o.ok)throw Error(d.error||"Failed to save imported models.");await c(),alert(`Successfully added ${d.count||l.length} models.`)}catch(e){console.log("Error importing models:",e),alert(e?.message||"Failed to import models from /models.")}finally{g(!1)}}},$=m.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>p(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:C,disabled:!x.trim()||h,children:h?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:S,disabled:!$||f,children:f?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),N.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:N.map(({modelId:s,fullModel:r,alias:l})=>(0,a.jsx)(I,{modelId:s,fullModel:`${t}/${s}`,copied:i,onCopy:n,onDeleteAlias:()=>o(l),onTest:m.length>0?()=>w(s):void 0,testStatus:j[`${e}/${s}`],isTesting:y.has(s)},r))})]})}T.propTypes={model:O().shape({id:O().string.isRequired}).isRequired,fullModel:O().string.isRequired,alias:O().string,copied:O().string,onCopy:O().func.isRequired,testStatus:O().oneOf(["ok","error"]),isCustom:O().bool,isFree:O().bool,onDeleteAlias:O().func,onTest:O().func,isTesting:O().bool,onDisable:O().func,thinkingSuffix:O().string},O().string.isRequired,O().string.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func,O().oneOf(["ok","error"]),O().bool,O().string.isRequired,O().object.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func.isRequired,z.propTypes={providerStorageAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,modelAliases:O().object.isRequired,copied:O().string,onCopy:O().func.isRequired,onSetAlias:O().func.isRequired,onDeleteAlias:O().func.isRequired,onAliasesChanged:O().func.isRequired,connections:O().arrayOf(O().shape({id:O().string,isActive:O().bool})).isRequired,isAnthropic:O().bool};var E=s(47650),R=s(81277);function q({until:e}){let[t,s]=(0,r.useState)("");return((0,r.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime();if(!Number.isFinite(t))return void s("");let a=t-Date.now();if(a<=0)return void s("");let r=Math.floor(a/1e3);if(r<60)s(`${r}s`);else if(r<3600)s(`${Math.floor(r/60)}m ${r%60}s`);else{let e=Math.floor(r/3600),t=Math.floor(r%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}q.propTypes={until:O().string.isRequired};var M=s(22942);function D({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:l,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:u,onDelete:x,autoPingEnabled:p=!1,onToggleAutoPing:h,autoPingScheduled:b=!1,onOpenAutoPingSchedule:f,oneByOneStatus:g=null}){let[y,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),N=(0,r.useRef)(null),[C,S]=(0,r.useState)(!1),$=(0,r.useRef)(null),A=(0,r.useMemo)(()=>new Map((t||[]).map(e=>[e.id,e])),[t]),O=(0,r.useMemo)(()=>t||[],[t]),T=e.providerSpecificData?.proxyPoolId||null,P=T?A.get(T):null,I=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,z=!!T||I,_=P?`Pool: ${P.name}`:T?`Pool: ${T} (inactive/missing)`:I?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",U="";if(P?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=P?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=t}}let L=P?.noProxy||e.providerSpecificData?.connectionNoProxy||"",K="default";P?.isActive===!0?K="success":(T||I)&&(K="error"),(0,r.useEffect)(()=>{if(!y)return;let e=e=>{$.current?.contains(e.target)||N.current?.contains(e.target)||j(!1)},t=()=>j(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[y]);let F=async e=>{S(!0);try{await m("__none__"===e?null:e)}finally{S(!1),j(!1)}},B=e.authType||(s?"oauth":"apikey"),J="oauth"===B,H="cookie"===B,W=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),G=J?W(e.email)?e.email:W(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||"API Key",V=(0,R.c)(e),Q=null!==V,Z="unavailable"!==e.testStatus||Q?e.testStatus:"active",X=(0,v.d4)(e),Y=!!e.quarantinedAt,ee={policy_suspended:"Policy suspension",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[e.failureClass]||e.quarantineReason||"Account quarantined",et=Number.isFinite(Date.parse(e.quarantinedAt))?new Date(e.quarantinedAt).toLocaleString():e.quarantinedAt||null,es=e.modelLockReason?.resetsAt,ea=Number.isFinite(Date.parse(es))?new Date(es).toLocaleString():es||null,er=()=>g?"queued"===g.state?"queued":"testing"===g.state?"testing":"success"===g.state?g.error?`connected: ${g.error}`:"success":"failed"===g.state?g.error?`failed: ${g.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive&&!Y?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:l,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:H?"cookie":J?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:G}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(()=>{if(!1===e.isActive)return"default";let t=(0,v.BU)(X);return"active"!==X.key?t:"active"===Z||"success"===Z?"success":"error"===Z||"expired"===Z||"unavailable"===Z?"error":"default"})(),size:"sm",dot:!0,children:X.label||Z||"unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:J?"OAuth":H?"Cookie":"API Key"}),Y&&(0,a.jsx)(d.Ex,{variant:"error",size:"sm",children:"Quarantined"}),z&&(0,a.jsx)(d.Ex,{variant:K,size:"sm",children:"Proxy"}),e.autoDisabledAt&&!Y&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===e.autoDisabledReason?"Token expired":"banned"===e.autoDisabledReason?"Banned":"quota_exhausted"===e.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(e.autoDisabledAt).toLocaleDateString()]}),Y&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${e.quarantineReason||ee}${et?` - ${et}`:""}`,children:[ee,et?` - ${et}`:""]}),Q&&!1!==e.isActive&&(0,a.jsx)(q,{until:V}),Q&&e.modelLockReason&&!1!==e.isActive&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${e.modelLockReason.reason}${ea?` — resets ${ea}`:""}`,children:[e.modelLockReason.model,e.modelLockReason.providerErrorCode?` (${e.modelLockReason.providerErrorCode})`:"",ea?` — resets ${ea}`:""]}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),er()&&(0,a.jsx)(d.Ex,{variant:g?"success"===g.state?"success":"failed"===g.state?"error":"testing"===g.state?"primary":"default":"default",size:"sm",children:er()})]}),z&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:_,children:_}),U&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:U}),L&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:L,children:["no_proxy: ",L]})]}),Y&&!1===e.isActive&&(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[O.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{ref:N,type:"button",onClick:()=>{if(y)return void j(!1);let e=N.current?.getBoundingClientRect();e&&w((0,M.x)(e,O.length,{width:window.innerWidth,height:window.innerHeight})),j(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${z?"text-primary":"text-text-muted hover:text-primary"}`,disabled:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:C?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),y&&"u">typeof document&&(0,E.createPortal)((0,a.jsxs)("div",{ref:$,style:k,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>F("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!T?"text-primary font-medium":"text-text-main"}`,children:"None"}),O.map(e=>(0,a.jsx)("button",{onClick:()=>F(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${T===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),h&&(0,a.jsxs)("button",{onClick:()=>h(!p),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p?"text-primary":"text-text-muted hover:text-primary"}`,title:p?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),f&&(0,a.jsxs)("button",{type:"button",onClick:f,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${b?"text-primary":"text-text-muted hover:text-primary"}`,title:"Ping at fixed local times",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"schedule"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Schedule"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":Y?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}D.propTypes={connection:O().shape({id:O().string,name:O().string,email:O().string,displayName:O().string,modelLockUntil:O().string,testStatus:O().string,isActive:O().bool,lastError:O().string,failureClass:O().string,quarantinedAt:O().string,quarantineReason:O().string,priority:O().number,globalPriority:O().number}).isRequired,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string,proxyUrl:O().string,noProxy:O().string,isActive:O().bool})),isOAuth:O().bool.isRequired,isFirst:O().bool.isRequired,isLast:O().bool.isRequired,onMoveUp:O().func.isRequired,onMoveDown:O().func.isRequired,onToggleActive:O().func.isRequired,onUpdateProxy:O().func,autoPingEnabled:O().bool,onToggleAutoPing:O().func,autoPingScheduled:O().bool,onOpenAutoPingSchedule:O().func,onEdit:O().func.isRequired,onDelete:O().func.isRequired,oneByOneStatus:O().shape({state:O().string,error:O().string})};var _=s(31474);function U(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}let L={anchor:"09:30",timezone:U(),windowHours:5,slotsPerDay:3};function K(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function F(e){return Math.max(1,Math.floor(24/e))}function B(e,t,s,a){let r="number"==typeof e?e:Number(e);return Number.isFinite(r)?Math.min(a,Math.max(s,r)):t}let J=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function H({isOpen:e,onClose:t,onSave:s,connection:i,reactive:n=!1,schedule:l=null}){let[o,c]=(0,r.useState)(()=>({mode:l?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:l?.anchor||L.anchor,timezone:U(),windowHours:String(l?.windowHours??L.windowHours),slotsPerDay:String(l?.slotsPerDay??L.slotsPerDay)})),m=Number(o.windowHours),u=Number(o.slotsPerDay),x=!!K(o.anchor),p=Number.isFinite(m)&&m>=.5&&m<=24,h=p?F(m):24,b=Number.isInteger(u)&&u>=1&&u<=h,f="schedule"!==o.mode||x&&p&&b,g=x&&p&&b?function(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=K(e.anchor)||K(L.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?L.timezone:e.timezone,r=B(e.windowHours,L.windowHours,.5,24),i=Math.round(B(e.slotsPerDay,L.slotsPerDay,1,F(r)));return{enabled:!0,anchor:s,timezone:a,windowHours:r,slotsPerDay:i}}(e);if(!t)return[];let{hour:s,minute:a}=K(t.anchor),r=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(r+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}({enabled:!0,...o,windowHours:m,slotsPerDay:u}):[],y=g.length?(()=>{let{hour:e,minute:t}=K(o.anchor),s=Math.round(60*e+t+u*m*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"";return(0,a.jsx)(d.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:()=>{f&&(s({reactive:"reset"===o.mode,schedule:"schedule"===o.mode?{enabled:!0,anchor:o.anchor,timezone:o.timezone,windowHours:m,slotsPerDay:u}:{enabled:!1}}),t())},disabled:!f,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Warm the 5-hour window",i?.name?` for ${i.name}`:"",". Pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-black/[0.03] p-1 dark:bg-white/[0.03]",children:J.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>c(t=>({...t,mode:e.value})),className:(0,_.cn)("flex h-9 items-center justify-center gap-1.5 rounded-md text-sm font-medium",o.mode===e.value?"bg-surface text-text-main":"text-text-muted"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:e.icon}),e.label]},e.value))}),"reset"===o.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings once after the window resets."}),"schedule"===o.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(d.pd,{label:"Anchor time",type:"time",value:o.anchor,onChange:e=>c(t=>({...t,anchor:e.target.value})),error:x?"":"Use HH:MM"}),(0,a.jsx)(d.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:o.windowHours,onChange:e=>c(t=>({...t,windowHours:e.target.value})),error:p?"":"0.5 – 24"}),(0,a.jsx)(d.pd,{label:"Pings per day",type:"number",min:"1",max:String(h),step:"1",value:o.slotsPerDay,onChange:e=>c(t=>({...t,slotsPerDay:e.target.value})),error:b?"":`1 – ${h}`})]}),g.length>0&&(0,a.jsxs)("p",{className:"text-sm text-text-main",children:[g.join(" → ")," (",o.timezone,"). Covers until ",y,"."]})]})]})})}H.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSave:O().func.isRequired,connection:O().object,reactive:O().bool,schedule:O().object};var W=s(28915);let G=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{28915:(e,t,s)=>{"use strict";s.d(t,{x6:()=>a.fetchJson,E2:()=>r,gs:()=>i});var a=s(68211);function r(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function i(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}},68211:(e,t,s)=>{"use strict";s.d(t,{fetchJson:()=>r});let a={"Content-Type":"application/json"};async function r(e,t={}){let{body:s,headers:i,...n}=t,l={...n,headers:{...a,...i}};void 0!==s&&"string"!=typeof s?l.body=JSON.stringify(s):void 0!==s&&(l.body=s);let o=await fetch(e,l),d=await o.text(),c=null;if(d)try{c=JSON.parse(d)}catch{let t=Error(`Non-JSON response from ${e} (HTTP ${o.status})`);throw t.status=o.status,t.rawBody=d.slice(0,300),t}if(!o.ok){let e=c&&(c.error?.message||c.error||c.message)||`Request failed (HTTP ${o.status})`,t=Error("string"==typeof e?e:`HTTP ${o.status}`);throw t.status=o.status,t.data=c,t}return c}r.get=(e,t)=>r(e,{...t,method:"GET"}),r.post=(e,t,s)=>r(e,{...s,method:"POST",body:t}),r.put=(e,t,s)=>r(e,{...s,method:"PUT",body:t}),r.patch=(e,t,s)=>r(e,{...s,method:"PATCH",body:t}),r.del=(e,t)=>r(e,{...t,method:"DELETE"})},68612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eF});var a=s(95155),r=s(12115),i=s(73321),n=s(98500),l=s.n(n),o=s(5772),d=s(35497),c=s(1791);let m=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function u(e){return m.includes(String(e||""))}function x(e){let t=String(e||"").trim();return t&&u(t)?`/dashboard/automation?provider=${encodeURIComponent(t)}`:"/dashboard/automation"}var p=s(28777),h=s(11059),b=s(73006);let f=new Map;async function g(e){if(!e?.url||!e?.type)return[];let t=f.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return f.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var y=s(12252),v=s(70217),j=s(51716);let k=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),w=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),"codebuddy-cn":Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),N=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),"qoder-cn":Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})}),kimi:Object.freeze({oauth:Object.freeze({label:"Kimi Coding OAuth"}),apikey:Object.freeze({label:"Kimi API Key"})}),muse:Object.freeze({oauth:Object.freeze({label:"OAuth"}),apikey:Object.freeze({label:"API Key"})}),"grok-cli":Object.freeze({oauth:Object.freeze({label:"Grok CLI Device Login"})})});function C(e,t){e.includes(t)||e.push(t)}var S=s(65921),$=s(7031),A=s(14051),O=s.n(A);function T({model:e,fullModel:t,alias:s,copied:r,onCopy:i,testStatus:n,isCustom:l,isFree:o,onDeleteAlias:d,onTest:c,isTesting:m,onDisable:u,thinkingSuffix:x}){let p="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0,h=x?`${t}(${x})`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:p?{color:p}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:h}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(h,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),l?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({models:e,modelAliases:t,providerStorageAlias:s,providerDisplayAlias:a}){let r={...t||{}},i=new Set(Object.values(r)),n=[];for(let t of Array.isArray(e)?e:[]){let e=function(e){if(!e)return"";if("string"==typeof e)return e.trim();let t=e.id||e.name||e.model;return"string"==typeof t?t.trim():""}(t);if(!e)continue;let l=`${s}/${e}`;if(i.has(l))continue;let o=function(e,t,s){let a=e.split("/"),r=a[a.length-1];if(!r)return"";if(!t[r])return r;let i=`${s}-${r}`;if(!t[i])return i;let n=2;for(;t[`${i}-${n}`];)n+=1;return`${i}-${n}`}(e,r,a);o&&(n.push({alias:o,model:l,modelId:e}),r[o]=l,i.add(l))}return n}function I({modelId:e,fullModel:t,copied:s,onCopy:r,onDeleteAlias:i,onTest:n,testStatus:l,isTesting:o}){let d="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function z({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:i,onCopy:n,onSetAlias:l,onDeleteAlias:o,onAliasesChanged:c,connections:m,isAnthropic:u}){let[x,p]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(()=>new Set),[j,k]=(0,r.useState)({}),w=async t=>{let s=`${e}/${t}`;v(e=>new Set(e).add(t));try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s})}),t=await e.json();k(e=>({...e,[s]:t.ok?"ok":"error"}))}catch{k(e=>({...e,[s]:"error"}))}finally{v(e=>{let s=new Set(e);return s.delete(t),s})}},N=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),C=async()=>{if(!x.trim()||h)return;let a=x.trim(),[r]=P({models:[{id:a}],modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(!r)return void alert("This model already exists.");b(!0);try{await l(a,r.alias,e),p("")}catch(e){console.log("Error adding model:",e),alert(e?.message||`Failed to add model "${a}".`)}finally{b(!1)}},S=async()=>{if(f)return;let a=m.find(e=>!1!==e.isActive);if(a){g(!0);try{let r=await fetch(`/api/providers/${a.id}/models`),i=await r.json();if(!r.ok)return void alert(i.error||"Failed to import models");let n=i.models||[];if(0===n.length)return void alert("No models returned from /models.");let l=P({models:n,modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(0===l.length)return void alert("No new models were added.");let o=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:l.map(({alias:e,model:t})=>({alias:e,model:t}))})}),d=await o.json();if(!o.ok)throw Error(d.error||"Failed to save imported models.");await c(),alert(`Successfully added ${d.count||l.length} models.`)}catch(e){console.log("Error importing models:",e),alert(e?.message||"Failed to import models from /models.")}finally{g(!1)}}},$=m.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>p(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:C,disabled:!x.trim()||h,children:h?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:S,disabled:!$||f,children:f?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),N.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:N.map(({modelId:s,fullModel:r,alias:l})=>(0,a.jsx)(I,{modelId:s,fullModel:`${t}/${s}`,copied:i,onCopy:n,onDeleteAlias:()=>o(l),onTest:m.length>0?()=>w(s):void 0,testStatus:j[`${e}/${s}`],isTesting:y.has(s)},r))})]})}T.propTypes={model:O().shape({id:O().string.isRequired}).isRequired,fullModel:O().string.isRequired,alias:O().string,copied:O().string,onCopy:O().func.isRequired,testStatus:O().oneOf(["ok","error"]),isCustom:O().bool,isFree:O().bool,onDeleteAlias:O().func,onTest:O().func,isTesting:O().bool,onDisable:O().func,thinkingSuffix:O().string},O().string.isRequired,O().string.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func,O().oneOf(["ok","error"]),O().bool,O().string.isRequired,O().object.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func.isRequired,z.propTypes={providerStorageAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,modelAliases:O().object.isRequired,copied:O().string,onCopy:O().func.isRequired,onSetAlias:O().func.isRequired,onDeleteAlias:O().func.isRequired,onAliasesChanged:O().func.isRequired,connections:O().arrayOf(O().shape({id:O().string,isActive:O().bool})).isRequired,isAnthropic:O().bool};var E=s(47650),R=s(81277);function q({until:e}){let[t,s]=(0,r.useState)("");return((0,r.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime();if(!Number.isFinite(t))return void s("");let a=t-Date.now();if(a<=0)return void s("");let r=Math.floor(a/1e3);if(r<60)s(`${r}s`);else if(r<3600)s(`${Math.floor(r/60)}m ${r%60}s`);else{let e=Math.floor(r/3600),t=Math.floor(r%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}q.propTypes={until:O().string.isRequired};var M=s(22942);function D({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:l,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:u,onDelete:x,autoPingEnabled:p=!1,onToggleAutoPing:h,autoPingScheduled:b=!1,onOpenAutoPingSchedule:f,oneByOneStatus:g=null}){let[y,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),N=(0,r.useRef)(null),[C,S]=(0,r.useState)(!1),$=(0,r.useRef)(null),A=(0,r.useMemo)(()=>new Map((t||[]).map(e=>[e.id,e])),[t]),O=(0,r.useMemo)(()=>t||[],[t]),T=e.providerSpecificData?.proxyPoolId||null,P=T?A.get(T):null,I=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,z=!!T||I,_=P?`Pool: ${P.name}`:T?`Pool: ${T} (inactive/missing)`:I?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",U="";if(P?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=P?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=t}}let L=P?.noProxy||e.providerSpecificData?.connectionNoProxy||"",K="default";P?.isActive===!0?K="success":(T||I)&&(K="error"),(0,r.useEffect)(()=>{if(!y)return;let e=e=>{$.current?.contains(e.target)||N.current?.contains(e.target)||j(!1)},t=()=>j(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[y]);let F=async e=>{S(!0);try{await m("__none__"===e?null:e)}finally{S(!1),j(!1)}},B=e.authType||(s?"oauth":"apikey"),J="oauth"===B,H="cookie"===B,W=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),G=J?W(e.email)?e.email:W(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||"API Key",V=(0,R.c)(e),Q=null!==V,Z="unavailable"!==e.testStatus||Q?e.testStatus:"active",X=(0,v.d4)(e),Y=!!e.quarantinedAt,ee={policy_suspended:"Policy suspension",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[e.failureClass]||e.quarantineReason||"Account quarantined",et=Number.isFinite(Date.parse(e.quarantinedAt))?new Date(e.quarantinedAt).toLocaleString():e.quarantinedAt||null,es=e.modelLockReason?.resetsAt,ea=Number.isFinite(Date.parse(es))?new Date(es).toLocaleString():es||null,er=()=>g?"queued"===g.state?"queued":"testing"===g.state?"testing":"success"===g.state?g.error?`connected: ${g.error}`:"success":"failed"===g.state?g.error?`failed: ${g.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive&&!Y?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:l,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:H?"cookie":J?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:G}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(()=>{if(!1===e.isActive)return"default";let t=(0,v.BU)(X);return"active"!==X.key?t:"active"===Z||"success"===Z?"success":"error"===Z||"expired"===Z||"unavailable"===Z?"error":"default"})(),size:"sm",dot:!0,children:X.label||Z||"unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:J?"OAuth":H?"Cookie":"API Key"}),Y&&(0,a.jsx)(d.Ex,{variant:"error",size:"sm",children:"Quarantined"}),z&&(0,a.jsx)(d.Ex,{variant:K,size:"sm",children:"Proxy"}),e.autoDisabledAt&&!Y&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===e.autoDisabledReason?"Token expired":"banned"===e.autoDisabledReason?"Banned":"quota_exhausted"===e.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(e.autoDisabledAt).toLocaleDateString()]}),Y&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${e.quarantineReason||ee}${et?` - ${et}`:""}`,children:[ee,et?` - ${et}`:""]}),Q&&!1!==e.isActive&&(0,a.jsx)(q,{until:V}),Q&&e.modelLockReason&&!1!==e.isActive&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${e.modelLockReason.reason}${ea?` — resets ${ea}`:""}`,children:[e.modelLockReason.model,e.modelLockReason.providerErrorCode?` (${e.modelLockReason.providerErrorCode})`:"",ea?` — resets ${ea}`:""]}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),er()&&(0,a.jsx)(d.Ex,{variant:g?"success"===g.state?"success":"failed"===g.state?"error":"testing"===g.state?"primary":"default":"default",size:"sm",children:er()})]}),z&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:_,children:_}),U&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:U}),L&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:L,children:["no_proxy: ",L]})]}),Y&&!1===e.isActive&&(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[O.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{ref:N,type:"button",onClick:()=>{if(y)return void j(!1);let e=N.current?.getBoundingClientRect();e&&w((0,M.x)(e,O.length,{width:window.innerWidth,height:window.innerHeight})),j(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${z?"text-primary":"text-text-muted hover:text-primary"}`,disabled:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:C?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),y&&"u">typeof document&&(0,E.createPortal)((0,a.jsxs)("div",{ref:$,style:k,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>F("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!T?"text-primary font-medium":"text-text-main"}`,children:"None"}),O.map(e=>(0,a.jsx)("button",{onClick:()=>F(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${T===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),h&&(0,a.jsxs)("button",{onClick:()=>h(!p),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p?"text-primary":"text-text-muted hover:text-primary"}`,title:p?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),f&&(0,a.jsxs)("button",{type:"button",onClick:f,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${b?"text-primary":"text-text-muted hover:text-primary"}`,title:"Ping at fixed local times",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"schedule"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Schedule"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":Y?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}D.propTypes={connection:O().shape({id:O().string,name:O().string,email:O().string,displayName:O().string,modelLockUntil:O().string,testStatus:O().string,isActive:O().bool,lastError:O().string,failureClass:O().string,quarantinedAt:O().string,quarantineReason:O().string,priority:O().number,globalPriority:O().number}).isRequired,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string,proxyUrl:O().string,noProxy:O().string,isActive:O().bool})),isOAuth:O().bool.isRequired,isFirst:O().bool.isRequired,isLast:O().bool.isRequired,onMoveUp:O().func.isRequired,onMoveDown:O().func.isRequired,onToggleActive:O().func.isRequired,onUpdateProxy:O().func,autoPingEnabled:O().bool,onToggleAutoPing:O().func,autoPingScheduled:O().bool,onOpenAutoPingSchedule:O().func,onEdit:O().func.isRequired,onDelete:O().func.isRequired,oneByOneStatus:O().shape({state:O().string,error:O().string})};var _=s(31474);function U(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}let L={anchor:"09:30",timezone:U(),windowHours:5,slotsPerDay:3};function K(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function F(e){return Math.max(1,Math.floor(24/e))}function B(e,t,s,a){let r="number"==typeof e?e:Number(e);return Number.isFinite(r)?Math.min(a,Math.max(s,r)):t}let J=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function H({isOpen:e,onClose:t,onSave:s,connection:i,reactive:n=!1,schedule:l=null}){let[o,c]=(0,r.useState)(()=>({mode:l?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:l?.anchor||L.anchor,timezone:U(),windowHours:String(l?.windowHours??L.windowHours),slotsPerDay:String(l?.slotsPerDay??L.slotsPerDay)})),m=Number(o.windowHours),u=Number(o.slotsPerDay),x=!!K(o.anchor),p=Number.isFinite(m)&&m>=.5&&m<=24,h=p?F(m):24,b=Number.isInteger(u)&&u>=1&&u<=h,f="schedule"!==o.mode||x&&p&&b,g=x&&p&&b?function(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=K(e.anchor)||K(L.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?L.timezone:e.timezone,r=B(e.windowHours,L.windowHours,.5,24),i=Math.round(B(e.slotsPerDay,L.slotsPerDay,1,F(r)));return{enabled:!0,anchor:s,timezone:a,windowHours:r,slotsPerDay:i}}(e);if(!t)return[];let{hour:s,minute:a}=K(t.anchor),r=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(r+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}({enabled:!0,...o,windowHours:m,slotsPerDay:u}):[],y=g.length?(()=>{let{hour:e,minute:t}=K(o.anchor),s=Math.round(60*e+t+u*m*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"";return(0,a.jsx)(d.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:()=>{f&&(s({reactive:"reset"===o.mode,schedule:"schedule"===o.mode?{enabled:!0,anchor:o.anchor,timezone:o.timezone,windowHours:m,slotsPerDay:u}:{enabled:!1}}),t())},disabled:!f,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Warm the 5-hour window",i?.name?` for ${i.name}`:"",". Pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-black/[0.03] p-1 dark:bg-white/[0.03]",children:J.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>c(t=>({...t,mode:e.value})),className:(0,_.cn)("flex h-9 items-center justify-center gap-1.5 rounded-md text-sm font-medium",o.mode===e.value?"bg-surface text-text-main":"text-text-muted"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:e.icon}),e.label]},e.value))}),"reset"===o.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings once after the window resets."}),"schedule"===o.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(d.pd,{label:"Anchor time",type:"time",value:o.anchor,onChange:e=>c(t=>({...t,anchor:e.target.value})),error:x?"":"Use HH:MM"}),(0,a.jsx)(d.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:o.windowHours,onChange:e=>c(t=>({...t,windowHours:e.target.value})),error:p?"":"0.5 – 24"}),(0,a.jsx)(d.pd,{label:"Pings per day",type:"number",min:"1",max:String(h),step:"1",value:o.slotsPerDay,onChange:e=>c(t=>({...t,slotsPerDay:e.target.value})),error:b?"":`1 – ${h}`})]}),g.length>0&&(0,a.jsxs)("p",{className:"text-sm text-text-main",children:[g.join(" → ")," (",o.timezone,"). Covers until ",y,"."]})]})]})})}H.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSave:O().func.isRequired,connection:O().object,reactive:O().bool,schedule:O().object};var W=s(28915);let G=`name1|sk-key1
2
2
  name2|sk-key2
3
3
  sk-key-only-auto-named`;function V({isOpen:e,provider:t,providerName:s,isCompatible:i,isAnthropic:n,authType:l,authHint:o,website:m,proxyPools:u,existingNames:x=[],error:p,onSave:h,onBulkDone:b,onClose:f}){let g="__none__",y="ollama-local"===t,v="flow"===t,j="cookie"===l,k="xai"===t&&!j,w="aws-polly"===t,N="qoder"===t||"qoder-cn"===t,C="bedrock"===t||"bedrock-xai"===t,S=w||C?"Secret Access Key":v?"Daemon token":j?"Cookie Value":N?"Personal Access Token (PAT)":"API Key",$=j?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":k?"xai-...":N?"pt-...":"",A="azure"===t,O="cloudflare-ai"===t,T=c.Q2?.[t]?.regions||null,P=c.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[I,z]=(0,r.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:"",flowProfile:"",flowBaseUrl:"http://127.0.0.1:8077/mcp",flowI2vReady:!1}),[E,R]=(0,r.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[q,M]=(0,r.useState)({accountId:""}),[D,_]=(0,r.useState)({accessKeyId:"",region:""}),[U,L]=(0,r.useState)({accessKeyId:"",region:"",sessionToken:""}),[K,F]=(0,r.useState)(P),[B,J]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(null),[Z,X]=(0,r.useState)(!1),[Y,ee]=(0,r.useState)("single"),[et,es]=(0,r.useState)(""),[ea,er]=(0,r.useState)(null),ei=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e&&!ei.current&&(z({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:"",flowProfile:"",flowBaseUrl:"http://127.0.0.1:8077/mcp",flowI2vReady:!1}),R({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),M({accountId:""}),_({accessKeyId:"",region:""}),L({accessKeyId:"",region:"",sessionToken:""}),F(P),Q(null),ee("single"),es(""),er(null)),ei.current=e},[e]);let en=()=>{if(y&&I.ollamaHostUrl.trim())return{baseUrl:I.ollamaHostUrl.trim()};if(v)return{profile:I.flowProfile.trim(),baseUrl:I.flowBaseUrl.trim()||"http://127.0.0.1:8077/mcp",i2vReady:I.flowI2vReady};if(A)return{azureEndpoint:E.azureEndpoint,apiVersion:E.apiVersion,deployment:E.deployment,organization:E.organization};if(O)return{accountId:q.accountId};if(w){let e={accessKeyId:D.accessKeyId.trim()};return D.region.trim()&&(e.region=D.region.trim()),e}if(C){let e={accessKeyId:U.accessKeyId.trim()};return U.region.trim()&&(e.region=U.region.trim()),U.sessionToken.trim()&&(e.sessionToken=U.sessionToken.trim()),e}if(T&&K)return{region:K}},el=async()=>{J(!0);try{let e=await (0,W.x6)("/api/providers/validate",{method:"POST",body:{provider:t,apiKey:I.apiKey,providerSpecificData:en()}});Q(e.valid?"success":"failed")}catch{Q("unknown")}finally{J(!1)}},eo=async()=>{if(t&&(y||I.apiKey)&&(!v||I.flowProfile.trim())&&(y||I.name)&&(!i||I.defaultModel.trim())){X(!0);try{let e=!1;try{J(!0),Q(null),e=!!(await (0,W.x6)("/api/providers/validate",{method:"POST",body:{provider:t,apiKey:I.apiKey,providerSpecificData:en()}})).valid,Q(e?"success":"failed")}catch{Q("unknown")}finally{J(!1)}let s=Number.parseInt(I.priority,10);await h({name:I.name||(y?"Ollama Local":""),apiKey:I.apiKey,defaultModel:i?I.defaultModel.trim():void 0,priority:Number.isFinite(s)?s:1,proxyPoolId:v||I.proxyPoolId===g?null:I.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:en()})}finally{X(!1)}}},ed=async()=>{let e=function(e,t,s={}){let a=new Set((Array.isArray(t)?t:[]).filter(e=>"string"==typeof e).map(e=>e.toLowerCase())),r=[];for(let t of Array.isArray(e)?e:[]){let e="string"==typeof t?t.trim():"";if(!e)continue;let i=function(e,{isCloudflareAi:t=!1}={}){let s=e.split("|");if(t&&s.length>=3){let e=s[0].trim(),t=s[s.length-1].trim(),a=s.slice(1,-1).join("|").trim();return a&&t?{baseName:e||"Key",apiKey:a,providerSpecificData:{accountId:t}}:null}if(s.length>=2){let e=s[0].trim(),t=s.slice(1).join("|").trim();return t?{baseName:e||"Key",apiKey:t}:null}let a=s[0].trim();return a?{baseName:"Key",apiKey:a}:null}(e,s);if(!i)continue;let n=1,l=`${i.baseName} ${n}`;for(;a.has(l.toLowerCase());)n+=1,l=`${i.baseName} ${n}`;a.add(l.toLowerCase()),r.push({name:l,apiKey:i.apiKey,...i.providerSpecificData?{providerSpecificData:i.providerSpecificData}:{}})}return r}(et.split("\n").map(e=>e.trim()).filter(Boolean),x,{isCloudflareAi:O});if(!e.length)return;X(!0),er(null);let s=0,a=0,r=[],i=[];for(let n of e)try{await (0,W.x6)("/api/providers",{method:"POST",body:{provider:t,apiKey:n.apiKey,name:n.name,priority:1,testStatus:"unknown",...n.providerSpecificData?{providerSpecificData:n.providerSpecificData}:{}}}),s++}catch(e){a++,r.push({line:n.name,message:e?.message||"Request failed"}),i.push(n.providerSpecificData?`${n.name.replace(/ \d+$/,"")}|${n.apiKey}|${n.providerSpecificData.accountId}`:`${n.name.replace(/ \d+$/,"")}|${n.apiKey}`)}X(!1),er({success:s,failed:a,failedRows:r}),es(i.join("\n")),s>0&&b&&b()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:v?"Add Google Flow Account":`Add ${s||t} ${S}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[!v&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===Y?"primary":"ghost",onClick:()=>{ee("single"),er(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===Y?"primary":"ghost",onClick:()=>{ee("bulk"),er(null)},children:"Bulk Add"})]}),"bulk"===Y&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"}),". A name that is already used gets the next free number, so an earlier key is not replaced.",O?" Cloudflare also accepts name|apiKey|accountId.":""]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:G,value:et,onChange:e=>es(e.target.value)}),ea&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${ea.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",ea.success," added",ea.failed>0?`, ✗ ${ea.failed} failed`:""]}),ea.failedRows?.length>0&&(0,a.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:ea.failedRows.map((e,t)=>(0,a.jsxs)("li",{className:"break-words",children:[(0,a.jsx)("span",{className:"font-mono",children:e.line.length>40?`${e.line.slice(0,40)}…`:e.line}),` — ${e.message}`]},t))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:ed,fullWidth:!0,disabled:Z||!et.trim(),children:Z?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===Y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:v?"Account name":"Name",value:I.name,onChange:e=>z({...I,name:e.target.value}),placeholder:v?"Google account email":y?"Ollama Local":"Production Key"}),v&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20 flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"gflow profile",value:I.flowProfile,onChange:e=>z({...I,flowProfile:e.target.value}),placeholder:"from: gflow auth list",hint:"One connection maps to one Google Flow browser profile.",required:!0}),(0,a.jsx)(d.pd,{label:"Daemon URL",value:I.flowBaseUrl,onChange:e=>z({...I,flowBaseUrl:e.target.value}),placeholder:"http://127.0.0.1:8077/mcp"}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-main",children:[(0,a.jsx)("input",{type:"checkbox",checked:I.flowI2vReady,onChange:e=>z({...I,flowI2vReady:e.target.checked}),className:"mt-1"}),(0,a.jsxs)("span",{children:["I2V upload consent confirmed ",(0,a.jsx)("span",{className:"block text-xs text-text-muted",children:"Enable only after uploading an image you own once on flow.google.com and accepting Google's rights dialog. Required for 20–60s videos."})]})]})]}),y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:I.ollamaHostUrl,onChange:e=>z({...I,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:el,disabled:B||Z,variant:"secondary",children:B?"Checking...":"Check"})})]}),!y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:S,type:j?"text":"password",value:I.apiKey,onChange:e=>z({...I,apiKey:e.target.value}),placeholder:v?"GFLOW_DAEMON_TOKEN":$,hint:v?"Must match the token used by `gflow serve`.":void 0,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:el,disabled:!I.apiKey||v&&!I.flowProfile.trim()||B||Z,variant:"secondary",children:B?"Checking...":"Check"})})]}),k&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),j&&o&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),T&&(0,a.jsx)(d.l6,{label:"Region",value:K,onChange:e=>F(e.target.value),options:T.map(e=>({value:e.id,label:e.label}))}),i&&(0,a.jsx)(d.pd,{label:"Default Model",value:I.defaultModel,onChange:e=>z({...I,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),y&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),H&&(0,a.jsx)(d.Ex,{variant:"success"===H?"success":"failed"===H?"error":"default",children:"success"===H?"Valid":"failed"===H?"Invalid":"Could not validate"}),p&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:p}),i&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),C&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Access Key ID",value:U.accessKeyId,onChange:e=>L({...U,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,a.jsx)(d.pd,{label:"Region",value:U.region,onChange:e=>L({...U,region:e.target.value}),placeholder:"us-east-1"}),(0,a.jsx)(d.pd,{label:"Session Token",value:U.sessionToken,onChange:e=>L({...U,sessionToken:e.target.value}),placeholder:"Only for temporary keys"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Leave region empty to use us-east-1. A profile name is not accepted."})]}),w&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Polly"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Access Key ID",value:D.accessKeyId,onChange:e=>_({...D,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,a.jsx)(d.pd,{label:"Region",value:D.region,onChange:e=>_({...D,region:e.target.value}),placeholder:"us-east-1"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Leave region empty to use us-east-1. The voice id is chosen on the TTS page."})]}),O&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:q.accountId,onChange:e=>M({...q,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),A&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:E.azureEndpoint,onChange:e=>R({...E,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:E.deployment,onChange:e=>R({...E,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:E.apiVersion,onChange:e=>R({...E,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:E.organization,onChange:e=>R({...E,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:I.priority,onChange:e=>z({...I,priority:e.target.value}),onBlur:e=>{let t=Number.parseInt(e.target.value,10);z(e=>({...e,priority:Number.isFinite(t)?t:1}))}}),!v&&(0,a.jsx)(d.l6,{label:"Proxy Pool",value:I.proxyPoolId,onChange:e=>z({...I,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(u||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),!v&&0===(u||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),!v&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:eo,fullWidth:!0,disabled:Z||!y&&(!I.name||!I.apiKey)||v&&!I.flowProfile.trim()||i&&!I.defaultModel.trim()||A&&(!E.azureEndpoint||!E.deployment||!E.organization)||O&&!q.accountId||w&&!D.accessKeyId.trim()||C&&!U.accessKeyId.trim(),children:Z?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function Q({isOpen:e,node:t,onSave:s,onClose:i,isAnthropic:n}){let[l,o]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(""),[p,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)(null);(0,r.useEffect)(()=>{t&&(o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}),x(""),h(""),y(null))},[t,n]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){m(!0);try{let e={name:l.name,prefix:l.prefix,baseUrl:l.baseUrl};n||(e.apiType=l.apiType),await s(e)}finally{m(!1)}}},j=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:u,type:n?"anthropic-compatible":"openai-compatible",modelId:p.trim()||void 0})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{f(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:l.name,onChange:e=>o({...l,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:l.prefix,onChange:e=>o({...l,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>o({...l,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>o({...l,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:u,onChange:e=>x(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!u||b||!l.baseUrl.trim(),variant:"secondary",children:b?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:p,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,a.jsx)(d.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function Z({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:i,onClose:n}){let[l,o]=(0,r.useState)(""),[c,m]=(0,r.useState)(null),[u,x]=(0,r.useState)(""),[p,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(o(""),m(null),x(""))},[e]);let b=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},f=async()=>{let e=b(l.trim());if(e){m("testing"),x("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),x(a.error||"")}catch(e){m("error"),x(e.message)}}},g=async()=>{let e=b(l.trim());if(e&&!p){h(!0);try{await i(e)}finally{h(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:l,onChange:e=>{o(e.target.value),m(null),x("")},onKeyDown:e=>{"Enter"===e.key&&f()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:f,disabled:!l.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:b(l.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:u||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:g,fullWidth:!0,size:"sm",disabled:!l.trim()||p,children:p?"Adding...":"Add Model"})]})]})})}V.propTypes={isOpen:O().bool.isRequired,provider:O().string,providerName:O().string,isCompatible:O().bool,isAnthropic:O().bool,authType:O().string,authHint:O().string,website:O().string,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string})),error:O().string,onSave:O().func.isRequired,onBulkDone:O().func,existingNames:O().arrayOf(O().string),onClose:O().func.isRequired},Q.propTypes={isOpen:O().bool.isRequired,node:O().shape({id:O().string,name:O().string,prefix:O().string,apiType:O().string,baseUrl:O().string}),onSave:O().func.isRequired,onClose:O().func.isRequired,isAnthropic:O().bool},Z.propTypes={isOpen:O().bool.isRequired,providerAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,onSave:O().func.isRequired,onClose:O().func.isRequired};let X="/api/providers/codebuddy/discover-models",Y={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},ee={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function et(e,t){return e?.error||t}function es({isOpen:e,connections:t,onModelsAdded:s,onClose:i}){let n=(0,r.useMemo)(()=>t.filter(e=>"codebuddy"===e.provider&&!1!==e.isActive),[t]),[l,o]=(0,r.useState)(null),[c,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(""),[p,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(()=>new Set),[g,y]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)([]),[S,$]=(0,r.useState)(()=>new Set),A=(0,r.useCallback)(async()=>{m(!0),x(""),h(""),j(!1),C([]);try{let e=await fetch(X,{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(et(t,"Could not refresh model candidates"));o(t),f(new Set((t.hidden||[]).map(e=>e.id)))}catch(e){x(e.message)}finally{m(!1)}},[]);(0,r.useEffect)(()=>{e&&(y(e=>n.some(t=>t.id===e)?e:n[0]?.id||""),A())},[n,e,A]);let O=async()=>{if(g&&0!==b.size&&!k){w(!0),x(""),h("");try{let e=await fetch(X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:[...b]})}),t=await e.json();if(!e.ok)throw Error(et(t,"Hidden model scan failed"));C(t.results||[]),j(!1)}catch(e){x(e.message)}finally{w(!1)}}},T=(0,r.useMemo)(()=>new Map(N.map(e=>[e.id,e])),[N]),P=(0,r.useMemo)(()=>(l?.hidden||[]).filter(e=>{let t=T.get(e.id)?.status;return e.previouslyVerified||"verified"===t||"recognized"===t}),[l,T]),I=async e=>{let t=e.filter(e=>!S.has(e.id));if(!t.length)return;$(e=>new Set([...e,...t.map(e=>e.id)])),x(""),h("");let a=[];try{for(let e of t){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"cb",id:e.id,type:"llm",name:e.name})}),s=await t.json();if(!t.ok)throw Error(et(s,`Could not add ${e.id}`));a.push(e)}window.dispatchEvent(new Event("customModelChanged")),await s?.(a),h(`${a.length} model${1===a.length?"":"s"} added to CodeBuddy Global.`)}catch(e){a.length&&(window.dispatchEvent(new Event("customModelChanged")),await s?.(a)),x(e.message)}finally{$(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}},z=P.filter(e=>b.has(e.id));return(0,a.jsx)(d.aF,{isOpen:e,onClose:i,title:"Discover CodeBuddy Global Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("div",{className:"live-probe-panel p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Live package candidates"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"Refreshing reads Tencent's current CLI manifests and does not call a model or use credits."}),l?.version&&(0,a.jsxs)("p",{className:"mt-2 font-mono text-xs text-primary",children:["codebuddy-code@",l.version]})]}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:c,onClick:A,children:"Refresh Candidates"})]})}),u&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:u}),p&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:p}),l?.warnings?.map(e=>(0,a.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:e},e)),l&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.official?.length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Official Global"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.hidden?.length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Hidden candidates"})]}),(0,a.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.hidden?.filter(e=>e.previouslyVerified).length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Previously verified"})]})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Hidden route candidates"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"From alternate official manifests; availability is not guaranteed on Global SaaS."})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>f(b.size===(l.hidden?.length||0)?new Set:new Set(l.hidden.map(e=>e.id))),children:b.size===(l.hidden?.length||0)?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:(l.hidden||[]).map(e=>{let t=T.get(e.id);return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:b.has(e.id),onChange:()=>{var t;return t=e.id,void f(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:e.id}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:e.sources.length?e.sources.join(" + "):"request history"})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[e.previouslyVerified&&(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"previous success"}),t&&(0,a.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${ee[t.status]||ee.error}`,children:Y[t.status]||t.status}),(e.previouslyVerified||["verified","recognized"].includes(t?.status))&&(0,a.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),I([e])},className:"text-xs font-semibold text-primary hover:underline",disabled:S.has(e.id),children:S.has(e.id)?"Adding...":"Add"})]})]},e.id)})})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"CodeBuddy Global connection",value:g,onChange:e=>y(e.target.value),options:n.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Global connection",disabled:!n.length||k,hint:"Every probe is pinned to this connection."}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>j(!0),disabled:!g||0===b.size||k,children:["Scan Hidden Models (",b.size,")"]})]}),!n.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a CodeBuddy Global connection before scanning."}),v&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using scan"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion probes and may consume CodeBuddy credits. Scanning uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>j(!1),disabled:k,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:k,onClick:O,children:"Start Credit Scan"})]})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[N.filter(e=>"verified"===e.status).length," verified, ",N.filter(e=>"recognized"===e.status).length," recognized, ",N.filter(e=>"unavailable"===e.status).length," unavailable"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"playlist_add",onClick:()=>I(z),disabled:!z.length||S.size>0,children:["Add Selected Available (",z.length,")"]})]})]})]})})}es.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onModelsAdded:O().func,onClose:O().func.isRequired};let ea={"codebuddy-intl":{label:"CodeBuddy",alias:"cbai",title:"Live Probe CodeBuddy Models"},"codebuddy-cn":{label:"CodeBuddy CN",alias:"cb-cn",title:"Live Probe CodeBuddy CN Models"}},er={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},ei={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function en({isOpen:e,providerId:t,connections:s,onModelsAdded:i,onClose:n}){let l=ea[t]||ea["codebuddy-intl"],o=(0,r.useMemo)(()=>(s||[]).filter(e=>e.provider===t&&!1!==e.isActive),[s,t]),[c,m]=(0,r.useState)([]),[u,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(()=>new Set),[v,j]=(0,r.useState)(""),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)(!1),[S,$]=(0,r.useState)([]),[A,O]=(0,r.useState)(()=>new Set),T=(0,r.useCallback)(async()=>{x(!0),h(""),f(""),w(!1),$([]);try{let e=await fetch(`/api/providers/${t}/discover-models`,{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s?.error||"Could not load model candidates");let a=s.candidates||[];m(a),y(new Set(a.map(e=>e.id)))}catch(e){h(e.message)}finally{x(!1)}},[t]);(0,r.useEffect)(()=>{e&&(j(e=>o.some(t=>t.id===e)?e:o[0]?.id||""),T())},[o,e,T]);let P=async()=>{if(v&&0!==g.size&&!N){C(!0),h(""),f("");try{let e=await fetch(`/api/providers/${t}/discover-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:v,models:[...g]})}),s=await e.json();if(!e.ok)throw Error(s?.error||"Live probe failed");$(s.results||[]),w(!1)}catch(e){h(e.message)}finally{C(!1)}}},I=(0,r.useMemo)(()=>new Map(S.map(e=>[e.id,e])),[S]),z=async e=>{let t=e.filter(e=>"catalog"!==e.source&&!A.has(e.id));if(!t.length)return;O(e=>new Set([...e,...t.map(e=>e.id)])),h(""),f("");let s=[];try{for(let e of t){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:l.alias,id:e.id,type:"llm",name:e.name})}),a=await t.json();if(!t.ok)throw Error(a?.error||`Could not add ${e.id}`);s.push(e)}window.dispatchEvent(new Event("customModelChanged")),await i?.(s),f(`${s.length} model${1===s.length?"":"s"} added to ${l.label}.`)}catch(e){s.length&&(window.dispatchEvent(new Event("customModelChanged")),await i?.(s)),h(e.message)}finally{O(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:n,title:l.title,size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:`${l.label} connection`,value:v,onChange:e=>j(e.target.value),options:o.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:`No active ${l.label} connection`,disabled:!o.length||N,hint:"Every probe is pinned to this connection."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:u,disabled:N,onClick:T,children:"Refresh Catalog"})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:["Probes the models this router already knows for ",l.label,". A probe sends one short completion and may use credits."]}),!o.length&&(0,a.jsxs)("p",{className:"mt-2 text-xs text-red-500",children:["Add and activate a ",l.label," connection first."]})]}),p&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:p}),b&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:b}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Models"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[c.length," candidate",1===c.length?"":"s"]})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>y(g.size===c.length?new Set:new Set(c.map(e=>e.id))),disabled:!c.length,children:g.size===c.length?"Clear":"Select all"})]}),(0,a.jsxs)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:[c.map(e=>{let t=I.get(e.id);return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.has(e.id),onChange:()=>{var t;return t=e.id,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:e.id})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[t&&(0,a.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${ei[t.status]||ei.error}`,children:er[t.status]||t.status}),"catalog"!==e.source&&["verified","recognized"].includes(t?.status)&&(0,a.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),z([e])},className:"text-xs font-semibold text-primary hover:underline",disabled:A.has(e.id),children:A.has(e.id)?"Adding...":"Add"})]})]},e.id)}),!u&&0===c.length&&(0,a.jsx)("p",{className:"px-3 py-6 text-center text-sm text-text-muted",children:"No model candidates yet."})]})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:S.length>0?`${S.filter(e=>"verified"===e.status).length} verified, ${S.filter(e=>"unavailable"===e.status).length} unavailable`:"Probe sends one real completion per selected model."}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>w(!0),disabled:!v||0===g.size||N,children:["Live Probe (",g.size,")"]})]}),k&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["These are real completion probes and may consume ",l.label," credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>w(!1),disabled:N,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:N,onClick:P,children:"Start Probe"})]})]})]})]})})}en.propTypes={isOpen:O().bool,providerId:O().string.isRequired,connections:O().arrayOf(O().object),onModelsAdded:O().func,onClose:O().func.isRequired};let el="/api/providers/opencode/discover-models",eo={verified:"Works",quota_exhausted:"Free quota used up",skipped:"Not tested",overloaded:"Overloaded",unavailable:"Unavailable",deprecated:"Deprecated",unsupported:"Protocol unsupported",error:"Error"},ed={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",quota_exhausted:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-zinc-500/30 bg-zinc-500/[0.08] text-zinc-600 dark:text-zinc-400",overloaded:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",unavailable:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",error:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300"},ec=new Set(["unavailable","deprecated","unsupported"]);function em({isOpen:e,onModelsAdded:t,onClose:s}){let[i,n]=(0,r.useState)([]),[l,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(""),[u,x]=(0,r.useState)(""),[p,h]=(0,r.useState)(()=>new Set),[b,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)([]),[v,j]=(0,r.useState)(()=>new Set),[k,w]=(0,r.useState)(()=>new Set),N=(0,r.useCallback)(async()=>{o(!0),m(""),x(""),y([]);try{let e=await fetch(el,{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t?.error||"Could not fetch OpenCode models");let s=t.candidates||[];n(s),h(new Set(s.filter(e=>!1!==e.inCatalog).map(e=>e.id))),w(new Set(s.filter(e=>e.isConfigured).map(e=>e.id))),!1===t.catalogAvailable&&x("OpenCode's model catalog could not be fetched; showing configured models only.")}catch(e){m(e.message)}finally{o(!1)}},[]);(0,r.useEffect)(()=>{e&&N()},[e,N]);let C=async()=>{if(0!==p.size&&!b){f(!0),m(""),x("");try{let e=await fetch(el,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:[...p]})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Live probe failed");let s=t.results||[];y(s);let a=s.find(e=>"quota_exhausted"===e.status);a&&m(`OpenCode's free quota for this IP is used up (${a.id}). The remaining models were not tested; this says nothing about whether they work. Try again later.`)}catch(e){m(e.message)}finally{f(!1)}}},S=(0,r.useMemo)(()=>new Map(g.map(e=>[e.id,e])),[g]),$=async e=>{let s=e.filter(e=>!v.has(e.id)&&!k.has(e.id));if(!s.length)return;j(e=>new Set([...e,...s.map(e=>e.id)])),m(""),x("");let a=[];try{for(let e of s){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"oc",id:e.id,type:"llm",name:e.name||e.id})}),s=await t.json();if(!t.ok)throw Error(s?.error||`Could not add ${e.id}`);a.push(e)}window.dispatchEvent(new Event("customModelChanged")),w(e=>new Set([...e,...a.map(e=>e.id)])),await t?.(a),x(`${a.length} model${1===a.length?"":"s"} added to OpenCode Free!`)}catch(e){a.length&&(window.dispatchEvent(new Event("customModelChanged")),w(e=>new Set([...e,...a.map(e=>e.id)])),await t?.(a)),m(e.message)}finally{j(e=>{let t=new Set(e);return s.forEach(e=>t.delete(e.id)),t})}},A=(0,r.useMemo)(()=>i.filter(e=>{let t=S.get(e.id);return t?.ok&&!k.has(e.id)}),[i,S,k]);return(0,a.jsx)(d.aF,{isOpen:e,onClose:s,title:"Live Probe OpenCode Free Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("div",{className:"live-probe-panel p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Upstream Catalog Live Probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["Pulls candidates directly from ",(0,a.jsx)("span",{className:"font-mono",children:"opencode.ai/zen/v1/models"})," and tests real-time completions to verify which free models are alive."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:l,onClick:N,children:"Refresh Catalog"}),(0,a.jsx)(d.$n,{size:"sm",icon:"radar",loading:b,disabled:0===p.size||b,onClick:C,children:b?"Probing Upstream...":`Live Probe (${p.size})`})]})]})}),c&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:c}),u&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:u}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Total Candidates: ",(0,a.jsx)("strong",{className:"text-text-main",children:i.length})]}),g.length>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["• Works: ",(0,a.jsx)("strong",{className:"text-green-600",children:g.filter(e=>e.ok).length})," ","• Dead: ",(0,a.jsx)("strong",{className:"text-red-600",children:g.filter(e=>ec.has(e.status)).length})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[A.length>0&&(0,a.jsxs)("button",{type:"button",onClick:()=>$(A),disabled:v.size>0,className:"text-xs font-semibold text-primary hover:underline",children:["+ Add All Verified (",A.length,")"]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>h(p.size===i.length?new Set:new Set(i.map(e=>e.id))),children:p.size===i.length?"Deselect All":"Select All"})]})]}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:i.map(e=>{let t=S.get(e.id),s=k.has(e.id),r=v.has(e.id);return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:p.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:e.name}),s&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Active in Router"}),!1===e.inCatalog&&(0,a.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-0.5 text-[10px] font-medium text-red-600 dark:text-red-400",title:"Not listed in opencode.ai/zen/v1/models anymore",children:"Retired upstream"})]}),(0,a.jsxs)("span",{className:"block font-mono text-[11px] text-text-muted truncate",children:["oc/",e.id]})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[t?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`rounded-full border px-2.5 py-0.5 text-[11px] font-medium ${ed[t.status]||ed.error}`,title:t.error||t.message,children:eo[t.status]||t.status}),t.latencyMs>0&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted font-mono",children:[t.latencyMs,"ms"]})]}):(0,a.jsx)("span",{className:"text-[11px] text-text-muted italic",children:"Ready to probe"}),!s&&!1!==e.inCatalog&&!ec.has(t?.status)&&(0,a.jsx)("button",{type:"button",onClick:()=>$([e]),disabled:r,className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:r?"Adding...":"+ Add"})]})]},e.id)})}),(0,a.jsx)("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",onClick:s,children:"Close"})})]})})}em.propTypes={isOpen:O().bool.isRequired,onModelsAdded:O().func,onClose:O().func.isRequired};var eu=s(42835);let ex="/api/providers/kiro/discover-models",ep={verified:"Verified",recognized:"Recognized (quota)",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},eh={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"},eb={live:"live catalog",saved:"saved on account",alias:"your alias"};function ef(e){return e?e>=1e6?`${e/1e6}M`:`${Math.round(e/1e3)}K`:null}function eg({isOpen:e,connections:t,onClose:s}){let i=(0,r.useMemo)(()=>t.filter(e=>"kiro"===e.provider&&!1!==e.isActive&&!e.quarantinedAt),[t]),[n,l]=(0,r.useState)(""),[o,c]=(0,r.useState)(null),[m,u]=(0,r.useState)(!1),[x,p]=(0,r.useState)(""),[h,b]=(0,r.useState)(()=>new Set),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),[j,k]=(0,r.useState)([]),[w,N]=(0,r.useState)(!1),[C,S]=(0,r.useState)(""),$=(0,r.useCallback)(async e=>{if(e){u(!0),p(""),S(""),g(!1),k([]);try{let t=await fetch(`${ex}?connectionId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok)throw Error(s?.error||"Could not refresh Kiro candidates");c(s),b(new Set((s.candidates||[]).filter(e=>!e.inLive).map(e=>e.id)))}catch(e){c(null),p(e.message)}finally{u(!1)}}},[]);(0,r.useEffect)(()=>{!e||i.some(e=>e.id===n)||l(i[0]?.id||"")},[i,n,e]),(0,r.useEffect)(()=>{e&&n&&$(n)},[n,e,$]);let A=async()=>{if(n&&0!==h.size&&!y){v(!0),p("");try{let e=await fetch(ex,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:n,models:[...h]})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Kiro model probe failed");k(t.results||[]),g(!1)}catch(e){p(e.message)}finally{v(!1)}}},O=(0,r.useMemo)(()=>new Map(j.map(e=>[e.id,e])),[j]),T=o?.candidates||[],P=T.filter(e=>e.inLive).length,I=T.length-P,z=j.filter(e=>"verified"===e.status).map(e=>e.id),E=!!o&&!o.hasProfile&&z.length>0,R=async()=>{if(E&&!w){N(!0),p(""),S("");try{let e=await fetch(ex,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:n,models:z})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Saving verified models failed");S(`${t.saved.length} verified model${1===t.saved.length?"":"s"} saved to this connection.`)}catch(e){p(e.message)}finally{N(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:s,title:"Live Probe Kiro Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"Kiro connection",value:n,onChange:e=>l(e.target.value),options:i.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Kiro connection",disabled:!i.length||y,hint:"The catalog and every probe are pinned to this connection."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:m,disabled:!n||y,onClick:()=>$(n),children:"Refresh Catalog"})]}),(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing calls Kiro's ListAvailableModels for this account and does not use credits."}),!i.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Kiro connection first."})]}),x&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:x}),C&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:C}),o?.warnings?.map(e=>(0,a.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:e},e)),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:P}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"In live catalog"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:I}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Saved / alias only"})]}),(0,a.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,a.jsx)("p",{className:`text-sm font-semibold ${o.liveCatalog?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:o.liveCatalog?"Live catalog readable":"Live catalog unavailable"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.hasProfile?"Account has a CodeWhisperer profile":"No profile (API-key login)"})]})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Base models"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"-thinking and -agentic variants share their base model and are not probed separately."})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>b(h.size===T.length?new Set:new Set(T.map(e=>e.id))),children:h.size===T.length?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:T.map(e=>{let t=O.get(e.id),s=[ef(e.contextLength),ef(e.maxOutputTokens)].filter(Boolean).join(" / ");return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:h.has(e.id),onChange:()=>{var t;return t=e.id,void b(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["kr/",e.id]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[e.sources.map(e=>eb[e]||e).join(" + "),s&&` \xb7 ${s}`,e.rateMultiplier&&1!==e.rateMultiplier&&` \xb7 ${e.rateMultiplier}x credit`]})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[e.inLive&&(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"live"}),t&&(0,a.jsxs)("span",{title:t.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${eh[t.status]||eh.error}`,children:[ep[t.status]||t.status,"verified"===t.status&&Number.isFinite(t.latencyMs)&&` \xb7 ${t.latencyMs}ms`]})]})]},e.id)})})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j.length>0?`${j.filter(e=>"verified"===e.status).length} verified, ${j.filter(e=>"unavailable"===e.status).length} unavailable, ${j.filter(e=>!["verified","unavailable"].includes(e.status)).length} other`:"Probe sends one real completion per selected model."}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[E&&(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"save",loading:w,onClick:R,children:["Save Verified to Connection (",z.length,")"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>g(!0),disabled:!n||0===h.size||y,children:["Probe Selected (",h.size,")"]})]})]}),f&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion requests and may consume Kiro credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>g(!1),disabled:y,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:y,onClick:A,children:"Start Probe"})]})]})]})]})]})})}eg.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onClose:O().func.isRequired};let ey="/api/providers/cloudflare-ai/discover-models",ev={verified:"Works",paid_only:"Paid plan only",no_access:"No access",unavailable:"Unavailable",deprecated:"Deprecated",unsupported:"Not a chat model",agreement_required:"License agreement needed",input_rejected:"Input rejected",quota_exhausted:"Daily quota used up",credential_rejected:"Token rejected",rate_limited:"Rate limited",skipped:"Not tested",error:"Inconclusive"},ej={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",paid_only:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",no_access:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unavailable:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",input_rejected:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",agreement_required:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",quota_exhausted:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",rate_limited:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300"},ek=new Set(["unavailable","no_access","deprecated","unsupported"]),ew=[{kind:"llm",title:"Chat models",hint:"Probed with one short chat completion."},{kind:"image",title:"Image models",hint:"Probed with one small generation. Image probes use far more neurons than chat."}];function eN({isOpen:e,connections:t,onModelsAdded:s,onClose:i}){let n=(0,r.useMemo)(()=>t.filter(e=>"cloudflare-ai"===e.provider&&!1!==e.isActive&&!e.quarantinedAt),[t]),[l,o]=(0,r.useState)(""),[c,m]=(0,r.useState)(null),[u,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(()=>new Set),[v,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)([]),[S,$]=(0,r.useState)(()=>new Set),[A,O]=(0,r.useState)(()=>new Set),T=(0,r.useCallback)(async e=>{if(e){x(!0),h(""),f(""),j(!1),C([]);try{let t=await fetch(`${ey}?connectionId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok)throw Error(s?.error||"Could not read the Cloudflare model catalog");m(s),y(new Set((s.candidates||[]).filter(e=>!e.paidOnly).map(e=>e.id))),O(new Set((s.candidates||[]).filter(e=>e.builtIn||e.aliased).map(e=>e.id))),s.catalogAvailable||f("Cloudflare's model catalog could not be read; showing built-in and saved models only.")}catch(e){m(null),h(e.message)}finally{x(!1)}}},[]);(0,r.useEffect)(()=>{!e||n.some(e=>e.id===l)||o(n[0]?.id||"")},[n,l,e]),(0,r.useEffect)(()=>{e&&l&&T(l)},[l,e,T]);let P=(0,r.useMemo)(()=>c?.candidates||[],[c]),I=(0,r.useMemo)(()=>new Map(N.map(e=>[e.id,e])),[N]),z=P.filter(e=>"image"===e.kind&&g.has(e.id)).length,E=async()=>{if(l&&0!==g.size&&!k){w(!0),h(""),f("");try{let e=P.filter(e=>g.has(e.id)).map(e=>({id:e.id,kind:e.kind})),t=await fetch(ey,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:l,models:e})}),s=await t.json();if(!t.ok)throw Error(s?.error||"Cloudflare model probe failed");let a=s.results||[];C(a),j(!1);let r=a.find(e=>"quota_exhausted"===e.status||"credential_rejected"===e.status);r&&h("quota_exhausted"===r.status?`This account's daily Workers AI allocation is used up (${r.id}). The remaining models were not tested; try again after the daily reset or pick another connection.`:`Cloudflare rejected this connection's API token (${r.id}). The remaining models were not tested.`)}catch(e){h(e.message)}finally{w(!1)}}},R=async e=>{let t=e.filter(e=>!A.has(e.id)&&!S.has(e.id));if(t.length){$(e=>new Set([...e,...t.map(e=>e.id)])),h(""),f("");try{await s?.(t),O(e=>new Set([...e,...t.map(e=>e.id)])),f(`${t.length} model${1===t.length?"":"s"} added to the router.`)}catch(e){h(e.message)}finally{$(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}}},q=P.filter(e=>"llm"===e.kind&&I.get(e.id)?.status==="verified"&&!A.has(e.id)),M={works:N.filter(e=>"verified"===e.status).length,dead:N.filter(e=>ek.has(e.status)).length,paid:N.filter(e=>"paid_only"===e.status).length,other:N.filter(e=>!["verified","paid_only"].includes(e.status)&&!ek.has(e.status)).length};return(0,a.jsx)(d.aF,{isOpen:e,onClose:i,title:"Live Probe Cloudflare Workers AI Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"Cloudflare connection",value:l,onChange:e=>o(e.target.value),options:n.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Cloudflare connection",disabled:!n.length||k,hint:"The catalog and every probe use this account."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:u,disabled:!l||k,onClick:()=>T(l),children:"Refresh Catalog"})]}),(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing reads this account's Workers AI model catalog and does not use neurons. Only chat and text-to-image models are listed."}),!n.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Cloudflare connection first."})]}),p&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:p}),b&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:b}),c&&ew.map(e=>{let t=P.filter(t=>t.kind===e.kind);if(!t.length)return null;let s=t.every(e=>g.has(e.id));return(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-main",children:[e.title," (",t.length,")"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.hint})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>{var t;let s,a;return t=e.kind,a=(s=P.filter(e=>e.kind===t).map(e=>e.id)).every(e=>g.has(e)),void y(e=>{let t=new Set(e);for(let e of s)a?t.delete(e):t.add(e);return t})},children:s?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:t.map(e=>{var t;let s=I.get(e.id),r=A.has(e.id),i="llm"===e.kind&&!r&&s?.status==="verified",n=[!(t=e.contextLength)?null:t>=1e6?`${Math.round(t/1e5)/10}M ctx`:`${Math.round(t/1e3)}K ctx`,...e.flags].filter(Boolean).join(" \xb7 ");return(0,a.jsxs)("div",{className:"flex items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-start gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.has(e.id),onChange:()=>{var t;return t=e.id,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium text-text-main",children:e.name}),r&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"In router"}),e.paidOnly&&(0,a.jsx)("span",{className:"rounded-full bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-700 dark:text-sky-300",children:"Workers Paid"}),!1===e.inCatalog&&(0,a.jsx)("span",{className:"rounded-full bg-zinc-500/10 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:"Not listed in this account's Workers AI catalog",children:"Not in catalog"})]}),(0,a.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["cf/",e.id]}),n&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:n})]})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2 pt-0.5",children:[s&&(0,a.jsxs)("span",{title:s.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${ej[s.status]||ej.error}`,children:[ev[s.status]||s.status,"verified"===s.status&&Number.isFinite(s.latencyMs)&&` \xb7 ${s.latencyMs}ms`]}),i&&(0,a.jsx)("button",{type:"button",onClick:()=>R([e]),disabled:S.has(e.id),className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:S.has(e.id)?"Adding...":"+ Add"})]})]},e.id)})})]},e.kind)}),c&&(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:N.length>0?`${M.works} work, ${M.dead} dead, ${M.paid} need Workers Paid, ${M.other} other`:"Probe sends one real request per selected model."}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[q.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"add",loading:S.size>0,onClick:()=>R(q),children:["Add Working Chat Models (",q.length,")"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>j(!0),disabled:!l||0===g.size||k,children:["Probe Selected (",g.size,")"]})]})]}),v&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm neuron-using probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["These are real Workers AI requests on the selected account and count toward its daily free allocation of 10,000 neurons.",z>0&&` ${z} image model${1===z?"":"s"} selected; each image probe costs much more than a chat probe.`," ","At most 3 run at once, and the scan stops if the allocation runs out or the token is rejected."]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>j(!1),disabled:k,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:k,onClick:E,children:"Start Probe"})]})]})]})]})})}function eC({showAutomation:e,showAddConnection:t,onOpenAutomation:s,onAddConnection:r,methods:i=null,onSelectMethod:n=null,extra:l=null}){let o=Array.isArray(i)?i.filter(e=>"oauth"===e.id||"apikey"===e.id):[],c=2===o.length&&"function"==typeof n,m=Array.isArray(i)?i.filter(e=>"oauth"!==e.id&&"apikey"!==e.id):[];return e||t||c||l||0!==m.length?(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:flex-wrap sm:justify-end",children:[e?(0,a.jsx)(d.$n,{size:"sm",icon:"automation",variant:"secondary",onClick:s,className:"w-full sm:w-auto",children:"Open Automation"}):null,c?(0,a.jsxs)(a.Fragment,{children:[o.map(e=>(0,a.jsx)(d.$n,{size:"sm",icon:e.icon||("oauth"===e.id?"lock":"key"),variant:"oauth"===e.id?"secondary":void 0,onClick:()=>n(e.id),disabled:e.disabled,className:"w-full sm:w-auto",children:e.label},e.id)),m.map(e=>(0,a.jsx)(d.$n,{size:"sm",icon:e.icon||"add",variant:"secondary",onClick:()=>n(e.id),disabled:e.disabled,className:"w-full sm:w-auto",children:e.label},e.id))]}):t?(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:r,className:"w-full sm:w-auto",children:"Add Connection"}):null,l]}):null}eN.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onModelsAdded:O().func,onClose:O().func.isRequired},eC.propTypes={showAutomation:O().bool.isRequired,showAddConnection:O().bool.isRequired,onOpenAutomation:O().func.isRequired,onAddConnection:O().func.isRequired,methods:O().arrayOf(O().shape({id:O().string.isRequired,label:O().string.isRequired,icon:O().string,disabled:O().bool})),onSelectMethod:O().func,extra:O().node};let eS=`[
4
4
  {
@@ -12,4 +12,4 @@ sk-key-only-auto-named`;function V({isOpen:e,provider:t,providerName:s,isCompati
12
12
  "refresh_token": "rt_...",
13
13
  "email": "user@example.com"
14
14
  }
15
- ]`;function eO({isOpen:e,onClose:t,onSuccess:s}){let[i,n]=(0,r.useState)(""),[l,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(null),u=()=>{l||(m(null),t())},x=async()=>{let e;try{e=JSON.parse(i)}catch{m({error:"Paste a JSON account or an array of accounts"});return}o(!0),m(null);try{let t=await fetch("/api/oauth/grok-cli/json-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();m(a.error?{error:a.error}:a),!a.error&&a.success>0&&s?.()}catch(e){m({error:e.message})}finally{o(!1)}},p=c&&!c.error?`Imported ${c.success}. Failed ${c.failed}.`:null;return(0,a.jsxs)(d.aF,{isOpen:e,onClose:u,title:"Import Grok CLI accounts",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:u,disabled:l,children:"Close"}),(0,a.jsx)(d.$n,{onClick:x,disabled:l||!i.trim(),children:l?"Importing...":"Import"})]}),children:[(0,a.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Paste one account or an array. Snake_case and camelCase are both accepted. A refresh token is refreshed before it is stored. The response never returns the tokens. Line import stays on the automation page."}),(0,a.jsx)("textarea",{className:"w-full rounded-lg border border-border bg-background p-3 font-mono text-xs text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none",rows:8,placeholder:eA,value:i,onChange:e=>n(e.target.value),disabled:l}),c?(0,a.jsx)("div",{className:`mt-3 rounded-lg p-3 text-xs ${c.error?"bg-red-500/10 text-red-400":"bg-green-500/10 text-green-400"}`,children:c.error||p}):null]})}eO.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func};let eT=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],eP=/^[A-Za-z0-9-]+$/;function eI({providerId:e}){let t=(0,S.i)(),[s,i]=(0,r.useState)(!1),[n,l]=(0,r.useState)([{name:"",value:""}]),[o,c]=(0,r.useState)({}),[m,u]=(0,r.useState)(!1),[x,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));c(s),l(a.length?a:[{name:"",value:""}]),u(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{l(a=>a.map((a,r)=>r===e?{...a,[t]:s}:a))},b=(0,r.useCallback)(async()=>{let s={};for(let e of n.filter(e=>e.name.trim())){let a=e.name.trim();if(!eP.test(a))return void t.error(`Invalid header name: ${a}`);if(eT.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}p(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}u(Object.keys(s).length>0),t.success("Custom headers saved")}finally{p(!1)}},[n,o,e,t]);return 0!==Object.keys(o).length||m?(0,a.jsxs)(d.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,a.jsx)(d.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:n.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>l(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>l(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:x,onClick:()=>{l(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,a.jsx)("button",{type:"button",disabled:x,onClick:b,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:x?"Saving...":"Save"})]})]})]})]}):null}eI.propTypes={providerId:O().string.isRequired};var ez=s(5539);let eE="kiro-bulk-import-active-job",eR="Bulk import progress expired or was cleared.",eq={claude:"claudeAutoPing",codex:"codexAutoPing"};function eM(e){return ez.w.has(e)||"codex"===e||"grok-cli"===e}function eD({providerId:e,onWebLoginConnected:t,onBulkImport:s}){let r=[];return(ez.w.has(e)&&r.push((0,a.jsx)(ez.A,{providerId:e,onConnected:t},"web-login")),("codex"===e||"grok-cli"===e)&&r.push((0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:s,className:"w-full sm:w-auto",children:"Bulk Add"},"bulk-add")),r.length)?(0,a.jsx)(a.Fragment,{children:r}):null}function e_(e){return["completed","cancelled","failed"].includes(e)}async function eU(e){if(!e)return null;let t=await fetch(`/api/oauth/kiro/bulk-import/${e}`,{cache:"no-store"}),s=await t.json();return{res:t,data:s}}async function eL(e="active"){let t=await fetch(`/api/oauth/kiro/bulk-import/latest?scope=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();return{res:t,data:s}}async function eK(e){let t=new AbortController,s=window.setTimeout(()=>t.abort(),8e3);try{let s=await fetch(e,{cache:"no-store",signal:t.signal}),a=null;try{a=await s.json()}catch{a=null}return{response:s,data:a}}finally{window.clearTimeout(s)}}function eF(){let e,t=(0,i.useParams)(),s=(0,i.useRouter)(),n=t.id,[m,f]=(0,r.useState)([]),[A,O]=(0,r.useState)(!0),[P,I]=(0,r.useState)(""),[E,R]=(0,r.useState)(null),[q,M]=(0,r.useState)([]),[_,U]=(0,r.useState)(!1),[L,K]=(0,r.useState)(!1),[F,B]=(0,r.useState)(!1),[J,W]=(0,r.useState)(!1),[G,X]=(0,r.useState)(!1),[Y,ee]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(""),[el,eo]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[ex,ep]=(0,r.useState)(!1),[eh,eb]=(0,r.useState)(null),[ef,ey]=(0,r.useState)({}),[ev,ej]=(0,r.useState)([]),[ek,ew]=(0,r.useState)(!1),[eS,eA]=(0,r.useState)({}),[eT,eP]=(0,r.useState)({}),[ez,eF]=(0,r.useState)(()=>new Set),[eB,eJ]=(0,r.useState)(!1),[eH,eW]=(0,r.useState)(!1),[eG,eV]=(0,r.useState)(!1),[eQ,eZ]=(0,r.useState)(!1),[eX,eY]=(0,r.useState)(!1),[e0,e1]=(0,r.useState)(!1),[e2,e5]=(0,r.useState)(!1),[e3,e4]=(0,r.useState)([]),[e7,e6]=(0,r.useState)("__none__"),[e8,e9]=(0,r.useState)(!1),[te,tt]=(0,r.useState)(!1),[ts,ta]=(0,r.useState)(null),[tr,ti]=(0,r.useState)(""),[tn,tl]=(0,r.useState)("auto"),[to,td]=(0,r.useState)({}),[tc,tm]=(0,r.useState)({}),[tu,tx]=(0,r.useState)(null),[tp,th]=(0,r.useState)([]),[tb,tf]=(0,r.useState)([]),[tg,ty]=(0,r.useState)([]),[tv,tj]=(0,r.useState)(null),[tk,tw]=(0,r.useState)(!1),[tN,tC]=(0,r.useState)(null),[tS,t$]=(0,r.useState)(!1),[tA,tO]=(0,r.useState)(!1),[tT,tP]=(0,r.useState)(null),[tI,tz]=(0,r.useState)({}),[tE,tR]=(0,r.useState)(null),tq=(0,r.useRef)(!1),tM=(0,r.useRef)(null),tD=(0,r.useRef)("1"),[t_,tU]=(0,r.useState)(!1),[tL,tK]=(0,r.useState)(null),[tF,tB]=(0,r.useState)(""),[tJ,tH]=(0,r.useState)(1),[tW,tG]=(0,r.useState)(20),[tV,tQ]=(0,r.useState)("all"),[tZ,tX]=(0,r.useState)(""),[tY,t0]=(0,r.useState)(1),[t1,t2]=(0,r.useState)(20),{copied:t5,copy:t3}=(0,h.C)(),t4=(0,r.useRef)(0),t7=(0,r.useRef)([]),t6=(0,r.useRef)(!0),t8=(0,r.useRef)(null),t9=(0,S.i)(e=>e.error),se="ag_risk_confirmed",st=(0,r.useCallback)(()=>{tK(null),tB(""),t4.current=0,window.localStorage.removeItem(eE)},[]),ss=()=>{U(!0)},sa=()=>{"kiro"===n&&tL?.jobId&&e_(tL.status)&&st(),s.push(x(n))},sr=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type}:c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n]||c.br[n],si=sr?.authModes||[],sn=!!c.zN[n]||!!c.IS[n]||si.includes("oauth"),sl=!!c.fg[n]||si.includes("apikey"),so=!!c.IS[n]?.noAuth,sd=(0,y.F)("kiro"===n),sc=(0,p.KC)(n),sm="kiro"===n?sd:sc,su=(0,c.wG)(n),sx=(0,c.mq)(n),sp=(0,c.gb)(n),sh=sx||sp,sb=u(n),sf=function({providerId:e,providerInfo:t,isOAuth:s,supportsApiKeyAuth:a,isCompatible:r}){if(!t||t.noAuth||t.authModes?.includes("none"))return[];let i=[];for(let n of(s&&C(i,"oauth"),(a||r||"cookie"===t.authType||!s)&&C(i,"apikey"),w[e]||[]))C(i,n);return i.map(t=>{let s=k[t];return s?{...s,...N[e]?.[t]}:null}).filter(Boolean)}({providerId:n,providerInfo:sr,isOAuth:sn,supportsApiKeyAuth:sl,isCompatible:sx||sp}),sg=function(e,{specializedChooser:t=!1}={}){return e.length?t?{type:"specialized"}:1===e.length?{type:"method",methodId:e[0].id}:{type:"chooser"}:{type:"none"}}(sf,{specializedChooser:"kiro"===n}),sy=sf.map(e=>"quota-cookie"===e.id&&0===m.length?{...e,disabled:!0,description:"Add a CodeBuddy connection before attaching its quota cookie."}:e),sv=e=>{if(!tn||"auto"===tn)return null;let t=(0,$.kl)(n,e);return t&&t.includes(tn)?tn:null},sj=sh?n:su,sk=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=(0,$.kl)(n,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of sm)s(e.id);for(let e of tb)s(e.id);for(let e of ev)e.providerAlias===sj&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),sw=sh?E?.prefix||n:su,sN=(0,r.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}`,{cache:"no-store"}),t=await e.json();e.ok&&ty(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[sj]),sC=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:sj,ids:[e]})})).ok&&await sN()}catch(e){console.log("Error disabling model:",e)}},sS=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await sN()}catch(e){console.log("Error enabling model:",e)}},s$=async e=>{e.length&&tj({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{tj(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:sj,ids:e})})).ok&&await sN()}catch(e){console.log("Error disabling all models:",e)}}})},sA=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}`,{method:"DELETE"})).ok&&await sN()}catch(e){console.log("Error enabling all models:",e)}},sO=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ej(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]),sT=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ey(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,r.useEffect)(()=>{"kilocode"===n&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&tf(e.models)}).catch(()=>{})},[n]);let sP=(0,r.useCallback)(async()=>{try{I("");let[e,t,s,a]=await Promise.allSettled([eK("/api/providers"),eK("/api/provider-nodes"),eK("/api/proxy-pools?isActive=true"),eK("/api/settings")]),r="fulfilled"===e.status?e.value.response:null,i="fulfilled"===e.status?e.value.data:{},l="fulfilled"===t.status?t.value.response:null,o="fulfilled"===t.status?t.value.data:{},d="fulfilled"===s.status?s.value.response:null,m="fulfilled"===s.status?s.value.data:{},u="fulfilled"===a.status?a.value.response:null,x=u?.ok&&a.value.data||{};if(r?.ok){let e=(i.connections||[]).filter(e=>e.provider===n);t7.current=e,f(e)}else I("Connections could not be loaded.");d?.ok&&M(m.proxyPools||[]);let p=(x.providerStrategies||{})[n]||{};ta(p.fallbackStrategy||null),ti(null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1"),tD.current=null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1";let h=(x.providerThinking||{})[n]||{};tl(h.mode||"auto");let b=eq[n];if(td(b&&x?.[b]?.connections||{}),tm(b&&x?.[b]?.schedules||{}),l?.ok){let e=(o.nodes||[]).find(e=>e.id===n)||null;if(!e&&((0,c.mq)(n)||(0,c.gb)(n)))for(let t=0;t<3;t+=1){if(await new Promise(e=>setTimeout(e,150)),!t6.current)return;let{response:t,data:s}=await eK("/api/provider-nodes");if(!t6.current)return;if(t.ok&&(e=(s.nodes||[]).find(e=>e.id===n)||null))break}R(e)}}catch(e){console.log("Error fetching connections:",e),t6.current&&I("Connections could not be loaded.")}finally{t6.current&&O(!1)}},[n]),sI=async e=>{try{let t=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(R(s.node),await sP(),ec(!1))}catch(e){console.log("Error updating provider node:",e)}},sz=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let i={...a};0===Object.keys(r).length?delete i[n]:i[n]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("Error saving provider strategy:",e)}},sE=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[n]={mode:e}:delete s[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},sR=async(e,t)=>{let s=eq[n];if(!s)return;let a={...to,[e]:t};td(a);try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[s]||{},connections:a};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[s]:t})})).ok)throw Error("Failed to save auto-ping setting")}catch(e){td(to),console.log("Error saving auto-ping config:",e)}},sq=async({reactive:e,schedule:t})=>{let s=eq[n];if(!tu||!s)return;let a={...to,[tu.id]:e},r={...tc,[tu.id]:t};td(a),tm(r);try{let e=await fetch("/api/settings",{cache:"no-store"}),t=e.ok?await e.json():{};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[s]:{...t[s]||{},connections:a,schedules:r}})})).ok)throw Error("Failed to save auto-ping schedule")}catch(e){td(to),tm(tc),console.log("Error saving auto-ping schedule:",e)}};(0,r.useEffect)(()=>{sP(),sT(),sO(),sN()},[sP,sT,sO,sN]),(0,r.useEffect)(()=>(t6.current=!0,()=>{t6.current=!1,null!==t8.current&&window.cancelAnimationFrame(t8.current)}),[]),(0,r.useEffect)(()=>{tj(null),eA({}),eP({}),eF(new Set),th([]),tz({}),tR(null),tP(null),t$(!1),tO(!1),tq.current=!0,tB("")},[n]),(0,r.useEffect)(()=>{tH(1),t0(1),tQ("all"),tX("")},[n]),(0,r.useEffect)(()=>{tH(1)},[tV,tW,tZ]),(0,r.useEffect)(()=>{ew(!1)},[n]),(0,r.useEffect)(()=>{t0(1)},[t1,tg.length,sm.length,tb.length]),(0,r.useEffect)(()=>{if("kiro"!==n)return;let e=window.localStorage.getItem(eE),t=!1;return(async()=>{try{if(tB(""),tL?.jobId)return;let a=await eL();if(!t&&a.res.ok&&a.data?.job){tK(a.data.job),t4.current=a.data.job.summary?.success||0,window.localStorage.setItem(eE,a.data.job.jobId);return}if(e){var s;let a=await eU(e);if(!t&&a?.res.ok&&a.data?.job&&(s=a.data.job.status,["queued","running","needs_manual"].includes(s))){tK(a.data.job),t4.current=a.data.job.summary?.success||0;return}st(),tB(eR)}}catch{t||tB(eR)}})(),()=>{t=!0}},[st,tL?.jobId,n]),(0,r.useEffect)(()=>{if(!("kiro"!==n||!tL?.jobId||e_(tL.status)))return(0,j.M)(async e=>{let t=await eU(tL.jobId);if(!e()){if(t?.res.ok&&t.data?.job){let s=t.data.job.summary?.success||0;if(s>t4.current&&(t4.current=s,await sP(),e()))return;tB(""),tK(t.data.job);return}if(t?.res.status===404){let t=await eL();if(e())return;if(t.res.ok&&t.data?.job){let s=t.data.job.summary?.success||0;if(s>t4.current&&(t4.current=s,await sP(),e()))return;tB(""),tK(t.data.job),window.localStorage.setItem(eE,t.data.job.jobId);return}st(),tB(eR)}}},2e3)},[st,sP,tL?.jobId,tL?.status,n]),(0,r.useEffect)(()=>{let e=(c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n])?.modelsFetcher;e&&g(e).then(th)},[n]);let sM=async(e,t,s=su)=>{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 sT();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},sD=async(e,t="llm")=>{try{let s=new URLSearchParams({providerAlias:sj,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await sO(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},s_=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await sT()}catch(e){console.log("Error deleting alias:",e)}},sU=async()=>{if(t_)return;let e=m.find(e=>!1!==e.isActive);if(!e)return void alert((0,b.Tl)("Please add an active Qoder connection first"));tU(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,b.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,b.Tl)("No models returned"));let r={...ef},i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,""),a=`${sj}/${s}`;!Object.values(r).includes(a)&&(r[s]||(await sM(s,s,sj),r[s]=a,i+=1))}0===i?alert((0,b.Tl)("All models already exist, no new models added")):alert((0,b.Tl)("Successfully added")+` ${i} `+(0,b.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,b.Tl)("Error fetching models")+": "+e.message)}finally{tU(!1)}},sL=async()=>{let e=[...m];if(tS||0===e.length)return;let t=Object.fromEntries(e.map(e=>[e.id,{state:"queued",error:null}]));tq.current=!1,t$(!0),tO(!1),tP(null),tz(t),tR({total:e.length,completed:0,passed:0,failed:0,stopped:!1});let s=0,a=0;try{for(let t=0;t<e.length;t+=1){if(tq.current){tR({total:e.length,completed:t,passed:s,failed:a,stopped:!0});break}let r=e[t];if(!t7.current.some(e=>e.id===r.id)){tz(e=>({...e,[r.id]:{state:"skipped",error:null}})),tR({total:e.length,completed:t+1,passed:s,failed:a,stopped:!1});continue}tP(r.id),tz(e=>({...e,[r.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${r.id}/test`,{method:"POST"}),t=await e.json(),i=!!t.valid;i?s+=1:a+=1,tz(e=>({...e,[r.id]:{state:i?"success":"failed",error:i?t.warning||null:t.error||null}}))}catch(e){a+=1,tz(t=>({...t,[r.id]:{state:"failed",error:e.message||"Test failed"}}))}tR({total:e.length,completed:t+1,passed:s,failed:a,stopped:!1}),t<e.length-1&&await new Promise(e=>setTimeout(e,250))}}finally{tP(null),t$(!1),tO(!1),tq.current=!1}},sK=async e=>{tj({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{tj(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&f(m.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},sF=()=>{sP(),U(!1)},sB=(0,r.useCallback)(e=>{(tK(e),tB(""),e?.jobId)?(window.localStorage.setItem(eE,e.jobId),t4.current=Math.max(t4.current,e.summary?.success||0)):st()},[st]),sJ=async e=>{ei("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await sP(),ea(!1);return}ei(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),ei("Failed to save connection")}},sH=async e=>{try{(await fetch(`/api/providers/${eh.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await sP(),eo(!1))}catch(e){console.log("Error updating connection:",e)}},sW=async(e,t)=>{try{let s=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(s.ok){let a=await s.json().catch(()=>null);f(s=>s.map(s=>s.id===e?{...s,isActive:t,...a?.connection||{}}:s))}}catch(e){console.log("Error updating connection status:",e)}},sG=async(e,t)=>{let s=[...m];[s[e],s[t]]=[s[t],s[e]],f(s);try{let[a,r]=await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e+1})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t+1})})]);a.ok&&r.ok||(console.log("Priority swap rejected:",a.status,r.status),await sP())}catch(e){console.log("Error swapping priority:",e),await sP()}},sV=(0,r.useMemo)(()=>{let e=tZ.trim().toLowerCase();return m.filter(t=>!!(0,v.i2)(t,tV)&&(!e||[t.name,t.email,t.id,t.account,t.username,t.label,t.authType,t.notes,t.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(e)))},[m,tV,tZ]),sQ=(0,r.useMemo)(()=>v.gJ.reduce((e,t)=>(e[t.id]="all"===t.id?m.length:m.filter(e=>(0,v.i2)(e,t.id)).length,e),{}),[m]),sZ=e3.filter(e=>m.some(t=>t.id===e)),sX=m.filter(e=>sZ.includes(e.id)),sY="codebuddy"===n||"codebuddy-cn"===n?(sX.length>0?sX:m).map(e=>e.id):[],s0=sV.length>0&&sV.every(e=>sZ.includes(e.id)),s1=e=>{switch(e){case"oauth":if("antigravity"===n&&"true"!==window.localStorage.getItem(se)){tC(e),tw(!0);return}ss();return;case"apikey":ei(""),ea(!0);return;case"cookie":W(!0);return;case"quota-cookie":m.length>1&&0===sX.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):X(!0);return;default:t9(`Unsupported connection method: ${e}`,"Add Connection")}},s2=e=>{null!==t8.current&&window.cancelAnimationFrame(t8.current),t8.current=window.requestAnimationFrame(()=>{t8.current=null,s1(e)})},s5=()=>{"specialized"===sg.type?ss():"method"===sg.type?s1(sg.methodId):"chooser"===sg.type&&ee(!0)},s3=e=>{ee(!1),s2(e)},s4=(()=>{if(0===sX.length)return"";let e=new Set(sX.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=q.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),s7=()=>{e8||ep(!1)},s6=async e=>{e9(!0);try{let t=0,s=0,a=Array.from({length:Math.min(8,e.length)},async()=>{for(;s<e.length;){let a=s;s+=1;let{connectionId:r,proxyPoolId:i}=e[a];try{(await fetch(`/api/providers/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",r,e),t+=1}}});await Promise.all(a),t>0&&alert(`Updated with ${t} failed request(s).`),await sP(),ep(!1)}finally{e9(!1)}},s8=e=>s6(sX.map(t=>({connectionId:t.id,proxyPoolId:e}))),s9=e=>{let t="gsuite"===e?"GSuite (non-Gmail)":"Gmail (@gmail.com)";tj({title:`Delete ${t}`,message:`Delete ALL ${t} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{tj(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:sr?.id||n,emailFilter:e})})).ok&&(e4([]),await sP())}catch(e){console.error("bulk delete error:",e)}}})},ae=Math.max(1,Math.ceil(sV.length/tW)),at=Math.min(tJ,ae),as=sV.slice((at-1)*tW,at*tW),aa=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:as.map((e,t)=>{let s,r=m.findIndex(t=>t.id===e.id);return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,sZ.includes(s)),onChange:()=>{var t;return t=e.id,void e4(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${e.name||e.email||e.id}`})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(D,{connection:e,proxyPools:q,isOAuth:sn,isFirst:0===r,isLast:r===m.length-1,onMoveUp:()=>sG(r,r-1),onMoveDown:()=>sG(r,r+1),onToggleActive:t=>sW(e.id,t),autoPingEnabled:!0===to[e.id],onToggleAutoPing:eq[n]&&"oauth"===e.authType?t=>sR(e.id,t):void 0,autoPingScheduled:tc[e.id]?.enabled===!0,onOpenAutoPingSchedule:eq[n]&&"oauth"===e.authType?()=>tx(e):void 0,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&f(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:()=>{eb(e),eo(!0)},onDelete:()=>sK(e.id),oneByOneStatus:tI[e.id]||null})})]},e.id)})}),ar=q.filter(e=>!0===e.isActive),ai=(0,a.jsx)(d.aF,{isOpen:ex,onClose:s7,title:`Apply Proxy (${sX.length} selected)`,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=q.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):s6(sX.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:e8||0===ar.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:()=>s8(null),disabled:e8,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)"})]}),q.map(e=>(0,a.jsxs)("button",{onClick:()=>s8(e.id),disabled:e8||!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))]}),e8&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:s7,variant:"ghost",fullWidth:!0,disabled:e8,children:"Cancel"})]})}),an=async e=>{eF(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${sj}/${e}`})}),s=await t.json();eA(t=>({...t,[e]:s.ok?"ok":"error"})),eP(t=>({...t,[e]:s.ok?"":s.error||"Model not reachable"}))}catch{eA(t=>({...t,[e]:"error"})),eP(t=>({...t,[e]:"Network error"}))}finally{eF(t=>{let s=new Set(t);return s.delete(e),s})}};return A?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):sr?(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)(l(),{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:`${sr.color}15`},children:ek?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:sr.color},children:sr.textIcon||sr.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.A,{src:sx&&sr.apiType?"responses"===sr.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":sp?"/providers/anthropic-m.png":`/providers/${sr.id}.png`,alt:sr.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ew(!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:sr.name}),(sr.notice?.apiKeyUrl||sr.notice?.signupUrl||sr.website)&&(0,a.jsxs)("a",{href:sr.notice?.apiKeyUrl||sr.notice?.signupUrl||sr.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"}),sr.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[m.length," connection",1===m.length?"":"s"]})]})]})]}),sr.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:sr.deprecationNotice})]}),sr.notice?.text&&!sr.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:sr.notice.text}),sr.notice.apiKeyUrl&&(0,a.jsx)("a",{href:sr.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 →"})]}),sh&&E&&(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:sp?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[sp?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",sp?"messages":"responses"===E.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:()=>{ei(""),ea(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ec(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{tj({title:"Delete Compatible Node",message:`Delete this ${sp?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{tj(null);try{(await fetch(`/api/provider-nodes/${n}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),so?(0,a.jsx)(d.gw,{providerId:n}):(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:[m.length>0&&q.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===sX.length)return;let e=[...new Set(sX.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"))];e6(1===e.length?e[0]:"__none__"),ep(!0)},disabled:0===sX.length,children:"Apply Proxy"}),m.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:sL,disabled:tS,children:tS?"Testing Connection One-by-One...":"Test Connection One-by-One"}),tS&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{tS&&(tq.current=!0,tO(!0))},disabled:tA,children:tA?"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"===ts,onChange:e=>{let t=e?"round-robin":null,s=e?tr||"1":tr;e&&!tr&&ti("1"),tD.current=s,tM.current&&(clearTimeout(tM.current),tM.current=null),ta(t),sz(t,s)}}),"round-robin"===ts&&(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:tr,onChange:e=>{var t;ti(t=e.target.value),tD.current=t,tM.current&&clearTimeout(tM.current),tM.current=setTimeout(()=>{sz("round-robin",tD.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),m.length>0&&(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:s0,onChange:()=>{s0?e4(e=>e.filter(e=>!sV.some(t=>t.id===e))):e4(e=>Array.from(new Set([...e,...sV.map(e=>e.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),s0?"Unselect visible":"Select visible"]}),(0,a.jsxs)(d.Ex,{variant:"default",children:[sV.length," visible"]}),sX.length>0&&(0,a.jsxs)(d.Ex,{variant:"default",children:[sX.length," selected"]}),s4&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:s4}),sX.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>{e4([]),e6("__none__")},children:"Clear"}),sX.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==sX.length&&tj({title:"Delete Selected Connections",message:`Delete ${sX.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{tj(null);let e=[],t=0;for(let s of sX)try{(await fetch(`/api/providers/${s.id}`,{method:"DELETE"})).ok?e.push(s.id):t+=1}catch(e){console.log("Error deleting selected connection:",e),t+=1}e4(t=>t.filter(t=>!e.includes(t))),t>0&&alert(`Deleted ${e.length} connection(s); ${t} failed.`),await sP()}})},children:["Delete Selected (",sX.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>s9("gsuite"),children:"Delete GSuite"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>s9("gmail"),children:"Delete Gmail"})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:v.gJ.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>tQ(e.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${tV===e.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[e.label,(0,a.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:sQ[e.id]||0})]},e.id))}),m.length>=20&&(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,a.jsx)("input",{type:"search",value:tZ,onChange:e=>tX(e.target.value),placeholder:`Search ${m.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),P?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:P})]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{O(!0),sP()},children:"Retry"})]}):0===m.length?(0,a.jsxs)(a.Fragment,{children:[(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:sn?"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"}),"kiro"!==n&&sf.some(e=>"oauth"===e.id)&&sf.some(e=>"apikey"===e.id)?(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",sf.find(e=>"oauth"===e.id)?.label||"OAuth"," or ",sf.find(e=>"apikey"===e.id)?.label||"API Key","."]}):sf.length>1?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add Connection lists every available authentication method."}):null]})]}),(0,a.jsx)(eC,{showAutomation:sb,showAddConnection:"none"!==sg.type,onOpenAutomation:sa,onAddConnection:s5,methods:"kiro"===n?null:sy,onSelectMethod:"kiro"===n?null:s3,extra:eM(n)?(0,a.jsx)(eD,{providerId:n,onWebLoginConnected:sP,onBulkImport:()=>"codex"===n?K(!0):B(!0)}):null})]}),"kiro"===n&&tL?.jobId&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",tL.status," | Success: ",tL.summary?.success||0," | Running: ",tL.summary?.running||0," | Queued: ",tL.summary?.queued||0]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>s.push(x("kiro")),children:"Resume Bulk Progress"}),e_(tL.status)&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"close",onClick:st,children:"Clear"})]})]}),"kiro"===n&&!tL?.jobId&&tF&&(0,a.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:tF})]}):(0,a.jsxs)(a.Fragment,{children:[tE&&(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: ",tE.total]}),(0,a.jsxs)("span",{children:["Completed: ",tE.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tE.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tE.failed]}),tE.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),tS&&tT&&(0,a.jsxs)("span",{children:["Running: ",m.find(e=>e.id===tT)?.name||tT]})]})}),"kiro"===n&&tL?.jobId&&(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",tL.status," | Success: ",tL.summary?.success||0," | Running: ",tL.summary?.running||0," | Queued: ",tL.summary?.queued||0]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>s.push(x("kiro")),children:"Resume Bulk Progress"}),e_(tL.status)&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"close",onClick:st,children:"Clear"})]})]}),"kiro"===n&&!tL?.jobId&&tF&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:tF}),aa,"kiro"===n&&ae>1&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",at," of ",ae," • Showing ",(at-1)*tW+1,"-",Math.min(at*tW,sV.length)," of ",sV.length," connections"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",disabled:at<=1,onClick:()=>tH(e=>Math.max(1,e-1)),children:"Previous"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",disabled:at>=ae,onClick:()=>tH(e=>Math.min(ae,e+1)),children:"Next"})]})]}),"kiro"!==n&&sV.length>0&&(0,a.jsx)(d.dK,{currentPage:at,pageSize:tW,totalItems:sV.length,onPageChange:tH,onPageSizeChange:e=>{tG(e),tH(1)},className:"mt-2"}),m.length>0&&0===sV.length&&(0,a.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(eC,{showAutomation:sb,showAddConnection:"none"!==sg.type,onOpenAutomation:sa,onAddConnection:s5,methods:"kiro"===n?null:sy,onSelectMethod:"kiro"===n?null:s3,extra:eM(n)?(0,a.jsx)(eD,{providerId:n,onWebLoginConnected:sP,onBulkImport:()=>"codex"===n?K(!0):B(!0)}):null})})]})]}),(0,a.jsx)(eI,{providerId:n}),(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.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),sk&&(0,a.jsx)("select",{value:tn,onChange:e=>{var t;tl(t=e.target.value),sE(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:sk.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!sh&&(e=[...sm,...tb.filter(e=>!sm.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!tg.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[tg.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:sA,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>s$(e),children:"Disable All"})]}))]}),Object.values(eT).some(Boolean)&&(0,a.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(eT).filter(([,e])=>!!e).map(([e,t])=>(0,a.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[e,": ",t]},e))}),(()=>{let e,t,s;if(sh)return(0,a.jsx)(z,{providerStorageAlias:sj,providerDisplayAlias:sw,modelAliases:ef,copied:t5,onCopy:t3,onSetAlias:sM,onDeleteAlias:s_,onAliasesChanged:sT,connections:m,isAnthropic:sp});let r=[...sm,...tb.filter(e=>!sm.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),i=new Set(tg),l=r.filter(e=>!i.has(e.id)),o=r.filter(e=>i.has(e.id)),c=function({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:r="llm",includeLegacyAliases:i=!0}){let n=new Set(a.map(e=>e.id)),l=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(r&&e!==r||n.has(t.id))continue;let a=`${s}/${t.id}`;l.has(a)||(l.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!i)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||l.has(s)||(l.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:r||"llm"}))}return o}({customModels:ev,modelAliases:ef,providerAlias:sj,builtInModels:sm,type:"llm"}),u=Math.min(tY,Math.max(1,Math.ceil(l.length/t1))),x=l.slice((u-1)*t1,u*t1);return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[c.map(e=>(0,a.jsx)(T,{model:{id:e.id,name:e.name},fullModel:`${sw}/${e.id}`,alias:e.alias,copied:t5,onCopy:t3,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?sD(e.id,e.type||"llm"):s_(e.alias)},testStatus:eS[e.id],onTest:m.length>0||so?()=>an(e.id):void 0,isTesting:ez.has(e.id),isCustom:!0,isFree:!1,thinkingSuffix:sv(e.id)},`${e.source}-${e.fullModel}`)),x.map(e=>{let t=`${sj}/${e.id}`,s=`${n}/${e.id}`,r=Object.entries(ef).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(T,{model:e,fullModel:`${sw}/${e.id}`,alias:r,copied:t5,onCopy:t3,onSetAlias:t=>sM(e.id,t,sj),onDeleteAlias:()=>s_(r),testStatus:eS[e.id],onTest:m.length>0||so?()=>an(e.id):void 0,isTesting:ez.has(e.id),isFree:e.isFree,onDisable:()=>sC(e.id),thinkingSuffix:sv(e.id)},e.id)}),l.length>t1&&(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(d.dK,{currentPage:u,pageSize:t1,totalItems:l.length,onPageChange:t0,onPageSizeChange:e=>{t2(e),t0(1)}})}),(0,a.jsxs)("button",{onClick:()=>eJ(!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"]}),"codebuddy"===n&&(0,a.jsxs)("button",{onClick:()=>eW(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-cyan-500/50 px-3 py-2 text-xs text-cyan-700 transition-colors hover:border-cyan-500 hover:bg-cyan-500/[0.07] dark:text-cyan-300 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Discover Models"]}),("codebuddy-intl"===n||"codebuddy-cn"===n)&&(0,a.jsxs)("button",{onClick:()=>eV(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"openrouter"===n&&(0,a.jsxs)("button",{type:"button",onClick:()=>eY(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"opencode"===n&&(0,a.jsxs)("button",{onClick:()=>eZ(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"kiro"===n&&(0,a.jsxs)("button",{onClick:()=>e1(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"cloudflare-ai"===n&&(0,a.jsxs)("button",{onClick:()=>e5(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"qoder"===n&&m.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:sU,disabled:t_,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:t_?{animation:"spin 1s linear infinite"}:void 0,children:t_?"progress_activity":"download"}),t_?(0,b.Tl)("Fetching..."):(0,b.Tl)("Fetch Qoder Models")]}),tp.length>0&&(e=new Set(Object.values(ef)),t=new Set(sm.map(e=>e.id)),0===(s=tp.filter(s=>!e.has(`${sj}/${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()=>{let t=e.id.split("/").pop();await sM(e.id,t,sj)},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:()=>sS(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))})]})]})})()]}),ex&&ai,Y&&(0,a.jsx)(d.mz,{isOpen:!0,providerName:sr.name,methods:sy,onSelect:s3,onClose:()=>ee(!1)}),"codex"===n&&(0,a.jsx)(e$,{isOpen:L,onClose:()=>K(!1),onSuccess:sP}),"grok-cli"===n&&(0,a.jsx)(eO,{isOpen:F,onClose:()=>B(!1),onSuccess:sP}),_&&("kiro"===n?(0,a.jsx)(d.Mh,{isOpen:!0,providerInfo:sr,onSuccess:sF,onRefresh:sP,initialBulkJobId:tL?.jobId||null,onBulkJobChange:sB,onClose:()=>U(!1)}):"cursor"===n?(0,a.jsx)(d.G9,{isOpen:!0,onSuccess:sF,onClose:()=>U(!1)}):"gitlab"===n?(0,a.jsx)(d.vj,{isOpen:!0,providerInfo:sr,onSuccess:sF,onClose:()=>U(!1)}):"xiaomi-mimo"===n?(0,a.jsx)(d.LH,{isOpen:!0,onSuccess:sF,onClose:()=>U(!1)}):(0,a.jsx)(d.LF,{isOpen:!0,provider:n,providerInfo:sr,onSuccess:sF,onClose:()=>U(!1)})),"iflow"===n&&J&&(0,a.jsx)(d.vE,{isOpen:!0,onSuccess:()=>{sP(),W(!1)},onClose:()=>W(!1)}),("codebuddy"===n||"codebuddy-cn"===n)&&G&&(0,a.jsx)(d.xl,{isOpen:!0,connectionIds:sY,endpoint:"codebuddy-cn"===n?"/api/oauth/codebuddy-cn/quota-cookie":"/api/oauth/codebuddy/quota-cookie",onSuccess:()=>{sP(),X(!1)},onClose:()=>X(!1)}),et&&(0,a.jsx)(V,{isOpen:!0,provider:n,providerName:sr.name,isCompatible:sh,isAnthropic:sp,authType:sr?.authType,authHint:sr?.authHint,website:sr?.website,proxyPools:q,existingNames:m.map(e=>e.name).filter(Boolean),error:er,onSave:sJ,onBulkDone:sP,onClose:()=>{ei(""),ea(!1)}}),el&&eh&&(0,a.jsx)(d.wI,{isOpen:!0,connection:eh,proxyPools:q,onSave:sH,onClose:()=>eo(!1)}),sh&&ed&&(0,a.jsx)(Q,{isOpen:!0,node:E,onSave:sI,onClose:()=>ec(!1),isAnthropic:sp}),!sh&&eB&&(0,a.jsx)(Z,{isOpen:!0,providerAlias:sj,providerDisplayAlias:sw,onSave:async e=>{let t=sr?.passthroughModels?e.split("/").pop():e;await sM(e,t,sj),eJ(!1)},onClose:()=>eJ(!1)}),"codebuddy"===n&&eH&&(0,a.jsx)(es,{isOpen:!0,connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,"cb");await sT(),await sO()},onClose:()=>eW(!1)}),("codebuddy-intl"===n||"codebuddy-cn"===n)&&eG&&(0,a.jsx)(en,{isOpen:!0,providerId:n,connections:m,onModelsAdded:async e=>{let t="codebuddy-cn"===n?"cb-cn":"cbai";for(let s of e)await sM(s.id,s.id,t);await sT(),await sO()},onClose:()=>eV(!1)}),"openrouter"===n&&eX&&(0,a.jsx)(eu.A,{isOpen:!0,kind:"llm",connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id.split("/").pop(),"openrouter");await sT(),await sO()},onClose:()=>eY(!1)}),"opencode"===n&&eQ&&(0,a.jsx)(em,{isOpen:!0,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,"oc");await sT(),await sO()},onClose:()=>eZ(!1)}),"kiro"===n&&e0&&(0,a.jsx)(eg,{isOpen:!0,connections:m,onClose:()=>e1(!1)}),"cloudflare-ai"===n&&e2&&(0,a.jsx)(eN,{isOpen:!0,connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,su);await sT()},onClose:()=>e5(!1)}),tu&&(0,a.jsx)(H,{isOpen:!0,connection:tu,reactive:!0===to[tu.id],schedule:tc[tu.id]||null,onClose:()=>tx(null),onSave:sq}),tk&&(0,a.jsx)(d.uo,{isOpen:!0,onClose:()=>tw(!1),onConfirm:()=>{window.localStorage.setItem(se,"true"),tw(!1),tC(null),s2(tN||"oauth")},title:"Risk Notice",message:sr?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),tv&&(0,a.jsx)(d.uo,{isOpen:!0,onClose:()=>{te||tj(null)},onConfirm:async()=>{if(te)return;let e=tv?.onConfirm;if(e){tt(!0);try{await e()}finally{tt(!1)}}},title:tv?.title||"Confirm",message:tv?.message,variant:"danger",loading:te})]}):(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)(l(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}}},e=>{e.O(0,[2574,3862,3745,3416,9501,620,5497,5153,8441,3794,7358],()=>e(e.s=42911)),_N_E=e.O()}]);
15
+ ]`;function eO({isOpen:e,onClose:t,onSuccess:s}){let[i,n]=(0,r.useState)(""),[l,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(null),u=()=>{l||(m(null),t())},x=async()=>{let e;try{e=JSON.parse(i)}catch{m({error:"Paste a JSON account or an array of accounts"});return}o(!0),m(null);try{let t=await fetch("/api/oauth/grok-cli/json-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();m(a.error?{error:a.error}:a),!a.error&&a.success>0&&s?.()}catch(e){m({error:e.message})}finally{o(!1)}},p=c&&!c.error?`Imported ${c.success}. Failed ${c.failed}.`:null;return(0,a.jsxs)(d.aF,{isOpen:e,onClose:u,title:"Import Grok CLI accounts",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:u,disabled:l,children:"Close"}),(0,a.jsx)(d.$n,{onClick:x,disabled:l||!i.trim(),children:l?"Importing...":"Import"})]}),children:[(0,a.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Paste one account or an array. Snake_case and camelCase are both accepted. A refresh token is refreshed before it is stored. The response never returns the tokens. Line import stays on the automation page."}),(0,a.jsx)("textarea",{className:"w-full rounded-lg border border-border bg-background p-3 font-mono text-xs text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none",rows:8,placeholder:eA,value:i,onChange:e=>n(e.target.value),disabled:l}),c?(0,a.jsx)("div",{className:`mt-3 rounded-lg p-3 text-xs ${c.error?"bg-red-500/10 text-red-400":"bg-green-500/10 text-green-400"}`,children:c.error||p}):null]})}eO.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func};let eT=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],eP=/^[A-Za-z0-9-]+$/;function eI({providerId:e}){let t=(0,S.i)(),[s,i]=(0,r.useState)(!1),[n,l]=(0,r.useState)([{name:"",value:""}]),[o,c]=(0,r.useState)({}),[m,u]=(0,r.useState)(!1),[x,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));c(s),l(a.length?a:[{name:"",value:""}]),u(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{l(a=>a.map((a,r)=>r===e?{...a,[t]:s}:a))},b=(0,r.useCallback)(async()=>{let s={};for(let e of n.filter(e=>e.name.trim())){let a=e.name.trim();if(!eP.test(a))return void t.error(`Invalid header name: ${a}`);if(eT.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}p(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}u(Object.keys(s).length>0),t.success("Custom headers saved")}finally{p(!1)}},[n,o,e,t]);return 0!==Object.keys(o).length||m?(0,a.jsxs)(d.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,a.jsx)(d.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:n.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>l(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>l(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:x,onClick:()=>{l(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,a.jsx)("button",{type:"button",disabled:x,onClick:b,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:x?"Saving...":"Save"})]})]})]})]}):null}eI.propTypes={providerId:O().string.isRequired};var ez=s(5539);let eE="kiro-bulk-import-active-job",eR="Bulk import progress expired or was cleared.",eq={claude:"claudeAutoPing",codex:"codexAutoPing"};function eM(e){return ez.w.has(e)||"codex"===e||"grok-cli"===e}function eD({providerId:e,onWebLoginConnected:t,onBulkImport:s}){let r=[];return(ez.w.has(e)&&r.push((0,a.jsx)(ez.A,{providerId:e,onConnected:t},"web-login")),("codex"===e||"grok-cli"===e)&&r.push((0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:s,className:"w-full sm:w-auto",children:"Bulk Add"},"bulk-add")),r.length)?(0,a.jsx)(a.Fragment,{children:r}):null}function e_(e){return["completed","cancelled","failed"].includes(e)}async function eU(e){if(!e)return null;let t=await fetch(`/api/oauth/kiro/bulk-import/${e}`,{cache:"no-store"}),s=await t.json();return{res:t,data:s}}async function eL(e="active"){let t=await fetch(`/api/oauth/kiro/bulk-import/latest?scope=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();return{res:t,data:s}}async function eK(e){let t=new AbortController,s=window.setTimeout(()=>t.abort(),8e3);try{let s=await fetch(e,{cache:"no-store",signal:t.signal}),a=null;try{a=await s.json()}catch{a=null}return{response:s,data:a}}finally{window.clearTimeout(s)}}function eF(){let e,t=(0,i.useParams)(),s=(0,i.useRouter)(),n=t.id,[m,f]=(0,r.useState)([]),[A,O]=(0,r.useState)(!0),[P,I]=(0,r.useState)(""),[E,R]=(0,r.useState)(null),[q,M]=(0,r.useState)([]),[_,U]=(0,r.useState)(!1),[L,K]=(0,r.useState)(!1),[F,B]=(0,r.useState)(!1),[J,W]=(0,r.useState)(!1),[G,X]=(0,r.useState)(!1),[Y,ee]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(""),[el,eo]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[ex,ep]=(0,r.useState)(!1),[eh,eb]=(0,r.useState)(null),[ef,ey]=(0,r.useState)({}),[ev,ej]=(0,r.useState)([]),[ek,ew]=(0,r.useState)(!1),[eS,eA]=(0,r.useState)({}),[eT,eP]=(0,r.useState)({}),[ez,eF]=(0,r.useState)(()=>new Set),[eB,eJ]=(0,r.useState)(!1),[eH,eW]=(0,r.useState)(!1),[eG,eV]=(0,r.useState)(!1),[eQ,eZ]=(0,r.useState)(!1),[eX,eY]=(0,r.useState)(!1),[e0,e1]=(0,r.useState)(!1),[e2,e5]=(0,r.useState)(!1),[e3,e4]=(0,r.useState)([]),[e7,e8]=(0,r.useState)("__none__"),[e6,e9]=(0,r.useState)(!1),[te,tt]=(0,r.useState)(!1),[ts,ta]=(0,r.useState)(null),[tr,ti]=(0,r.useState)(""),[tn,tl]=(0,r.useState)("auto"),[to,td]=(0,r.useState)({}),[tc,tm]=(0,r.useState)({}),[tu,tx]=(0,r.useState)(null),[tp,th]=(0,r.useState)([]),[tb,tf]=(0,r.useState)([]),[tg,ty]=(0,r.useState)([]),[tv,tj]=(0,r.useState)(null),[tk,tw]=(0,r.useState)(!1),[tN,tC]=(0,r.useState)(null),[tS,t$]=(0,r.useState)(!1),[tA,tO]=(0,r.useState)(!1),[tT,tP]=(0,r.useState)(null),[tI,tz]=(0,r.useState)({}),[tE,tR]=(0,r.useState)(null),tq=(0,r.useRef)(!1),tM=(0,r.useRef)(null),tD=(0,r.useRef)("1"),[t_,tU]=(0,r.useState)(!1),[tL,tK]=(0,r.useState)(null),[tF,tB]=(0,r.useState)(""),[tJ,tH]=(0,r.useState)(1),[tW,tG]=(0,r.useState)(20),[tV,tQ]=(0,r.useState)("all"),[tZ,tX]=(0,r.useState)(""),[tY,t0]=(0,r.useState)(1),[t1,t2]=(0,r.useState)(20),{copied:t5,copy:t3}=(0,h.C)(),t4=(0,r.useRef)(0),t7=(0,r.useRef)([]),t8=(0,r.useRef)(!0),t6=(0,r.useRef)(null),t9=(0,S.i)(e=>e.error),se="ag_risk_confirmed",st=(0,r.useCallback)(()=>{tK(null),tB(""),t4.current=0,window.localStorage.removeItem(eE)},[]),ss=()=>{U(!0)},sa=()=>{"kiro"===n&&tL?.jobId&&e_(tL.status)&&st(),s.push(x(n))},sr=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type}:c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n]||c.br[n],si=sr?.authModes||[],sn=!!c.zN[n]||!!c.IS[n]||si.includes("oauth"),sl=!!c.fg[n]||si.includes("apikey"),so=!!c.IS[n]?.noAuth,sd=(0,y.F)("kiro"===n),sc=(0,p.KC)(n),sm="kiro"===n?sd:sc,su=(0,c.wG)(n),sx=(0,c.mq)(n),sp=(0,c.gb)(n),sh=sx||sp,sb=u(n),sf=function({providerId:e,providerInfo:t,isOAuth:s,supportsApiKeyAuth:a,isCompatible:r}){if(!t||t.noAuth||t.authModes?.includes("none"))return[];let i=[];for(let n of(s&&C(i,"oauth"),(a||r||"cookie"===t.authType||!s)&&C(i,"apikey"),w[e]||[]))C(i,n);return i.map(t=>{let s=k[t];return s?{...s,...N[e]?.[t]}:null}).filter(Boolean)}({providerId:n,providerInfo:sr,isOAuth:sn,supportsApiKeyAuth:sl,isCompatible:sx||sp}),sg=function(e,{specializedChooser:t=!1}={}){return e.length?t?{type:"specialized"}:1===e.length?{type:"method",methodId:e[0].id}:{type:"chooser"}:{type:"none"}}(sf,{specializedChooser:"kiro"===n}),sy=sf.map(e=>"quota-cookie"===e.id&&0===m.length?{...e,disabled:!0,description:"Add a CodeBuddy connection before attaching its quota cookie."}:e),sv=e=>{if(!tn||"auto"===tn)return null;let t=(0,$.kl)(n,e);return t&&t.includes(tn)?tn:null},sj=sh?n:su,sk=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=(0,$.kl)(n,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of sm)s(e.id);for(let e of tb)s(e.id);for(let e of ev)e.providerAlias===sj&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),sw=sh?E?.prefix||n:su,sN=(0,r.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}`,{cache:"no-store"}),t=await e.json();e.ok&&ty(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[sj]),sC=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:sj,ids:[e]})})).ok&&await sN()}catch(e){console.log("Error disabling model:",e)}},sS=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await sN()}catch(e){console.log("Error enabling model:",e)}},s$=async e=>{e.length&&tj({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{tj(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:sj,ids:e})})).ok&&await sN()}catch(e){console.log("Error disabling all models:",e)}}})},sA=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(sj)}`,{method:"DELETE"})).ok&&await sN()}catch(e){console.log("Error enabling all models:",e)}},sO=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ej(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]),sT=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ey(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,r.useEffect)(()=>{"kilocode"===n&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&tf(e.models)}).catch(()=>{})},[n]);let sP=(0,r.useCallback)(async()=>{try{I("");let[e,t,s,a]=await Promise.allSettled([eK("/api/providers"),eK("/api/provider-nodes"),eK("/api/proxy-pools?isActive=true"),eK("/api/settings")]),r="fulfilled"===e.status?e.value.response:null,i="fulfilled"===e.status?e.value.data:{},l="fulfilled"===t.status?t.value.response:null,o="fulfilled"===t.status?t.value.data:{},d="fulfilled"===s.status?s.value.response:null,m="fulfilled"===s.status?s.value.data:{},u="fulfilled"===a.status?a.value.response:null,x=u?.ok&&a.value.data||{};if(r?.ok){let e=(i.connections||[]).filter(e=>e.provider===n);t7.current=e,f(e)}else I("Connections could not be loaded.");d?.ok&&M(m.proxyPools||[]);let p=(x.providerStrategies||{})[n]||{};ta(p.fallbackStrategy||null),ti(null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1"),tD.current=null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1";let h=(x.providerThinking||{})[n]||{};tl(h.mode||"auto");let b=eq[n];if(td(b&&x?.[b]?.connections||{}),tm(b&&x?.[b]?.schedules||{}),l?.ok){let e=(o.nodes||[]).find(e=>e.id===n)||null;if(!e&&((0,c.mq)(n)||(0,c.gb)(n)))for(let t=0;t<3;t+=1){if(await new Promise(e=>setTimeout(e,150)),!t8.current)return;let{response:t,data:s}=await eK("/api/provider-nodes");if(!t8.current)return;if(t.ok&&(e=(s.nodes||[]).find(e=>e.id===n)||null))break}R(e)}}catch(e){console.log("Error fetching connections:",e),t8.current&&I("Connections could not be loaded.")}finally{t8.current&&O(!1)}},[n]),sI=async e=>{try{let t=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(R(s.node),await sP(),ec(!1))}catch(e){console.log("Error updating provider node:",e)}},sz=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let i={...a};0===Object.keys(r).length?delete i[n]:i[n]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("Error saving provider strategy:",e)}},sE=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[n]={mode:e}:delete s[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},sR=async(e,t)=>{let s=eq[n];if(!s)return;let a={...to,[e]:t};td(a);try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[s]||{},connections:a};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[s]:t})})).ok)throw Error("Failed to save auto-ping setting")}catch(e){td(to),console.log("Error saving auto-ping config:",e)}},sq=async({reactive:e,schedule:t})=>{let s=eq[n];if(!tu||!s)return;let a={...to,[tu.id]:e},r={...tc,[tu.id]:t};td(a),tm(r);try{let e=await fetch("/api/settings",{cache:"no-store"}),t=e.ok?await e.json():{};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[s]:{...t[s]||{},connections:a,schedules:r}})})).ok)throw Error("Failed to save auto-ping schedule")}catch(e){td(to),tm(tc),console.log("Error saving auto-ping schedule:",e)}};(0,r.useEffect)(()=>{sP(),sT(),sO(),sN()},[sP,sT,sO,sN]),(0,r.useEffect)(()=>(t8.current=!0,()=>{t8.current=!1,null!==t6.current&&window.cancelAnimationFrame(t6.current)}),[]),(0,r.useEffect)(()=>{tj(null),eA({}),eP({}),eF(new Set),th([]),tz({}),tR(null),tP(null),t$(!1),tO(!1),tq.current=!0,tB("")},[n]),(0,r.useEffect)(()=>{tH(1),t0(1),tQ("all"),tX("")},[n]),(0,r.useEffect)(()=>{tH(1)},[tV,tW,tZ]),(0,r.useEffect)(()=>{ew(!1)},[n]),(0,r.useEffect)(()=>{t0(1)},[t1,tg.length,sm.length,tb.length]),(0,r.useEffect)(()=>{if("kiro"!==n)return;let e=window.localStorage.getItem(eE),t=!1;return(async()=>{try{if(tB(""),tL?.jobId)return;let a=await eL();if(!t&&a.res.ok&&a.data?.job){tK(a.data.job),t4.current=a.data.job.summary?.success||0,window.localStorage.setItem(eE,a.data.job.jobId);return}if(e){var s;let a=await eU(e);if(!t&&a?.res.ok&&a.data?.job&&(s=a.data.job.status,["queued","running","needs_manual"].includes(s))){tK(a.data.job),t4.current=a.data.job.summary?.success||0;return}st(),tB(eR)}}catch{t||tB(eR)}})(),()=>{t=!0}},[st,tL?.jobId,n]),(0,r.useEffect)(()=>{if(!("kiro"!==n||!tL?.jobId||e_(tL.status)))return(0,j.M)(async e=>{let t=await eU(tL.jobId);if(!e()){if(t?.res.ok&&t.data?.job){let s=t.data.job.summary?.success||0;if(s>t4.current&&(t4.current=s,await sP(),e()))return;tB(""),tK(t.data.job);return}if(t?.res.status===404){let t=await eL();if(e())return;if(t.res.ok&&t.data?.job){let s=t.data.job.summary?.success||0;if(s>t4.current&&(t4.current=s,await sP(),e()))return;tB(""),tK(t.data.job),window.localStorage.setItem(eE,t.data.job.jobId);return}st(),tB(eR)}}},2e3)},[st,sP,tL?.jobId,tL?.status,n]),(0,r.useEffect)(()=>{let e=(c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n])?.modelsFetcher;e&&g(e).then(th)},[n]);let sM=async(e,t,s=su)=>{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 sT();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},sD=async(e,t="llm")=>{try{let s=new URLSearchParams({providerAlias:sj,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await sO(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},s_=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await sT()}catch(e){console.log("Error deleting alias:",e)}},sU=async()=>{if(t_)return;let e=m.find(e=>!1!==e.isActive);if(!e)return void alert((0,b.Tl)("Please add an active Qoder connection first"));tU(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,b.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,b.Tl)("No models returned"));let r={...ef},i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,""),a=`${sj}/${s}`;!Object.values(r).includes(a)&&(r[s]||(await sM(s,s,sj),r[s]=a,i+=1))}0===i?alert((0,b.Tl)("All models already exist, no new models added")):alert((0,b.Tl)("Successfully added")+` ${i} `+(0,b.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,b.Tl)("Error fetching models")+": "+e.message)}finally{tU(!1)}},sL=async()=>{let e=[...m];if(tS||0===e.length)return;let t=Object.fromEntries(e.map(e=>[e.id,{state:"queued",error:null}]));tq.current=!1,t$(!0),tO(!1),tP(null),tz(t),tR({total:e.length,completed:0,passed:0,failed:0,stopped:!1});let s=0,a=0;try{for(let t=0;t<e.length;t+=1){if(tq.current){tR({total:e.length,completed:t,passed:s,failed:a,stopped:!0});break}let r=e[t];if(!t7.current.some(e=>e.id===r.id)){tz(e=>({...e,[r.id]:{state:"skipped",error:null}})),tR({total:e.length,completed:t+1,passed:s,failed:a,stopped:!1});continue}tP(r.id),tz(e=>({...e,[r.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${r.id}/test`,{method:"POST"}),t=await e.json(),i=!!t.valid;i?s+=1:a+=1,tz(e=>({...e,[r.id]:{state:i?"success":"failed",error:i?t.warning||null:t.error||null}}))}catch(e){a+=1,tz(t=>({...t,[r.id]:{state:"failed",error:e.message||"Test failed"}}))}tR({total:e.length,completed:t+1,passed:s,failed:a,stopped:!1}),t<e.length-1&&await new Promise(e=>setTimeout(e,250))}}finally{tP(null),t$(!1),tO(!1),tq.current=!1}},sK=async e=>{tj({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{tj(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&f(m.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},sF=()=>{sP(),U(!1)},sB=(0,r.useCallback)(e=>{(tK(e),tB(""),e?.jobId)?(window.localStorage.setItem(eE,e.jobId),t4.current=Math.max(t4.current,e.summary?.success||0)):st()},[st]),sJ=async e=>{ei("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await sP(),ea(!1);return}ei(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),ei("Failed to save connection")}},sH=async e=>{try{(await fetch(`/api/providers/${eh.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await sP(),eo(!1))}catch(e){console.log("Error updating connection:",e)}},sW=async(e,t)=>{try{let s=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(s.ok){let a=await s.json().catch(()=>null);f(s=>s.map(s=>s.id===e?{...s,isActive:t,...a?.connection||{}}:s))}}catch(e){console.log("Error updating connection status:",e)}},sG=async(e,t)=>{let s=[...m];[s[e],s[t]]=[s[t],s[e]],f(s);try{let[a,r]=await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e+1})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t+1})})]);a.ok&&r.ok||(console.log("Priority swap rejected:",a.status,r.status),await sP())}catch(e){console.log("Error swapping priority:",e),await sP()}},sV=(0,r.useMemo)(()=>{let e=tZ.trim().toLowerCase();return m.filter(t=>!!(0,v.i2)(t,tV)&&(!e||[t.name,t.email,t.id,t.account,t.username,t.label,t.authType,t.notes,t.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(e)))},[m,tV,tZ]),sQ=(0,r.useMemo)(()=>v.gJ.reduce((e,t)=>(e[t.id]="all"===t.id?m.length:m.filter(e=>(0,v.i2)(e,t.id)).length,e),{}),[m]),sZ=e3.filter(e=>m.some(t=>t.id===e)),sX=m.filter(e=>sZ.includes(e.id)),sY="codebuddy"===n||"codebuddy-cn"===n?(sX.length>0?sX:m).map(e=>e.id):[],s0=sV.length>0&&sV.every(e=>sZ.includes(e.id)),s1=e=>{switch(e){case"oauth":if("antigravity"===n&&"true"!==window.localStorage.getItem(se)){tC(e),tw(!0);return}ss();return;case"apikey":ei(""),ea(!0);return;case"cookie":W(!0);return;case"quota-cookie":m.length>1&&0===sX.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):X(!0);return;default:t9(`Unsupported connection method: ${e}`,"Add Connection")}},s2=e=>{null!==t6.current&&window.cancelAnimationFrame(t6.current),t6.current=window.requestAnimationFrame(()=>{t6.current=null,s1(e)})},s5=()=>{"specialized"===sg.type?ss():"method"===sg.type?s1(sg.methodId):"chooser"===sg.type&&ee(!0)},s3=e=>{ee(!1),s2(e)},s4=(()=>{if(0===sX.length)return"";let e=new Set(sX.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=q.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),s7=()=>{e6||ep(!1)},s8=async e=>{e9(!0);try{let t=0,s=0,a=Array.from({length:Math.min(8,e.length)},async()=>{for(;s<e.length;){let a=s;s+=1;let{connectionId:r,proxyPoolId:i}=e[a];try{(await fetch(`/api/providers/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",r,e),t+=1}}});await Promise.all(a),t>0&&alert(`Updated with ${t} failed request(s).`),await sP(),ep(!1)}finally{e9(!1)}},s6=e=>s8(sX.map(t=>({connectionId:t.id,proxyPoolId:e}))),s9=e=>{let t="gsuite"===e?"GSuite (non-Gmail)":"Gmail (@gmail.com)";tj({title:`Delete ${t}`,message:`Delete ALL ${t} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{tj(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:sr?.id||n,emailFilter:e})})).ok&&(e4([]),await sP())}catch(e){console.error("bulk delete error:",e)}}})},ae=Math.max(1,Math.ceil(sV.length/tW)),at=Math.min(tJ,ae),as=sV.slice((at-1)*tW,at*tW),aa=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:as.map((e,t)=>{let s,r=m.findIndex(t=>t.id===e.id);return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,sZ.includes(s)),onChange:()=>{var t;return t=e.id,void e4(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${e.name||e.email||e.id}`})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(D,{connection:e,proxyPools:q,isOAuth:sn,isFirst:0===r,isLast:r===m.length-1,onMoveUp:()=>sG(r,r-1),onMoveDown:()=>sG(r,r+1),onToggleActive:t=>sW(e.id,t),autoPingEnabled:!0===to[e.id],onToggleAutoPing:eq[n]&&"oauth"===e.authType?t=>sR(e.id,t):void 0,autoPingScheduled:tc[e.id]?.enabled===!0,onOpenAutoPingSchedule:eq[n]&&"oauth"===e.authType?()=>tx(e):void 0,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&f(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:()=>{eb(e),eo(!0)},onDelete:()=>sK(e.id),oneByOneStatus:tI[e.id]||null})})]},e.id)})}),ar=q.filter(e=>!0===e.isActive),ai=(0,a.jsx)(d.aF,{isOpen:ex,onClose:s7,title:`Apply Proxy (${sX.length} selected)`,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=q.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):s8(sX.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:e6||0===ar.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:()=>s6(null),disabled:e6,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)"})]}),q.map(e=>(0,a.jsxs)("button",{onClick:()=>s6(e.id),disabled:e6||!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))]}),e6&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:s7,variant:"ghost",fullWidth:!0,disabled:e6,children:"Cancel"})]})}),an=async e=>{eF(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${sj}/${e}`})}),s=await t.json();eA(t=>({...t,[e]:s.ok?"ok":"error"})),eP(t=>({...t,[e]:s.ok?"":s.error||"Model not reachable"}))}catch{eA(t=>({...t,[e]:"error"})),eP(t=>({...t,[e]:"Network error"}))}finally{eF(t=>{let s=new Set(t);return s.delete(e),s})}};return A?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):sr?(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)(l(),{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:`${sr.color}15`},children:ek?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:sr.color},children:sr.textIcon||sr.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.A,{src:sx&&sr.apiType?"responses"===sr.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":sp?"/providers/anthropic-m.png":`/providers/${sr.id}.png`,alt:sr.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ew(!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:sr.name}),(sr.notice?.apiKeyUrl||sr.notice?.signupUrl||sr.website)&&(0,a.jsxs)("a",{href:sr.notice?.apiKeyUrl||sr.notice?.signupUrl||sr.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"}),sr.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[m.length," connection",1===m.length?"":"s"]})]})]})]}),sr.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:sr.deprecationNotice})]}),sr.notice?.text&&!sr.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:sr.notice.text}),sr.notice.apiKeyUrl&&(0,a.jsx)("a",{href:sr.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 →"})]}),sh&&E&&(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:sp?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[sp?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",sp?"messages":"responses"===E.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:()=>{ei(""),ea(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ec(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{tj({title:"Delete Compatible Node",message:`Delete this ${sp?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{tj(null);try{(await fetch(`/api/provider-nodes/${n}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),so?(0,a.jsx)(d.gw,{providerId:n}):(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:[m.length>0&&q.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===sX.length)return;let e=[...new Set(sX.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"))];e8(1===e.length?e[0]:"__none__"),ep(!0)},disabled:0===sX.length,children:"Apply Proxy"}),m.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:sL,disabled:tS,children:tS?"Testing Connection One-by-One...":"Test Connection One-by-One"}),tS&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{tS&&(tq.current=!0,tO(!0))},disabled:tA,children:tA?"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"===ts,onChange:e=>{let t=e?"round-robin":null,s=e?tr||"1":tr;e&&!tr&&ti("1"),tD.current=s,tM.current&&(clearTimeout(tM.current),tM.current=null),ta(t),sz(t,s)}}),"round-robin"===ts&&(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:tr,onChange:e=>{var t;ti(t=e.target.value),tD.current=t,tM.current&&clearTimeout(tM.current),tM.current=setTimeout(()=>{sz("round-robin",tD.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),m.length>0&&(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:s0,onChange:()=>{s0?e4(e=>e.filter(e=>!sV.some(t=>t.id===e))):e4(e=>Array.from(new Set([...e,...sV.map(e=>e.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),s0?"Unselect visible":"Select visible"]}),(0,a.jsxs)(d.Ex,{variant:"default",children:[sV.length," visible"]}),sX.length>0&&(0,a.jsxs)(d.Ex,{variant:"default",children:[sX.length," selected"]}),s4&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:s4}),sX.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>{e4([]),e8("__none__")},children:"Clear"}),sX.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==sX.length&&tj({title:"Delete Selected Connections",message:`Delete ${sX.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{tj(null);let e=[],t=0;for(let s of sX)try{(await fetch(`/api/providers/${s.id}`,{method:"DELETE"})).ok?e.push(s.id):t+=1}catch(e){console.log("Error deleting selected connection:",e),t+=1}e4(t=>t.filter(t=>!e.includes(t))),t>0&&alert(`Deleted ${e.length} connection(s); ${t} failed.`),await sP()}})},children:["Delete Selected (",sX.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>s9("gsuite"),children:"Delete GSuite"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>s9("gmail"),children:"Delete Gmail"})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:v.gJ.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>tQ(e.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${tV===e.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[e.label,(0,a.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:sQ[e.id]||0})]},e.id))}),m.length>=20&&(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,a.jsx)("input",{type:"search",value:tZ,onChange:e=>tX(e.target.value),placeholder:`Search ${m.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),P?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:P})]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{O(!0),sP()},children:"Retry"})]}):0===m.length?(0,a.jsxs)(a.Fragment,{children:[(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:sn?"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"}),"kiro"!==n&&sf.some(e=>"oauth"===e.id)&&sf.some(e=>"apikey"===e.id)?(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",sf.find(e=>"oauth"===e.id)?.label||"OAuth"," or ",sf.find(e=>"apikey"===e.id)?.label||"API Key","."]}):sf.length>1?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add Connection lists every available authentication method."}):null]})]}),(0,a.jsx)(eC,{showAutomation:sb,showAddConnection:"none"!==sg.type,onOpenAutomation:sa,onAddConnection:s5,methods:"kiro"===n?null:sy,onSelectMethod:"kiro"===n?null:s3,extra:eM(n)?(0,a.jsx)(eD,{providerId:n,onWebLoginConnected:sP,onBulkImport:()=>"codex"===n?K(!0):B(!0)}):null})]}),"kiro"===n&&tL?.jobId&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",tL.status," | Success: ",tL.summary?.success||0," | Running: ",tL.summary?.running||0," | Queued: ",tL.summary?.queued||0]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>s.push(x("kiro")),children:"Resume Bulk Progress"}),e_(tL.status)&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"close",onClick:st,children:"Clear"})]})]}),"kiro"===n&&!tL?.jobId&&tF&&(0,a.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:tF})]}):(0,a.jsxs)(a.Fragment,{children:[tE&&(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: ",tE.total]}),(0,a.jsxs)("span",{children:["Completed: ",tE.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tE.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tE.failed]}),tE.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),tS&&tT&&(0,a.jsxs)("span",{children:["Running: ",m.find(e=>e.id===tT)?.name||tT]})]})}),"kiro"===n&&tL?.jobId&&(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",tL.status," | Success: ",tL.summary?.success||0," | Running: ",tL.summary?.running||0," | Queued: ",tL.summary?.queued||0]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>s.push(x("kiro")),children:"Resume Bulk Progress"}),e_(tL.status)&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"close",onClick:st,children:"Clear"})]})]}),"kiro"===n&&!tL?.jobId&&tF&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:tF}),aa,"kiro"===n&&ae>1&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",at," of ",ae," • Showing ",(at-1)*tW+1,"-",Math.min(at*tW,sV.length)," of ",sV.length," connections"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",disabled:at<=1,onClick:()=>tH(e=>Math.max(1,e-1)),children:"Previous"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",disabled:at>=ae,onClick:()=>tH(e=>Math.min(ae,e+1)),children:"Next"})]})]}),"kiro"!==n&&sV.length>0&&(0,a.jsx)(d.dK,{currentPage:at,pageSize:tW,totalItems:sV.length,onPageChange:tH,onPageSizeChange:e=>{tG(e),tH(1)},className:"mt-2"}),m.length>0&&0===sV.length&&(0,a.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(eC,{showAutomation:sb,showAddConnection:"none"!==sg.type,onOpenAutomation:sa,onAddConnection:s5,methods:"kiro"===n?null:sy,onSelectMethod:"kiro"===n?null:s3,extra:eM(n)?(0,a.jsx)(eD,{providerId:n,onWebLoginConnected:sP,onBulkImport:()=>"codex"===n?K(!0):B(!0)}):null})})]})]}),(0,a.jsx)(eI,{providerId:n}),(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.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),sk&&(0,a.jsx)("select",{value:tn,onChange:e=>{var t;tl(t=e.target.value),sE(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:sk.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!sh&&(e=[...sm,...tb.filter(e=>!sm.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!tg.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[tg.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:sA,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>s$(e),children:"Disable All"})]}))]}),Object.values(eT).some(Boolean)&&(0,a.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(eT).filter(([,e])=>!!e).map(([e,t])=>(0,a.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[e,": ",t]},e))}),(()=>{let e,t,s;if(sh)return(0,a.jsx)(z,{providerStorageAlias:sj,providerDisplayAlias:sw,modelAliases:ef,copied:t5,onCopy:t3,onSetAlias:sM,onDeleteAlias:s_,onAliasesChanged:sT,connections:m,isAnthropic:sp});let r=[...sm,...tb.filter(e=>!sm.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),i=new Set(tg),l=r.filter(e=>!i.has(e.id)),o=r.filter(e=>i.has(e.id)),c=function({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:r="llm",includeLegacyAliases:i=!0}){let n=new Set(a.map(e=>e.id)),l=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(r&&e!==r||n.has(t.id))continue;let a=`${s}/${t.id}`;l.has(a)||(l.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!i)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||l.has(s)||(l.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:r||"llm"}))}return o}({customModels:ev,modelAliases:ef,providerAlias:sj,builtInModels:sm,type:"llm"}),u=Math.min(tY,Math.max(1,Math.ceil(l.length/t1))),x=l.slice((u-1)*t1,u*t1);return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[c.map(e=>(0,a.jsx)(T,{model:{id:e.id,name:e.name},fullModel:`${sw}/${e.id}`,alias:e.alias,copied:t5,onCopy:t3,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?sD(e.id,e.type||"llm"):s_(e.alias)},testStatus:eS[e.id],onTest:m.length>0||so?()=>an(e.id):void 0,isTesting:ez.has(e.id),isCustom:!0,isFree:!1,thinkingSuffix:sv(e.id)},`${e.source}-${e.fullModel}`)),x.map(e=>{let t=`${sj}/${e.id}`,s=`${n}/${e.id}`,r=Object.entries(ef).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(T,{model:e,fullModel:`${sw}/${e.id}`,alias:r,copied:t5,onCopy:t3,onSetAlias:t=>sM(e.id,t,sj),onDeleteAlias:()=>s_(r),testStatus:eS[e.id],onTest:m.length>0||so?()=>an(e.id):void 0,isTesting:ez.has(e.id),isFree:e.isFree,onDisable:()=>sC(e.id),thinkingSuffix:sv(e.id)},e.id)}),l.length>t1&&(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(d.dK,{currentPage:u,pageSize:t1,totalItems:l.length,onPageChange:t0,onPageSizeChange:e=>{t2(e),t0(1)}})}),(0,a.jsxs)("button",{onClick:()=>eJ(!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"]}),"codebuddy"===n&&(0,a.jsxs)("button",{onClick:()=>eW(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-cyan-500/50 px-3 py-2 text-xs text-cyan-700 transition-colors hover:border-cyan-500 hover:bg-cyan-500/[0.07] dark:text-cyan-300 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Discover Models"]}),("codebuddy-intl"===n||"codebuddy-cn"===n)&&(0,a.jsxs)("button",{onClick:()=>eV(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"openrouter"===n&&(0,a.jsxs)("button",{type:"button",onClick:()=>eY(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"opencode"===n&&(0,a.jsxs)("button",{onClick:()=>eZ(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"kiro"===n&&(0,a.jsxs)("button",{onClick:()=>e1(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"cloudflare-ai"===n&&(0,a.jsxs)("button",{onClick:()=>e5(!0),className:"live-probe-button",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"radar"}),"Live Probe Models"]}),"qoder"===n&&m.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:sU,disabled:t_,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:t_?{animation:"spin 1s linear infinite"}:void 0,children:t_?"progress_activity":"download"}),t_?(0,b.Tl)("Fetching..."):(0,b.Tl)("Fetch Qoder Models")]}),tp.length>0&&(e=new Set(Object.values(ef)),t=new Set(sm.map(e=>e.id)),0===(s=tp.filter(s=>!e.has(`${sj}/${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()=>{let t=e.id.split("/").pop();await sM(e.id,t,sj)},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:()=>sS(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))})]})]})})()]}),ex&&ai,Y&&(0,a.jsx)(d.mz,{isOpen:!0,providerName:sr.name,methods:sy,onSelect:s3,onClose:()=>ee(!1)}),"codex"===n&&(0,a.jsx)(e$,{isOpen:L,onClose:()=>K(!1),onSuccess:sP}),"grok-cli"===n&&(0,a.jsx)(eO,{isOpen:F,onClose:()=>B(!1),onSuccess:sP}),_&&("kiro"===n?(0,a.jsx)(d.Mh,{isOpen:!0,providerInfo:sr,onSuccess:sF,onRefresh:sP,initialBulkJobId:tL?.jobId||null,onBulkJobChange:sB,onClose:()=>U(!1)}):"cursor"===n?(0,a.jsx)(d.G9,{isOpen:!0,onSuccess:sF,onClose:()=>U(!1)}):"gitlab"===n?(0,a.jsx)(d.vj,{isOpen:!0,providerInfo:sr,onSuccess:sF,onClose:()=>U(!1)}):"xiaomi-mimo"===n?(0,a.jsx)(d.LH,{isOpen:!0,onSuccess:sF,onClose:()=>U(!1)}):(0,a.jsx)(d.LF,{isOpen:!0,provider:n,providerInfo:sr,onSuccess:sF,onClose:()=>U(!1)})),"iflow"===n&&J&&(0,a.jsx)(d.vE,{isOpen:!0,onSuccess:()=>{sP(),W(!1)},onClose:()=>W(!1)}),("codebuddy"===n||"codebuddy-cn"===n)&&G&&(0,a.jsx)(d.xl,{isOpen:!0,connectionIds:sY,endpoint:"codebuddy-cn"===n?"/api/oauth/codebuddy-cn/quota-cookie":"/api/oauth/codebuddy/quota-cookie",onSuccess:()=>{sP(),X(!1)},onClose:()=>X(!1)}),et&&(0,a.jsx)(V,{isOpen:!0,provider:n,providerName:sr.name,isCompatible:sh,isAnthropic:sp,authType:sr?.authType,authHint:sr?.authHint,website:sr?.website,proxyPools:q,existingNames:m.map(e=>e.name).filter(Boolean),error:er,onSave:sJ,onBulkDone:sP,onClose:()=>{ei(""),ea(!1)}}),el&&eh&&(0,a.jsx)(d.wI,{isOpen:!0,connection:eh,proxyPools:q,onSave:sH,onClose:()=>eo(!1)}),sh&&ed&&(0,a.jsx)(Q,{isOpen:!0,node:E,onSave:sI,onClose:()=>ec(!1),isAnthropic:sp}),!sh&&eB&&(0,a.jsx)(Z,{isOpen:!0,providerAlias:sj,providerDisplayAlias:sw,onSave:async e=>{let t=sr?.passthroughModels?e.split("/").pop():e;await sM(e,t,sj),eJ(!1)},onClose:()=>eJ(!1)}),"codebuddy"===n&&eH&&(0,a.jsx)(es,{isOpen:!0,connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,"cb");await sT(),await sO()},onClose:()=>eW(!1)}),("codebuddy-intl"===n||"codebuddy-cn"===n)&&eG&&(0,a.jsx)(en,{isOpen:!0,providerId:n,connections:m,onModelsAdded:async e=>{let t="codebuddy-cn"===n?"cb-cn":"cbai";for(let s of e)await sM(s.id,s.id,t);await sT(),await sO()},onClose:()=>eV(!1)}),"openrouter"===n&&eX&&(0,a.jsx)(eu.A,{isOpen:!0,kind:"llm",connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id.split("/").pop(),"openrouter");await sT(),await sO()},onClose:()=>eY(!1)}),"opencode"===n&&eQ&&(0,a.jsx)(em,{isOpen:!0,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,"oc");await sT(),await sO()},onClose:()=>eZ(!1)}),"kiro"===n&&e0&&(0,a.jsx)(eg,{isOpen:!0,connections:m,onClose:()=>e1(!1)}),"cloudflare-ai"===n&&e2&&(0,a.jsx)(eN,{isOpen:!0,connections:m,onModelsAdded:async e=>{for(let t of e)await sM(t.id,t.id,su);await sT()},onClose:()=>e5(!1)}),tu&&(0,a.jsx)(H,{isOpen:!0,connection:tu,reactive:!0===to[tu.id],schedule:tc[tu.id]||null,onClose:()=>tx(null),onSave:sq}),tk&&(0,a.jsx)(d.uo,{isOpen:!0,onClose:()=>tw(!1),onConfirm:()=>{window.localStorage.setItem(se,"true"),tw(!1),tC(null),s2(tN||"oauth")},title:"Risk Notice",message:sr?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),tv&&(0,a.jsx)(d.uo,{isOpen:!0,onClose:()=>{te||tj(null)},onConfirm:async()=>{if(te)return;let e=tv?.onConfirm;if(e){tt(!0);try{await e()}finally{tt(!1)}}},title:tv?.title||"Confirm",message:tv?.message,variant:"danger",loading:te})]}):(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)(l(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},77988:(e,t,s)=>{Promise.resolve().then(s.bind(s,68612))}},e=>{e.O(0,[2574,3862,3745,3416,9501,620,5497,5153,8441,3794,7358],()=>e(e.s=77988)),_N_E=e.O()}]);