9router 0.5.111 → 0.5.112

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 (509) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  82. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  85. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  86. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  87. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  88. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/providers/web-login/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  328. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  330. package/app/.next-cli-build/server/app/callback.html +1 -1
  331. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  332. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  333. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  335. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
  337. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
  338. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
  339. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
  342. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
  343. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
  344. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
  347. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
  348. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
  349. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
  352. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  353. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
  354. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
  357. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
  358. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
  359. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
  362. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
  363. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
  364. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
  367. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
  368. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
  369. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
  372. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
  373. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
  374. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
  377. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
  378. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
  379. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
  382. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
  383. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
  384. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
  387. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
  388. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
  389. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
  392. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  393. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
  394. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  400. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  401. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  403. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
  405. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
  406. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
  407. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
  410. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
  411. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
  412. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
  415. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
  416. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
  417. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
  420. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
  421. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
  422. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  424. package/app/.next-cli-build/server/app/dashboard.rsc +3 -3
  425. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
  426. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
  427. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/index.html +1 -1
  430. package/app/.next-cli-build/server/app/index.rsc +3 -3
  431. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  432. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  433. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  435. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  436. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  437. package/app/.next-cli-build/server/app/landing.html +1 -1
  438. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  439. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  440. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  442. package/app/.next-cli-build/server/app/login/page.js +1 -1
  443. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  444. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  445. package/app/.next-cli-build/server/app/login.html +1 -1
  446. package/app/.next-cli-build/server/app/login.rsc +3 -3
  447. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  448. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  450. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  451. package/app/.next-cli-build/server/app/page.js +1 -1
  452. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  453. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  454. package/app/.next-cli-build/server/app-paths-manifest.json +1 -1
  455. package/app/.next-cli-build/server/chunks/1051.js +1 -1
  456. package/app/.next-cli-build/server/chunks/1356.js +1 -1
  457. package/app/.next-cli-build/server/chunks/2365.js +1 -1
  458. package/app/.next-cli-build/server/chunks/2380.js +3 -3
  459. package/app/.next-cli-build/server/chunks/24.js +1 -1
  460. package/app/.next-cli-build/server/chunks/2598.js +1 -1
  461. package/app/.next-cli-build/server/chunks/3697.js +1 -1
  462. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  463. package/app/.next-cli-build/server/chunks/412.js +1 -1
  464. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  465. package/app/.next-cli-build/server/chunks/4279.js +1 -1
  466. package/app/.next-cli-build/server/chunks/4480.js +1 -0
  467. package/app/.next-cli-build/server/chunks/5330.js +21 -21
  468. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  469. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  470. package/app/.next-cli-build/server/chunks/615.js +1 -1
  471. package/app/.next-cli-build/server/chunks/6690.js +1 -0
  472. package/app/.next-cli-build/server/chunks/6724.js +1 -1
  473. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  474. package/app/.next-cli-build/server/chunks/7187.js +1 -1
  475. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  476. package/app/.next-cli-build/server/chunks/7373.js +1 -1
  477. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  478. package/app/.next-cli-build/server/chunks/8128.js +1 -0
  479. package/app/.next-cli-build/server/chunks/8251.js +1 -1
  480. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  481. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  482. package/app/.next-cli-build/server/chunks/{7786.js → 8499.js} +1 -1
  483. package/app/.next-cli-build/server/chunks/8623.js +1 -1
  484. package/app/.next-cli-build/server/chunks/869.js +1 -1
  485. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  486. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  487. package/app/.next-cli-build/server/chunks/9128.js +1 -1
  488. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  489. package/app/.next-cli-build/server/chunks/9604.js +1 -1
  490. package/app/.next-cli-build/server/instrumentation.js +1 -1
  491. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  493. package/app/.next-cli-build/server/middleware.js +1 -1
  494. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/pages/404.html +1 -1
  496. package/app/.next-cli-build/server/pages/500.html +1 -1
  497. package/app/.next-cli-build/static/chunks/1321-02944667ec55f586.js +1 -0
  498. package/app/.next-cli-build/static/chunks/{5497-09541f53986a9e0d.js → 5497-870732fd9d818574.js} +1 -1
  499. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-f9897bc47dce7e8f.js +27 -0
  500. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  501. package/app/package.json +1 -1
  502. package/app/public/providers/nace.png +0 -0
  503. package/package.json +1 -1
  504. package/app/.next-cli-build/server/chunks/618.js +0 -1
  505. package/app/.next-cli-build/server/chunks/7918.js +0 -1
  506. package/app/.next-cli-build/static/chunks/1321-337f26c35a89cccd.js +0 -1
  507. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-bcda8e5062f1ebc9.js +0 -27
  508. /package/app/.next-cli-build/static/{tTnLO7OGDvjEJ5mfmRKqj → Mwpv7kpqnhzp2SJMtsIA1}/_buildManifest.js +0 -0
  509. /package/app/.next-cli-build/static/{tTnLO7OGDvjEJ5mfmRKqj → Mwpv7kpqnhzp2SJMtsIA1}/_ssgManifest.js +0 -0
@@ -0,0 +1,27 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{5539:(e,t,s)=>{"use strict";s.d(t,{A:()=>p,w:()=>d});var i=s(95155),a=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(73006);let d=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),c={default:"person",grok:"bolt",work:"work",personal:"home"},m=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function p({providerId:e,onConnected:t,size:s="sm"}){let[l,r]=(0,a.useState)(!1),[d,u]=(0,a.useState)("idle"),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(["default"]),[y,b]=(0,a.useState)("default"),v=(0,a.useRef)(null),j=(0,a.useRef)(null),w=(0,a.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null)},[]);(0,a.useEffect)(()=>()=>{w(),j.current&&clearTimeout(j.current)},[w]),(0,a.useEffect)(()=>{if(!l)return;let t=!1;return fetch("/api/providers/web-login",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(t||!Array.isArray(s.profiles))return;let i=window.localStorage.getItem(`weblogin:profile:${e}`),a=s.profiles.includes("default")?s.profiles:["default",...s.profiles];g(a),b(i&&a.includes(i)?i:"default")}).catch(()=>{}),()=>{t=!0}},[l,e]);let k=(0,a.useCallback)(t=>{b(t),window.localStorage.setItem(`weblogin:profile:${e}`,t)},[e]),N="opening"===d||"waiting"===d,C=(0,a.useCallback)(()=>{N||(w(),r(!1),"error"===d&&(u("idle"),h("")))},[N,d,w]),S=(0,a.useCallback)(()=>{w(),v.current=setInterval(async()=>{try{let s=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await s.json();"success"===i.status?(w(),u("success"),h(i.email?`${(0,o.Tl)("Signed in as")} ${i.email}`:"Connection saved"),"function"==typeof t&&t(),j.current=setTimeout(()=>{r(!1),h("")},1500)):"error"===i.status||"timeout"===i.status||"cancelled"===i.status?(w(),u("error"),h(i.error||(0,o.Tl)("Login failed"))):u(e=>"opening"===e?"waiting":e)}catch{}},2e3)},[e,t,w]),T=(0,a.useCallback)(async()=>{u("opening"),h("");try{let t=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,profile:y})}),s=await t.json();if(!t.ok){u("error"),h(s.error||(0,o.Tl)("Failed to start login"));return}u("waiting"),h((0,o.Tl)("A browser window has opened — log in there, this page updates itself.")),S()}catch(e){u("error"),h(e?.message||(0,o.Tl)("Failed to start login"))}},[e,y,S]),A=(0,a.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),w(),u("idle"),h("")},[e,w]),$=(0,a.useCallback)(()=>{let e=window.prompt((0,o.Tl)("New browser profile name (e.g. work, personal):"),"");if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);t&&(g(e=>e.includes(t)?e:[...e,t]),k(t))},[k]),O="opening"===d?0:"waiting"===d?1:"success"===d?2:-1;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{size:s,icon:"success"===d?"check_circle":"language",variant:"secondary",onClick:()=>{u("idle"),h(""),r(!0)},title:(0,o.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===d?(0,o.Tl)("Connected"):(0,o.Tl)("Login via Browser")}),(0,i.jsx)(n.aF,{isOpen:l,onClose:C,title:(0,o.Tl)("Login via Browser"),size:"sm",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,o.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,i.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,o.Tl)("Browser profile")}),(0,i.jsxs)("button",{type:"button",onClick:$,disabled:N,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,o.Tl)("New profile")]})]}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-2",children:f.map(e=>{let t=e===y;return(0,i.jsxs)("button",{type:"button",disabled:N,onClick:()=>k(e),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${t?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(e){let t=String(e).toLowerCase();for(let[e,s]of Object.entries(c))if(t.includes(e))return s;return"folder_shared"}(e)}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},e)})})]}),"idle"!==d&&(0,i.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===d?(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",x||(0,o.Tl)("Connection saved")]}):"error"===d?(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,o.Tl)("Login failed")]}),x&&(0,i.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:x})]}):(0,i.jsxs)("ol",{className:"flex flex-col gap-2",children:[m.map((e,t)=>{let s=t<O,a=t===O;return(0,i.jsxs)("li",{className:`flex items-center gap-2 text-sm ${s?"text-green-400":a?"text-primary":"text-text-muted opacity-50"}`,children:[(0,i.jsx)("span",{className:`material-symbols-outlined text-[18px] ${a?"animate-pulse":""}`,children:s?"check_circle":e.icon}),(0,o.Tl)(e.label)]},e.key)}),x&&(0,i.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:x})]})}),(0,i.jsx)("div",{className:"flex gap-2",children:"success"===d?(0,i.jsx)(n.$n,{onClick:C,fullWidth:!0,children:(0,o.Tl)("Done")}):N?(0,i.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:(0,o.Tl)("Cancel")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{onClick:T,fullWidth:!0,disabled:"error"===d&&!x,children:(0,o.Tl)("Open Browser & Login")}),(0,i.jsx)(n.$n,{onClick:C,variant:"ghost",fullWidth:!0,disabled:N,children:(0,o.Tl)("Close")})]})})]})})]})}p.propTypes={providerId:r().string.isRequired,onConnected:r().func,size:r().oneOf(["sm","md","lg"])}},46584:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>er});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);var h=s(13097);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","xhigh","max"],b={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":y,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:g,hunyuan:f,step:f,nous:f},v=["none","minimal","low","medium","high","xhigh","max"],j=["none","low","medium","high","max"],w=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:j},{pattern:"*claude*4-6*",levels:j},{provider:"codex",pattern:"*gpt-6*",levels:v},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:v},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}],k=/(?:^|\/)gpt-(?:5\.6|6)(?:[.-]|$)/i;function N(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:i,minor:a}=s;return i<4||4===i&&(null===a||a<=5||null!==a&&a>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=String(t||"").replace(/\([^()]+\)\s*$/,""),a="codex"===e?(0,h.SM)("cx").find(e=>e.id===i)?.thinkingLevels:null,l=w.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),r=a||l?.levels||(String(e||"").startsWith("openai-compatible-")&&k.test(i)?v:null)||b[s.thinkingFormat]||f;return!1===s.thinkingCanDisable&&(r=r.filter(e=>"none"!==e)),r}var C=s(11059),S=s(929),T=s(73006);let A=new Map;async function $(e){if(!e?.url||!e?.type)return[];let t=A.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return A.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function O({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var P=s(14051),I=s.n(P);function E({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function R({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=O({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},A=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!A||y,children:y?"Importing...":"Import from /models"})]}),!A&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}E.propTypes={model:I().shape({id:I().string.isRequired}).isRequired,fullModel:I().string.isRequired,alias:I().string,copied:I().string,onCopy:I().func.isRequired,testStatus:I().oneOf(["ok","error"]),isCustom:I().bool,isFree:I().bool,onDeleteAlias:I().func,onTest:I().func,isTesting:I().bool,onDisable:I().func,caps:I().object,thinkingSuffix:I().string},I().string.isRequired,I().string.isRequired,I().string,I().func.isRequired,I().func.isRequired,I().func,I().oneOf(["ok","error"]),I().bool,I().string.isRequired,I().object.isRequired,I().arrayOf(I().object),I().string,I().func.isRequired,I().func.isRequired,I().func.isRequired,I().func.isRequired,R.propTypes={providerStorageAlias:I().string.isRequired,providerDisplayAlias:I().string.isRequired,modelAliases:I().object.isRequired,customModels:I().arrayOf(I().object),copied:I().string,onCopy:I().func.isRequired,onDeleteAlias:I().func.isRequired,onAddCustomModel:I().func.isRequired,onDeleteCustomModel:I().func.isRequired,connections:I().arrayOf(I().shape({id:I().string,isActive:I().bool})).isRequired,isAnthropic:I().bool};var z=s(47650),_=s(70217);function M({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function q({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=(0,a.useRef)(null),[w,k]=(0,a.useState)(null),N=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?N.get(C):null,T=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,A=!!C||T,$=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:T?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",O=(()=>{if(!h)return"";let e=[];return(h.reactiveOn&&e.push("On reset"),h.scheduleOn&&e.push(`Scheduled (${h.scheduleSummary||"active"})`),e.length>0)?`Auto-ping active: ${e.join(" + ")}. Click to configure.`:"codex"===h.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),P="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);P=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{P=t}}let I=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";S?.isActive===!0?E="success":(C||T)&&(E="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current?.contains(e.target)||j.current?.contains(e.target)||g(!1)},t=()=>g(!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)}},[f]);let D=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},R=e.authType||(s?"oauth":"apikey"),U="oauth"===R,L="cookie"===R,K="mcode-lease"===R,F=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(K?"Desktop Lease":U?"OAuth Account":L?"Cookie Account":"API Key"),J=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[W,H]=(0,a.useState)(!1),B=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{H(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=B?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[B]);let G="unavailable"!==e.testStatus||W?e.testStatus:"active",Z=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:K?"desktop_windows":L?"cookie":U?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:F}),J&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:J}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,_.g)(e.isActive,G),size:"sm",dot:!0,children:!1===e.isActive?"disabled":G||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:K?"Desktop Lease":U?"OAuth":L?"Cookie":"API Key"}),A&&(0,i.jsx)(c.Ex,{variant:E,size:"sm",children:"Proxy"}),W&&!1!==e.isActive&&(0,i.jsx)(M,{until:B}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),Z()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:Z()})]}),A&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:$,children:$}),P&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:P}),I&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("button",{ref:j,onClick:()=>{if(f)return void g(!1);let e=j.current?.getBoundingClientRect();if(!e)return void g(!0);let s=((t?.length||0)+1)*34+8,i=window.innerHeight-e.bottom,a=i<s&&e.top>i;k({position:"fixed",right:window.innerWidth-e.right,...a?{bottom:window.innerHeight-e.top+4,maxHeight:Math.max(e.top-8,120)}:{top:e.bottom+4,maxHeight:Math.max(i-8,120)}}),g(!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 ${A?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,z.createPortal)((0,i.jsxs)("div",{ref:v,style:w,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,i.jsx)("button",{onClick:()=>D("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>D(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),h&&(0,i.jsx)(c.m_,{text:O,children:(0,i.jsxs)("button",{onClick:h.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}M.propTypes={until:I().string.isRequired},q.propTypes={connection:I().shape({id:I().string,name:I().string,email:I().string,displayName:I().string,modelLockUntil:I().string,testStatus:I().string,isActive:I().bool,lastError:I().string,priority:I().number,globalPriority:I().number}).isRequired,proxyPools:I().arrayOf(I().shape({id:I().string,name:I().string,proxyUrl:I().string,noProxy:I().string,isActive:I().bool})),isOAuth:I().bool.isRequired,isFirst:I().bool.isRequired,isLast:I().bool.isRequired,onMoveUp:I().func.isRequired,onMoveDown:I().func.isRequired,onToggleActive:I().func.isRequired,onUpdateProxy:I().func,onEdit:I().func.isRequired,onDelete:I().func.isRequired,oneByOneStatus:I().shape({state:I().string,error:I().string}),autoPing:I().shape({isActive:I().bool,provider:I().string,reactiveOn:I().bool,scheduleOn:I().bool,scheduleSummary:I().string,onConfigure:I().func})};let U=`name1|sk-key1
2
+ name2|sk-key2
3
+ sk-key-only-auto-named`;function L({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.credentialForm==="aws",S=m.Q2?.[t]?.apiKeyOptionalWith||null,T=m.Q2?.[t]?.regions||null,A=m.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[$,O]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[P,I]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[E,D]=(0,a.useState)({accountId:""}),[R,z]=(0,a.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[_,M]=(0,a.useState)(A),[q,K]=(0,a.useState)(!1),[F,J]=(0,a.useState)(null),[W,H]=(0,a.useState)(!1),B=N?`name1|sk-key1|acc123456
4
+ name2|sk-key2|def789012
5
+ sk-key-only-auto-named`:"qoder"===t||"qoder-cn"===t?`name1|pt-xxxxx
6
+ name2|pt-yyyyy
7
+ pt-only-auto-named`:U,[G,Z]=(0,a.useState)("single"),[V,Q]=(0,a.useState)(""),[X,Y]=(0,a.useState)(null),ee=()=>{if(b&&$.ollamaHostUrl.trim())return{baseUrl:$.ollamaHostUrl.trim()};if(k)return{azureEndpoint:P.azureEndpoint,apiVersion:P.apiVersion,deployment:P.deployment,organization:P.organization};if(N)return{accountId:E.accountId};if(C){let e={};return R.profile.trim()&&(e.profile=R.profile.trim()),R.region.trim()&&(e.region=R.region.trim()),R.accessKeyId.trim()&&(e.accessKeyId=R.accessKeyId.trim()),R.sessionToken.trim()&&(e.sessionToken=R.sessionToken.trim()),Object.keys(e).length?e:void 0}if(T&&_)return{region:_}},et=()=>{let e=ee();return!!(S&&e?.[S])||(C?!!$.apiKey&&!!e?.accessKeyId:!!$.apiKey)},es=async()=>{K(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ee()})}),s=await e.json();J(s.valid?"success":"failed")}catch{J("failed")}finally{K(!1)}},ei=async()=>{if(t&&(b||et())&&(b||$.name)&&(!l||$.defaultModel.trim())){H(!0);try{let e=!1;try{K(!0),J(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ee()})});e=!!(await s.json()).valid,J(e?"success":"failed")}catch{J("failed")}finally{K(!1)}await h({name:$.name||(b?"Ollama Local":""),apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===y?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:ee()})}finally{H(!1)}}},ea=async()=>{let e=V.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:i=!1}=s,a=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let r=function(e,t={}){let{isCloudflareAi:s=!1}=t;if(!s&&/^LLM\|/i.test(e.trim()))return{baseName:"LLM",apiKey:e.trim()};let i=e.split("|");if(s&&i.length>=3){let e=i[0].trim();return{baseName:e||"Key",apiKey:i.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:i[i.length-1].trim()}}}return i.length>=2?{baseName:i[0].trim()||"Key",apiKey:i.slice(1).join("|").trim()}:{baseName:"Key",apiKey:i[0].trim()}}(s,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,a.has(e.toLowerCase());)o+=1;a.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,x,{isCloudflareAi:N});if(!s.length)return;H(!0),Y(null);let i=0,a=0;for(let e of s)try{let s=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await i.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:a++}catch{a++}H(!1),Y({success:i,failed:a}),i>0&&f&&f()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${w}`,onClose:g,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[!C&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{size:"sm",variant:"single"===G?"primary":"ghost",onClick:()=>{Z("single"),Y(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===G?"primary":"ghost",onClick:()=>{Z("bulk"),Y(null)},children:"Bulk Add"})]}),"bulk"===G&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t||"qoder-cn"===t?(0,i.jsxs)(i.Fragment,{children:["One PAT per line. Format: ",(0,i.jsx)("code",{children:"name|pt-..."})," or just ",(0,i.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:B,value:V,onChange:e=>Q(e.target.value)}),X&&(0,i.jsxs)("div",{className:`text-sm font-medium ${X.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",X.success," added",X.failed>0?`, ✗ ${X.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:ea,fullWidth:!0,disabled:W||!V.trim(),children:W?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===G&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.pd,{label:"Name",value:$.name,onChange:e=>O({...$,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"Ollama Host URL",value:$.ollamaHostUrl,onChange:e=>O({...$,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:es,disabled:q||W,variant:"secondary",children:q?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:w,type:v?"text":"password",value:$.apiKey,onChange:e=>O({...$,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t||"qoder-cn"===t?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:es,disabled:!et()||q||W,variant:"secondary",children:q?"Checking...":"Check"})})]}),j&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),v&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),T&&(0,i.jsx)(c.l6,{label:"Region",value:_,onChange:e=>M(e.target.value),options:T.map(e=>({value:e.id,label:e.label}))}),l&&(0,i.jsx)(c.pd,{label:"Default Model",value:$.defaultModel,onChange:e=>O({...$,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),F&&(0,i.jsx)(c.Ex,{variant:"success"===F?"success":"error",children:"success"===F?"Valid":"Invalid"}),u&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:E.accountId,onChange:e=>D({...E,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),C&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"AWS Profile (SSO — recommended)",value:R.profile,onChange:e=>z({...R,profile:e.target.value}),placeholder:"my-sso-profile"}),(0,i.jsx)(c.pd,{label:"Region",value:R.region,onChange:e=>z({...R,region:e.target.value}),placeholder:"us-east-1"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,i.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,i.jsxs)("code",{children:["aws sso login --profile ",R.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,i.jsx)(c.pd,{label:"Access Key ID (only for static keys)",value:R.accessKeyId,onChange:e=>z({...R,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,i.jsx)(c.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:R.sessionToken,onChange:e=>z({...R,sessionToken:e.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,i.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),k&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"Azure Endpoint",value:P.azureEndpoint,onChange:e=>I({...P,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(c.pd,{label:"Deployment Name",value:P.deployment,onChange:e=>I({...P,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(c.pd,{label:"API Version",value:P.apiVersion,onChange:e=>I({...P,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(c.pd,{label:"Organization",value:P.organization,onChange:e=>I({...P,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(c.pd,{label:"Priority",type:"number",value:$.priority,onChange:e=>O({...$,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(c.l6,{label:"Proxy Pool",value:$.proxyPoolId,onChange:e=>O({...$,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:ei,fullWidth:!0,disabled:W||!b&&(!$.name||!et())||l&&!$.defaultModel.trim()||k&&(!P.azureEndpoint||!P.deployment||!P.organization)||N&&!E.accountId,children:W?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function K({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,i.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,i.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(c.pd,{label:"Model ID (optional)",value:x,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."}),y&&(0,i.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}L.propTypes={isOpen:I().bool.isRequired,provider:I().string,providerName:I().string,isCompatible:I().bool,isAnthropic:I().bool,authType:I().string,authHint:I().string,website:I().string,proxyPools:I().arrayOf(I().shape({id:I().string,name:I().string})),error:I().string,existingNames:I().arrayOf(I().string),onSave:I().func.isRequired,onBulkDone:I().func,onClose:I().func.isRequired},K.propTypes={isOpen:I().bool.isRequired,node:I().shape({id:I().string,name:I().string,prefix:I().string,apiType:I().string,baseUrl:I().string}),onSave:I().func.isRequired,onClose:I().func.isRequired,isAnthropic:I().bool};let F=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function J({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,a.useState)(""),[d,m]=(0,a.useState)(F),[u,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[b,v]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(o(""),m(F()),v(""),x(null),f(""))},[e]);let j=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},w=async()=>{let e=j(n.trim());if(e){x("testing"),f("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();x(i.ok?"ok":"error"),f(i.error||"")}catch(e){x("error"),f(e.message)}}},k=async()=>{let e=j(n.trim());if(e&&!g){y(!0);try{await l(e,d,d.stt?b:null)}finally{y(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),x(null),f("")},onKeyDown:e=>{"Enter"===e.key&&w()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===u,onClick:w,disabled:!n.trim()||"testing"===u,children:"testing"===u?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:j(n.trim())||"model-id"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,i.jsx)(c.lM,{checked:!!d[e],onChange:t=>m(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(c.lM,{checked:!!d.stt,onChange:e=>{m(t=>({...t,stt:e})),e||v("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),d.stt&&(0,i.jsx)("div",{className:"mt-3",children:(0,i.jsx)(c.l6,{label:"Transport",value:b,onChange:e=>v(e.target.value),placeholder:"Provider default (REST)",options:p.vp.map(e=>({value:e,label:p.qw[e].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===u&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===u&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:h||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:k,fullWidth:!0,size:"sm",disabled:!n.trim()||g,children:g?"Adding...":"Add Model"})]})]})})}J.propTypes={isOpen:I().bool.isRequired,providerAlias:I().string.isRequired,providerDisplayAlias:I().string.isRequired,onSave:I().func.isRequired,onClose:I().func.isRequired};let W=`[
8
+ {
9
+ "accessToken": "eyJhbGc...",
10
+ "refreshToken": "rt_...",
11
+ "idToken": "eyJhbGc...",
12
+ "email": "user@example.com"
13
+ }
14
+ ]`;function H({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),x=()=>{n||(r(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:W,value:l,onChange:e=>r(e.target.value),disabled:n}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,T.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,T.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}H.propTypes={isOpen:I().bool.isRequired,onClose:I().func.isRequired,onSuccess:I().func};let B=`[
15
+ {
16
+ "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
17
+ "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
18
+ "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
19
+ "email": "account1@example.com"
20
+ },
21
+ {
22
+ "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
23
+ "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
24
+ "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
+ "email": "account2@example.com"
26
+ }
27
+ ]`;function G(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function Z({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,T.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=G(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,T.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,T.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=G(l)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,T.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:B,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,T.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,T.Tl)("Loaded")," ",f.accountsCount," ",(0,T.Tl)("account(s) from")," ",f.filesCount," ",(0,T.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,T.Tl)("failed")]}),w.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}var V=s(65921);let Q=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],X=/^[A-Za-z0-9-]+$/;function Y({providerId:e}){let t=(0,V.i)(),[s,l]=(0,a.useState)(!1),[r,n]=(0,a.useState)([{name:"",value:""}]),[o,d]=(0,a.useState)({}),[m,p]=(0,a.useState)(!1),[u,x]=(0,a.useState)(!1);(0,a.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||{},i=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(i.length?i:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(i=>i.map((i,a)=>a===e?{...i,[t]:s}:i))},f=(0,a.useCallback)(async()=>{let s={};for(let e of r.filter(e=>e.name.trim())){let i=e.name.trim();if(!X.test(i))return void t.error(`Invalid header name: ${i}`);if(Q.includes(i.toLowerCase()))return void t.error(`Header ${i} cannot be overridden`);if(i in s)return void t.error(`Duplicate header name: ${i}`);e.value!==o[i]&&(s[i]=e.value)}x(!0);try{let i=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!i.ok){let e=await i.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[r,o,e,t]);return 0!==Object.keys(o).length||m?(0,i.jsxs)(c.Zp,{padding:"xs",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,i.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,i.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,i.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,i.jsx)("div",{className:"flex flex-col gap-2",children:r.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.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,i.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,i.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,i.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(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,i.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}Y.propTypes={providerId:I().string.isRequired};var ee=s(97132),et=s(5539);function es({providerId:e,onConnected:t,size:s="sm"}){let[l,r]=(0,a.useState)(!1),[n,o]=(0,a.useState)(""),d=async()=>{r(!0),o("");try{let s=await fetch(`/api/oauth/${e}/lease-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),i=await s.json().catch(()=>({}));if(!s.ok)return void o(i.error||"Could not reach the MiniMax Code desktop app");"function"==typeof t&&t()}catch(e){o(e?.message||"Could not reach the MiniMax Code desktop app")}finally{r(!1)}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:s,icon:"desktop_windows",variant:"secondary",disabled:l,onClick:d,title:(0,T.Tl)("Borrow the signed-in MiniMax Code desktop app's login — no second sign-in, refresh stays with the desktop app"),children:l?(0,T.Tl)("Connecting..."):(0,T.Tl)("Use Desktop App")}),n&&(0,i.jsx)("p",{className:"w-full text-xs text-red-500 break-words",children:n})]})}es.propTypes={providerId:I().string.isRequired,onConnected:I().func,size:I().oneOf(["sm","md","lg"])};var ei=s(93195);let ea=new Set(["minimax-code","minimax-code-global"]),el={claude:"claudeAutoPing",codex:"codexAutoPing"};function er(){let e,t,s,r,u,x=(0,l.useParams)(),h=(0,l.useRouter)(),f=x.id,{getCaps:g}=(0,S.y)(),[y,b]=(0,a.useState)([]),[v,j]=(0,a.useState)(!0),[w,k]=(0,a.useState)(null),[A,P]=(0,a.useState)([]),[I,D]=(0,a.useState)(!1),[z,_]=(0,a.useState)(!1),[M,U]=(0,a.useState)(!1),[F,W]=(0,a.useState)(!1),[B,G]=(0,a.useState)(""),[V,Q]=(0,a.useState)(!1),[X,er]=(0,a.useState)(!1),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ep]=(0,a.useState)(!1),[eu,ex]=(0,a.useState)(null),[eh,ef]=(0,a.useState)({}),[eg,ey]=(0,a.useState)([]),[eb,ev]=(0,a.useState)(!1),[ej,ew]=(0,a.useState)({}),[ek,eN]=(0,a.useState)(""),[eC,eS]=(0,a.useState)(()=>new Set),[eT,eA]=(0,a.useState)(!1),[e$,eO]=(0,a.useState)([]),[eP,eI]=(0,a.useState)("__none__"),[eE,eD]=(0,a.useState)(!1),[eR,ez]=(0,a.useState)(null),[e_,eM]=(0,a.useState)(""),[eq,eU]=(0,a.useState)("auto"),[eL,eK]=(0,a.useState)({enabled:!1,connections:{},schedules:{}}),[eF,eJ]=(0,a.useState)(null),[eW,eH]=(0,a.useState)([]),[eB,eG]=(0,a.useState)([]),[eZ,eV]=(0,a.useState)(null),[eQ,eX]=(0,a.useState)([]),[eY,e0]=(0,a.useState)([]),[e1,e2]=(0,a.useState)(null),[e5,e4]=(0,a.useState)(!1),[e3,e6]=(0,a.useState)(!1),[e9,e8]=(0,a.useState)(!1),[e7,te]=(0,a.useState)(null),[tt,ts]=(0,a.useState)({}),[ti,ta]=(0,a.useState)(null),tl=(0,a.useRef)(!1),[tr,tn]=(0,a.useState)(!1),[to,td]=(0,a.useState)(!1),{copied:tc,copy:tm}=(0,C.C)(),tp="ag_risk_confirmed",tu=()=>{D(!0)},tx=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tp)?e4(!0):"xiaomi-mimo"===f?_(!0):tb?tu():(G(""),W(!0))},th=()=>{G(""),W(!0)},tf=()=>{tb?tx():th()},tg=w?{id:w.id,name:w.name||("anthropic-compatible"===w.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===w.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===w.type?"AC":"OC",apiType:w.apiType,baseUrl:w.baseUrl,type:w.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],ty=tg?.authModes||[],tb=!!m.zN[f]||!!m.IS[f]||ty.includes("oauth"),tv=!!m.fg[f]||ty.includes("apikey"),tj=!!m.IS[f]?.noAuth,tw=(0,p.KC)(f),tk=("cursor"===f||"zed"===f)&&eB.length>0?eB:tw,tN=(0,m.wG)(f),tC=(0,m.mq)(f),tS=(0,m.gb)(f),tT=tC||tS,tA=!tT&&tb&&tv,t$="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tO="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tP=e=>{if(!eq||"auto"===eq)return null;let t=N(f,e);return t&&t.includes(eq)?eq:null},tI=tT?f:tN,tE=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=N(f,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tk)s(e.id);for(let e of eQ)s(e.id);for(let e of eg)e.providerAlias===tI&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tD=tT?w?.prefix||f:tN,tR=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tI)}`,{cache:"no-store"}),t=await e.json();e.ok&&e0(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tI]),tz=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tI,ids:[e]})})).ok&&await tR()}catch(e){console.log("Error disabling model:",e)}},t_=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tI)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tR()}catch(e){console.log("Error enabling model:",e)}},tM=async e=>{e.length&&e2({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e2(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tI,ids:e})})).ok&&await tR()}catch(e){console.log("Error disabling all models:",e)}}})},tq=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tI)}`,{method:"DELETE"})).ok&&await tR()}catch(e){console.log("Error enabling all models:",e)}},tU=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ef(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tL=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ey(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eX(e.models)}).catch(()=>{})},[f]);let tK=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),l=await t.json(),r=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===f);b(e)}s.ok&&P(r.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};ez(o.fallbackStrategy||null),eM(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eU(d.mode||"auto");let c=el[f],m=c&&n[c]||{};if(eK({enabled:!0===m.enabled,connections:m.connections||{},schedules:m.schedules||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===f)||null;if(!e&&tT)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===f)||null))break}k(e)}}catch(e){console.log("Error fetching connections:",e)}finally{j(!1)}},[f,tT]),tF=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(k(s.node),await tK(),ec(!1))}catch(e){console.log("Error updating provider node:",e)}},tJ=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[f]:l[f]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tW=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tH=async e=>{let t=el[f];if(t){eK(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tK(),tU(),tL(),tR()},[tK,tU,tL,tR]),(0,a.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eG([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eG([]),"zed"===f&&eV(null);return}let t=!1;return"zed"===f&&eV(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eG(s.models),"zed"===f&&s?.warning&&eV(s.warning);return}"zed"===f&&(eG([]),eV(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eG([]),eV("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,a.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&$(e).then(eH)},[f]);let tB=async(e,t,s=tN)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tU();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tG=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tU()}catch(e){console.log("Error deleting alias:",e)}},tZ=async(e,t="llm",s=tI,i,a)=>{try{let l=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{},...a?{transport:a}:{}})});if(l.ok)await tL(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await l.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tV=async(e,t="llm",s=tI)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tL(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tQ=async()=>{if(tr)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Qoder connection first"));tn(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,T.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");eg.some(e=>e.providerAlias===tI&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tI}/${s}`)||(await tZ(s,"llm",tI),a+=1)}0===a?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${a} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tn(!1)}},tX=async()=>{if(to)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Cline connection first"));td(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,T.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(eg.some(e=>e.providerAlias===tI&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tI}/${t}`)||(await tZ(t,"llm",tI),a+=1))}0===a?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${a} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{td(!1)}},tY=async()=>{if(e3||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));tl.current=!1,e6(!0),e8(!1),te(null),ts(e),ta({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(tl.current){ta({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=y[e];te(i.id),ts(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,ts(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,ts(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}ta({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{te(null),e6(!1),e8(!1),tl.current=!1}},t0=async e=>{e2({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e2(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},t1=()=>{tK(),D(!1)},t2=async e=>{G("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tK(),W(!1);return}G(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),G("Failed to save connection")}},t5=async e=>{try{(await fetch(`/api/providers/${eu.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tK(),eo(!1))}catch(e){console.log("Error updating connection:",e)}},t4=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t3=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tK()}},t6=y.filter(e=>e$.includes(e.id)),t9=y.length>0&&e$.length===y.length;(0,a.useEffect)(()=>{eO(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===t6.length)return;let e=new Set(t6.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=A.find(e=>e.id===t);return s?.name}})();let t8=()=>{eE||ep(!1)},t7=async e=>{eD(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tK(),ep(!1)}finally{eD(!1)}},se=e=>t7(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),st=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:y.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,e$.includes(s)),onChange:()=>{var t;return t=e.id,void eO(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(q,{connection:e,proxyPools:A,isOAuth:tb,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>t3(t,t-1),onMoveDown:()=>t3(t,t+1),onToggleActive:t=>t4(e.id,t),autoPing:el[f]&&"oauth"===e.authType?{isActive:!0===eL.connections[e.id]||eL.schedules?.[e.id]?.enabled===!0,reactiveOn:!0===eL.connections[e.id],provider:f,scheduleOn:eL.schedules?.[e.id]?.enabled===!0,scheduleSummary:(0,ei.JW)(eL.schedules?.[e.id]).join(" / "),onConfigure:()=>eJ(e)}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ex(e),eo(!0)},onDelete:()=>t0(e.id),oneByOneStatus:tt[e.id]||null})})]},e.id)})}),ss=A.filter(e=>!0===e.isActive),si=(0,i.jsx)(c.aF,{isOpen:em,onClose:t8,title:`Apply Proxy (${y.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=A.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t7(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eE||0===ss.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>se(null),disabled:eE,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),A.map(e=>(0,i.jsxs)("button",{onClick:()=>se(e.id),disabled:eE||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eE&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t8,variant:"ghost",fullWidth:!0,disabled:eE,children:"Cancel"})]})}),sa=async e=>{if(!eC.has(e)){eS(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:`${tI}/${e}`})}),s=await t.json();ew(t=>({...t,[e]:s.ok?"ok":"error"})),eN(s.ok?"":s.error||"Model not reachable")}catch{ew(t=>({...t,[e]:"error"})),eN("Network error")}finally{eS(t=>{let s=new Set(t);return s.delete(e),s})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tg)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sl=()=>tC&&tg.apiType?"responses"===tg.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tS?"/providers/anthropic-m.png":(0,d.HY)(tg.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tg.color}15`},children:eb||!sl()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tg.color},children:tg.textIcon||tg.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.A,{src:sl(),alt:tg.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tg.id),ev(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tg.name}),(tg.notice?.apiKeyUrl||tg.notice?.signupUrl||tg.website)&&(0,i.jsxs)("a",{href:tg.notice?.apiKeyUrl||tg.notice?.signupUrl||tg.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tg.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),tg.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tg.deprecationNotice})]}),tg.notice?.text&&!tg.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tg.notice.text}),tg.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tg.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 →"})]}),tT&&w&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tS?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tS?"Messages API":"responses"===w.apiType?"Responses API":"Chat Completions"," \xb7 ",(w.baseUrl||"").replace(/\/$/,""),"/",tS?"messages":"responses"===w.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{G(""),W(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ec(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e2({title:"Delete Compatible Node",message:`Delete this ${tS?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e2(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tj?(0,i.jsx)(c.gw,{providerId:f}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&A.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ep(!0),children:"Apply Proxy"}),y.length>0&&(0,i.jsxs)(i.Fragment,{children:[e$.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=e$.length;0!==e&&e2({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e2(null);let e=0,t=[...e$];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eO([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",e$.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tY,disabled:e3,children:e3?"Testing Connection One-by-One...":"Test Connection One-by-One"}),e3&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{e3&&(tl.current=!0,e8(!0))},disabled:e9,children:e9?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eR,onChange:e=>{let t=e?"round-robin":null,s=e?e_||"1":e_;e&&!e_&&eM("1"),ez(t),tJ(t,s)}}),"round-robin"===eR&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:e_,onChange:e=>{var t;eM(t=e.target.value),tJ("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===y.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tb?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tA&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",t$," or ",tO,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tA?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tx,children:t$}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:th,children:tO})]}):(0,i.jsxs)(i.Fragment,{children:[!tT&&et.w.has(f)&&(0,i.jsx)(et.A,{providerId:f,onConnected:tK}),!tT&&ea.has(f)&&(0,i.jsx)(es,{providerId:f,onConnected:tK}),!tT&&"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),children:(0,T.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tf,children:tT?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[ti&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",ti.total]}),(0,i.jsxs)("span",{children:["Completed: ",ti.completed]}),(0,i.jsxs)("span",{children:["Passed: ",ti.passed]}),(0,i.jsxs)("span",{children:["Failed: ",ti.failed]}),ti.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),e3&&e7&&(0,i.jsxs)("span",{children:["Running: ",y.find(e=>e.id===e7)?.name||e7]})]})}),y.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:t9,onChange:()=>{t9?eO([]):eO(y.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),st,!tT&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:[et.w.has(f)&&(0,i.jsx)(et.A,{providerId:f,onConnected:tK}),ea.has(f)&&(0,i.jsx)(es,{providerId:f,onConnected:tK}),"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,T.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),title:(0,T.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),tA?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tx,className:"w-full sm:w-auto",children:t$}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:th,className:"w-full sm:w-auto",children:tO})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tf,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsx)(Y,{providerId:f}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tE&&(0,i.jsx)("select",{value:eq,onChange:e=>{var t;eU(t=e.target.value),tW(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:tE.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tT&&(e=[...tk,...eQ.filter(e=>!tk.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eY.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eY.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tq,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tM(e),children:"Disable All"})]}))]}),!!ek&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:ek}),/RegionError|hosted in China|regionNotAllowed/i.test(ek)&&(s=(t="string"==typeof ek?ek:JSON.stringify(ek)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,i.jsx)("div",{className:"mt-1.5",children:(0,i.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,i.jsx)("span",{children:"Allow China-hosted models"}),(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eZ&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eZ}),(()=>{let e,t,s;if(tT)return(0,i.jsx)(R,{providerStorageAlias:tI,providerDisplayAlias:tD,modelAliases:eh,customModels:eg,copied:tc,onCopy:tm,onSetAlias:tB,onDeleteAlias:tG,onAddCustomModel:e=>tZ(e,"llm",tI),onDeleteCustomModel:e=>tV(e,"llm",tI),connections:y,isAnthropic:tS});let a=[...tk,...eQ.filter(e=>!tk.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eY),r=a.filter(e=>!l.has(e.id)),n=a.filter(e=>l.has(e.id)),o=O({customModels:eg,modelAliases:eh,providerAlias:tI,builtInModels:tk,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,i.jsx)(E,{model:{id:e.id,name:e.name},fullModel:`${tD}/${e.id}`,alias:e.alias,copied:tc,onCopy:tm,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tV(e.id,"llm",tI):tG(e.alias)},testStatus:ej[e.id],onTest:y.length>0||tj?()=>sa(e.id):void 0,isTesting:eC.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tP(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tI}/${e.id}`,s=`${f}/${e.id}`,a=Object.entries(eh).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(E,{model:e,fullModel:`${tD}/${e.id}`,alias:a,copied:tc,onCopy:tm,onSetAlias:t=>tB(e.id,t,tI),onDeleteAlias:()=>tG(a),testStatus:ej[e.id],onTest:y.length>0||tj?()=>sa(e.id):void 0,isTesting:eC.has(e.id),isFree:e.isFree,onDisable:()=>tz(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tP(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>eA(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===f||"qoder-cn"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tQ,disabled:tr,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:tr?{animation:"spin 1s linear infinite"}:void 0,children:tr?"progress_activity":"download"}),tr?(0,T.Tl)("Fetching..."):(0,T.Tl)("Fetch Qoder Models")]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tX,disabled:to,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:to?{animation:"spin 1s linear infinite"}:void 0,children:to?"progress_activity":"download"}),to?(0,T.Tl)("Fetching..."):(0,T.Tl)("Import from /models")]}),eW.length>0&&(e=new Set([...Object.values(eh),...o.map(e=>e.fullModel)]),t=new Set(tk.map(e=>e.id)),0===(s=eW.filter(s=>!e.has(`${tI}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tZ(e.id,"llm",tI)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>t_(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),si,"kiro"===f?(0,i.jsx)(c.Mh,{isOpen:I,providerInfo:tg,onSuccess:t1,onClose:()=>D(!1)}):"cursor"===f?(0,i.jsx)(c.G9,{isOpen:I,onSuccess:t1,onClose:()=>D(!1)}):"zed"===f?(0,i.jsx)(c.TE,{isOpen:I,providerInfo:tg,onSuccess:t1,onClose:()=>D(!1)}):"gitlab"===f?(0,i.jsx)(c.vj,{isOpen:I,providerInfo:tg,onSuccess:t1,onClose:()=>D(!1)}):(0,i.jsx)(c.LF,{isOpen:I,provider:f,providerInfo:tg,onSuccess:t1,onClose:()=>D(!1)}),(0,i.jsx)(c.LH,{isOpen:z,onSuccess:t1,onClose:()=>_(!1)}),"iflow"===f&&(0,i.jsx)(c.vE,{isOpen:M,onSuccess:()=>{tK(),U(!1)},onClose:()=>U(!1)}),(0,i.jsx)(L,{isOpen:F,provider:f,providerName:tg.name,isCompatible:tT,isAnthropic:tS,authType:tg?.authType,authHint:tg?.authHint,website:tg?.website,proxyPools:A,error:B,existingNames:y.map(e=>e.name).filter(Boolean),onSave:t2,onBulkDone:tK,onClose:()=>{G(""),W(!1)}}),(0,i.jsx)(c.wI,{isOpen:en,connection:eu,proxyPools:A,onSave:t5,onClose:()=>eo(!1)}),tT&&(0,i.jsx)(K,{isOpen:ed,node:w,onSave:tF,onClose:()=>ec(!1),isAnthropic:tS}),!tT&&(0,i.jsx)(J,{isOpen:eT,providerAlias:tI,providerDisplayAlias:tD,onSave:async(e,t,s)=>{await tZ(e,t?.stt?"stt":"llm",tI,t,s),eA(!1)},onClose:()=>eA(!1)}),"codex"===f&&(0,i.jsx)(H,{isOpen:V,onClose:()=>Q(!1),onSuccess:tK}),"grok-cli"===f&&(0,i.jsx)(Z,{isOpen:X,onClose:()=>er(!1),onSuccess:tK}),eF&&(0,i.jsx)(ee.A,{isOpen:!!eF,onClose:()=>eJ(null),connection:eF,reactive:!0===eL.connections[eF.id],schedule:eL.schedules?.[eF.id]||null,onSave:e=>((e,{reactive:t,schedule:s})=>{tH({...eL,connections:{...eL.connections,[e]:t},schedules:{...eL.schedules,[e]:s}})})(eF.id,e)}),(0,i.jsx)(c.uo,{isOpen:e5,onClose:()=>e4(!1),onConfirm:()=>{(window.localStorage.setItem(tp,"true"),e4(!1),tb)?tu():th()},title:"Risk Notice",message:tg?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!e1,onClose:()=>e2(null),onConfirm:e1?.onConfirm,title:e1?.title||"Confirm",message:e1?.message,variant:"danger"})]})}},77458:(e,t,s)=>{Promise.resolve().then(s.bind(s,46584))},93195:(e,t,s)=>{"use strict";function i(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}s.d(t,{JW:()=>o,Vm:()=>i,fB:()=>l,gy:()=>a,nz:()=>r});let a={anchor:"09:30",timezone:i(),windowHours:5,slotsPerDay:3};function l(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),i=Number(t[2]);return s>23||i>59?null:{hour:s,minute:i}}function r(e){return Math.max(1,Math.floor(24/e))}function n(e,t,s,i){let a="number"==typeof e?e:Number(e);return Number.isFinite(a)?Math.min(i,Math.max(s,a)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=l(e.anchor)||l(a.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,i=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?a.timezone:e.timezone,o=n(e.windowHours,a.windowHours,.5,24),d=Math.round(n(e.slotsPerDay,a.slotsPerDay,1,r(o)));return{enabled:!0,anchor:s,timezone:i,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:s,minute:i}=l(t.anchor),o=60*s+i;return Array.from({length:t.slotsPerDay},(e,s)=>{let i=Math.round(o+s*t.windowHours*60)%1440;return`${String(Math.floor(i/60)).padStart(2,"0")}:${String(i%60).padStart(2,"0")}`})}},97132:(e,t,s)=>{"use strict";s.d(t,{A:()=>m});var i=s(95155),a=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(31474),d=s(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function m({isOpen:e,onClose:t,onSave:s,connection:l,reactive:r=!1,schedule:p=null}){let[u,x]=(0,a.useState)(()=>({mode:p?.enabled===!0?"schedule":!0===r?"reset":"off",anchor:p?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(p?.windowHours??d.gy.windowHours),slotsPerDay:String(p?.slotsPerDay??d.gy.slotsPerDay)})),h=Number(u.windowHours),f=Number(u.slotsPerDay),g=!!(0,d.fB)(u.anchor),y=Number.isFinite(h)&&h>=.5&&h<=24,b=y?(0,d.nz)(h):24,v=Number.isInteger(f)&&f>=1&&f<=b,j=g&&y&&v,w="schedule"!==u.mode||j,k=j?(0,d.JW)({enabled:!0,...u,windowHours:h,slotsPerDay:f}):[],N=k.length&&y?(()=>{let{hour:e,minute:t}=(0,d.fB)(u.anchor),s=Math.round(60*e+t+f*h*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"",C=e=>x(t=>({...t,...e}));return(0,i.jsx)(n.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,i.jsx)(n.$n,{onClick:()=>{w&&(s({reactive:"reset"===u.mode,schedule:"schedule"===u.mode?{enabled:!0,anchor:u.anchor,timezone:u.timezone,windowHours:h,slotsPerDay:f}:{enabled:!1}}),t())},disabled:!w,children:"Save"})]}),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",l?.name?` for ${l.name}`:""," — pick one mode."]}),(0,i.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=u.mode===e.value;return(0,i.jsxs)("button",{type:"button",onClick:()=>C({mode:e.value}),className:(0,o.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",t?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,i.jsx)("span",{children:e.label})]},e.value)})}),"reset"===u.mode&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===u.mode&&(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,i.jsx)(n.pd,{label:"Anchor time",type:"time",value:u.anchor,onChange:e=>C({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,i.jsx)(n.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:u.windowHours,onChange:e=>C({windowHours:e.target.value}),error:y?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,i.jsx)(n.pd,{label:"Pings per day",type:"number",min:"1",max:String(b),step:"1",value:u.slotsPerDay,onChange:e=>C({slotsPerDay:e.target.value}),error:v?"":`1 – ${b}`,hint:v?`Max ${b}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),k.length>0&&(0,i.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,i.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",u.timezone,")"]}),(0,i.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:k.join(" → ")}),(0,i.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",k[0]," – ",N,", then pauses until ",k[0]," next day."]})]})]})]})})}m.propTypes={isOpen:r().bool.isRequired,onClose:r().func.isRequired,onSave:r().func.isRequired,connection:r().object,reactive:r().bool,schedule:r().object}}},e=>{e.O(0,[763,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=77458)),_N_E=e.O()}]);
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9router-app",
3
- "version": "0.5.111",
3
+ "version": "0.5.112",
4
4
  "description": "9Router web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9router",
3
- "version": "0.5.111",
3
+ "version": "0.5.112",
4
4
  "description": "9Router CLI - Start and manage 9Router server",
5
5
  "bin": {
6
6
  "9router": "./cli.js"
@@ -1 +0,0 @@
1
- "use strict";exports.id=618,exports.ids=[618,7247],exports.modules={39006:a=>{a.exports={rE:"0.5.111"}},39326:(a,b,c)=>{c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0;return{connectionProxyEnabled:b,connectionProxyUrl:e(a?.connectionProxyUrl),connectionNoProxy:e(a?.connectionNoProxy)}}(a),g=!1;if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy),h=a&&!0===a.isActive&&b;if(g=a?.strictProxy===!0,h){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type||"netlify"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,strictProxy:g,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,strictProxy:g,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},52284:(a,b,c)=>{c.d(b,{w$:()=>e});let d=c(39006).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.toLowerCase().startsWith("workos:")?b:/^eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/.test(b)?`workos:${b}`:b:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`9Router/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"9router","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},57247:(a,b,c)=>{c.d(b,{KC:()=>t,OA:()=>p,PROVIDER_MODELS:()=>e.vq,SM:()=>j,V2:()=>q,Xg:()=>s,cY:()=>u,ez:()=>o,fZ:()=>k,kt:()=>r,ux:()=>n});var d=c(57786),e=c(26070),f=c(99511),g=c(59096),h=c(14170);let i=a=>!a||["oc","opencode","ocg","opencode-go","ocz","opencode-zen"].includes(a);function j(a){return e.vq[a]||[]}function k(a){let b=e.vq[a];return b?.[0]?.id||null}let l=new Set(["kr","kiro"]);function m(a,b,c){if(!a)return;let d="string"==typeof b?b.replace(/\([^()]+\)\s*$/,"").trim():b,e=a.find(a=>a.id===b||a.id===d);if(e)return e;if(!l.has(c))return;let g=(0,f.Kq)(d);if(g!==d)return a.find(a=>a.id===g)}function n(a,b){if(i(a)&&(0,g.nh)(b))return h.h.OPENAI_RESPONSES;let c=e.vq[a];if(!c)return null;let d=m(c,b,a);return d?(0,f.gr)(d):i(a)&&(0,g.i8)(b)?.targetFormat||null}function o(a,b){let c=e.vq[a];if(!c)return null;let d=m(c,b,a);return d?(0,f.ec)(d):i(a)?(0,g.i8)(b)?.supportedFormats||[h.h.OPENAI]:null}function p(a,b){let c=e.vq[a];if(!c)return null;let d=m(c,b,a);return d?.kind||d?.type||null}function q(a,b){return m(e.vq[a],b,a)||null}function r(a,b,c=null){let d="string"==typeof b?b.match(/\([^()]+\)\s*$/):null,f=d?d[0]:"",h=f?b.slice(0,d.index).trim():b,i=e.vq[a],j=f?f.slice(1,-1).trim().toLowerCase():"",k="xhigh"===j||"max"===j?"high":"minimal"===j?"low":j;if(!k&&c&&"object"==typeof c){let a=c.reasoning_effort||c.output_config?.effort||("object"==typeof c.reasoning?c.reasoning?.effort:null);if("string"==typeof a&&a){let b=a.toLowerCase().trim();k="xhigh"===b||"max"===b?"high":"minimal"===b?"low":b}else if(c.thinking&&"object"==typeof c.thinking){let a=Number(c.thinking.budget_tokens);Number.isFinite(a)&&a>0&&(k=a>16384?"high":a<=4096?"low":"medium")}}let l=k?`${h}-${k}`:null,n=l&&m(i,l,a)||m(i,h,a),o=n?.upstreamModelId||n?.id;if(o){let a=o.match(/\([^()]+\)\s*$/),b=a?.[0]||"";return(b?o.slice(0,a.index).trim():o)+(f||(b&&k?`(${k})`:b))}return"cx"===a&&"string"==typeof h&&h.endsWith(g.d5)?h.slice(0,-g.d5.length)+f:h+f}Object.fromEntries(d.default.filter(a=>a.alias&&a.alias!==a.id).map(a=>[a.id,a.alias]));let s=Object.fromEntries(d.default.map(a=>[a.id,a.alias||a.id]));function t(a){let b=s[a]||a;return e.vq[b]||[]}function u(a,b){return(0,f.g5)(m(e.vq[a],b,a))}},66328:(a,b,c)=>{c.d(b,{F:()=>A});var d=c(89718),e=c(39326),f=c(74926),g=c(40615),h=c(57247),i=c(19696),j=c(35024),k=c(75924),l=c(90737),m=c(29493),n=c(93943),o=c(92990),p=c(52284),q=c(50980);let r={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":`codex_cli_rs/${k.Ch}`},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"9Router",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"qoder-cn":{url:"https://openapi.qoder.com.cn/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},kimi:{checkExpiry:!0,refreshable:!0},"kimi-coding":{checkExpiry:!0,refreshable:!0},cursor:{tokenExists:!0},kilocode:{url:`${o.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},"codebuddy-cn":{tokenExists:!0},"codebuddy-intl":{tokenExists:!0},kimchi:{url:o.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":l.hY,"x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":l.uG}},refreshable:!0,acceptStatuses:[402],softFailMessage:{402:"Connected, but Grok Build credits are exhausted (spending limit). Add credits or upgrade SuperGrok."}},muse:{url:"https://api.meta.ai/v1/models",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"x-api-version":"1.0.0"},refreshable:!1},nous:{url:m.b,method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json"},body:JSON.stringify({model:m.UK,messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1}),refreshable:!0,useApiKey:!0}};function s(a,b,c=""){if(!a)return{valid:!1,error:"No response",soft:!1};let d=a.status;if(!(a.ok||b?.acceptStatuses&&b.acceptStatuses.includes(d)))return 401===d?{valid:!1,error:"Token invalid or revoked",soft:!1}:403===d?{valid:!1,error:"Access denied",soft:!1}:{valid:!1,error:`API returned ${d}`,soft:!1};if(!a.ok&&b?.acceptStatuses?.includes(d)){let a=b.softFailMessage||{};if(a[d])return{valid:!0,error:a[d],soft:!0}}return{valid:!0,error:null,soft:!1}}async function t(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,p.w$)(a,{Accept:"application/json"})})}let u=JSON.stringify({metadata:{ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"}});async function v(a,b,c=null){let d="antigravity"===a.provider?o.YT.loadCodeAssistUserAgent||"antigravity/hub/2.24.0 darwin/arm64":"google-api-nodejs-client/9.15.1 gemini-cli/0.34.0",e=await y("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${b}`,"Content-Type":"application/json","User-Agent":d},body:u},c);return e.ok?{valid:!0,error:null}:{valid:!1,error:function(a,b){if(!a)return b;try{let b=JSON.parse(a),c=b?.error?.message||b?.message||b?.error;if("string"==typeof c&&c.trim())return c.trim();if(c)return JSON.stringify(c)}catch{}return a.trim()||b}(await e.text().catch(()=>""),`API returned ${e.status}`),status:e.status}}async function w(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?o.LT:o.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b||"nous"===b)return await (0,n.Vq)(b,a,console);if("claude"===b){let a=await fetch(o.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:o.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(o.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("cline"===b){let a=await fetch(o.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function x(a,b=null){let c=r[a.provider];if(!c)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(c.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let d=c.useApiKey&&a.apiKey||a.accessToken,e=!1,f=null,g=(0,n.fp)(a.provider,a);if(c.refreshable&&g&&a.refreshToken){let b=await w(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};d=c.useApiKey&&b.apiKey||b.accessToken,e=!0,f=b}if(c.checkExpiry)return e?{valid:!0,error:null,refreshed:e,newTokens:f}:g?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("gemini-cli"===a.provider||"antigravity"===a.provider){let g=await v(a,d,b);if(g.valid)return{valid:!0,error:null,refreshed:e,newTokens:f};if(401===g.status&&c.refreshable&&!e&&a.refreshToken){let c=await w(a);if(c?.accessToken){let d=await v(a,c.accessToken,b);return d.valid?{valid:!0,error:null,refreshed:!0,newTokens:c}:{valid:!1,error:d.error,refreshed:!0,newTokens:c}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}return{valid:!1,error:g.error,refreshed:e}}if("cline"===a.provider){let b=async a=>{let b=await t(a);return b.ok?{valid:!0,error:null,refreshed:e,newTokens:f}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:e}:403===b.status?{valid:!1,error:"Access denied",refreshed:e}:{valid:!1,error:`API returned ${b.status}`,refreshed:e}},c=await b(d);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let g=await w(a);return g?.accessToken?(e=!0,f=g,d=g.accessToken,await b(d)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let g=c.buildUrl?c.buildUrl(d):c.url,h=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d}`,...c.extraHeaders},i={method:c.method,headers:h};c.body&&(i.body=c.body);let j=await y(g,i,b),k=j.ok?"":await j.text().catch(()=>""),l=s(j,c,k);if(l.valid)return{valid:!0,error:l.soft?l.error:null,warning:l.soft?l.error:null,refreshed:e,newTokens:f};if(401===j.status&&c.refreshable&&!e&&a.refreshToken){let d=await w(a);if(d){let a=c.useApiKey&&d.apiKey||d.accessToken,e=c.buildUrl?c.buildUrl(a):g,f=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${a}`,...c.extraHeaders},h={method:c.method,headers:f};c.body&&(h.body=c.body);let i=await y(e,h,b),j=i.ok?"":await i.text().catch(()=>""),k=s(i,c,j);if(k.valid)return{valid:!0,error:k.soft?k.error:null,warning:k.soft?k.error:null,refreshed:!0,newTokens:d}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}return{valid:!1,error:l.error,refreshed:e}}catch(a){return{valid:!1,error:a.message,refreshed:e}}}async function y(a,b={},d=null){if(b.signal||(b.signal=AbortSignal.timeout(15e3)),d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function z(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await y(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=`${c}/v1/messages`,e=a.defaultModel||"claude-3-haiku-20240307",f=await y(d,{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:e,max_tokens:1,messages:[{role:"user",content:"test"}]})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if(g.AI_PROVIDERS[a.provider]?.credentialForm==="aws")try{return await (0,i.jL)(a,(a,c)=>y(a,c,b))}catch(a){return{valid:!1,error:a.message}}if((0,q.b7)(a.provider)){let b=await (0,q.TZ)(a.provider,a.apiKey||"");return"valid"===b.status?{valid:!0,error:null}:"invalid"===b.status?{valid:!1,error:b.error}:{valid:!0,error:`Could not verify the session: ${b.error}`}}try{switch(a.provider){case"commandcode":{let c=await y("https://api.commandcode.ai/alpha/whoami?limits=1",{headers:{Authorization:`Bearer ${a.apiKey}`,Accept:"application/json"}},b),d=c.ok;return{valid:d,error:d?null:401===c.status||403===c.status?"Invalid API key":`Command Code API error (${c.status})`}}case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await y(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,h.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await y(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await y("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await y("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await y("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await y(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await y("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nous":{let c=(0,m.HN)(a.apiKey),d=await y(c.url,{...c.options,signal:AbortSignal.timeout(8e3)},b),e=(0,m.Yn)(d.status);return{valid:e,error:e?null:(0,m.K5)(d.status)}}case"glm":{let c=await y("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await y("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await y({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await y("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":case"alims-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"alims-intl"===a.provider?"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await y(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,h.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await y(j.xq[a.provider]?.baseUrl,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,h.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await y("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await y("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await y("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await y("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await y("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await y("https://api.perplexity.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await y("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await y("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await y("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await y("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await y("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await y("https://api.siliconflow.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await y("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"tokenharbor":case"dahl":case"atria":case"agnes":case"bai":case"muse":case"runcrate":{let c=j.xq[a.provider],d=await y(c.validateUrl,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await y("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await y("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await y("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await y("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await y("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await y("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await y("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode":{let a=await y("https://opencode.ai/zen/v1/models",{headers:{Authorization:"Bearer public","User-Agent":"opencode/1.18.31"}},b);return{valid:a.ok,error:a.ok?null:"OpenCode free tier unavailable"}}case"opencode-go":{let c=await y("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,h.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await y(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"blackbox":{let c=j.xq.blackbox?.baseUrl?.replace(/\/chat\/completions$/,"")||"https://api.blackbox.ai/v1",d=await y(`${c}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key"}}case"qoder":case"qoder-cn":{let c="qoder-cn"===provider?"https://openapi.qoder.com.cn/api/v1/jobToken/exchange":"https://openapi.qoder.sh/api/v1/jobToken/exchange",d=a.apiKey||"",e=d.startsWith("pt-")?d:`pt-${d}`,f=await y(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","Cosy-Version":"1.0.1","Cosy-ClientType":"5"},body:JSON.stringify({personal_token:e})},b);return{valid:f.ok,error:f.ok?null:"Invalid Personal Access Token"}}case"llm7":{let c=a.providerSpecificData?.baseUrl||"https://api.llm7.io/v1",d=await y(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}case"sensenova":{let c=j.xq.sensenova?.validateUrl||"https://token.sensenova.cn/v1/models",d=await y(c,{method:"GET",headers:{Authorization:"Bearer "+a.apiKey,Accept:"application/json"}},b),e=d.ok;return{valid:e,error:e?null:401===d.status||403===d.status?"Invalid API key":`SenseNova API error (${d.status})`}}case"kimchi":{let c=o.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",d=await y(c,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a.apiKey}`,"User-Agent":"kimchi/0.1.40"}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key",refreshed:!1}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function A(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await z(c,g):await x(c,g);let i=Date.now()-h,j=b.valid&&(b.warning||b.error),k={testStatus:b.valid?"active":"error",lastError:b.valid?j||null:b.error,lastErrorAt:b.valid?j?new Date().toISOString():null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(k.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(k.refreshToken=b.newTokens.refreshToken),b.newTokens.apiKey&&(k.apiKey=b.newTokens.apiKey),b.newTokens.idToken&&(k.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(k.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(k.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?k.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(k.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(k.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,k),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"9Router"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},78959:(a,b,c)=>{c.d(b,{$U:()=>d,RK:()=>g,pb:()=>e,uB:()=>f});let d="data: [DONE]\n\n",e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},f={"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"},g={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","Access-Control-Allow-Origin":"*"}},92990:(a,b,c)=>{c.d(b,{DI:()=>i,DV:()=>A,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,RY:()=>I,S6:()=>s,SK:()=>F,Td:()=>B,Tx:()=>q,WN:()=>t,Ww:()=>K,YT:()=>n,Z2:()=>J,ZL:()=>m,_0:()=>H,aV:()=>u,cD:()=>o,eD:()=>G,f7:()=>y,hF:()=>k,lB:()=>w,oe:()=>E,qp:()=>C,sA:()=>D,t3:()=>l,w1:()=>x});var d=c(21820),e=c(74129),f=c(26070);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.dG,...f.sr["gemini-cli"]},k={...f.sr.qoder},l={...f.sr["qoder-cn"]},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr.kimi,clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||process.env.KIMI_OAUTH_CLIENT_ID||f.xq.kimi?.clientId||f.sr.kimi?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr["codebuddy-intl"]},B={...f.sr.kimchi},C={...f.sr["grok-cli"]},D={...f.sr.muse},E={platformUrl:process.env.MIMO_PLATFORM_URL||"https://platform.xiaomimimo.com",defaultBaseUrl:"https://api.xiaomimimo.com/v1",kn:"mimocode",callbackPath:"/",timeoutMs:3e5},F={clientId:"ono9krqynydwx5",clientSecret:"-",loginGuidanceUrls:["https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance","https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidance","https://www.trae.ai/cloudide/api/v3/trae/GetLoginGuidance"],apiOrigins:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai","https://www.marscode.com"],exchangeTokenPath:"/cloudide/api/v3/trae/oauth/ExchangeToken",getUserInfoPath:"/cloudide/api/v3/trae/GetUserInfo",authorizationPath:"/authorization",callbackPath:"/callback",minAppVersion:"3.5.54",defaultAppVersion:"3.5.54",defaultAppType:"stable",defaultPluginVersion:"local",defaultDeviceId:"0",userAgent:"Trae/1.0.0 antigravity-cockpit-tools",webUrl:"https://www.trae.ai",authScheme:"Cloud-IDE-JWT",tokenLifetimeDays:14,oauthTimeoutMs:6e5},G={clientId:"3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",authBaseUrl:"https://www.windsurf.com",signInPath:"/windsurf/signin",registerApiBaseUrl:"https://register.windsurf.com",registerPath:"/exa.seat_management_pb.SeatManagementService/RegisterUser",oneTimeAuthPath:"/exa.seat_management_pb.SeatManagementService/GetOneTimeAuthToken",currentUserPath:"/exa.seat_management_pb.SeatManagementService/GetCurrentUser",planStatusPath:"/exa.seat_management_pb.SeatManagementService/GetPlanStatus",userStatusPath:"/exa.seat_management_pb.SeatManagementService/GetUserStatus",defaultApiServerUrl:"https://server.codeium.com",firebaseApiKey:"AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",callbackPath:"/windsurf-auth-callback",userAgent:"antigravity-cockpit-tools",oauthTimeoutMs:6e5},H={...f.sr.glm},I={webBaseUrl:"https://zed.dev",cloudBaseUrl:"https://cloud.zed.dev",llmBaseUrl:"https://cloud.zed.dev",defaultNativeAppPort:58443,oauthTimeoutMs:6e5},J={clientId:"hermes-cli",portalBaseUrl:"https://portal.nousresearch.com",deviceCodeUrl:"https://portal.nousresearch.com/api/oauth/device/code",tokenUrl:"https://portal.nousresearch.com/api/oauth/token",agentKeyUrl:"https://portal.nousresearch.com/api/oauth/agent-key",inferenceBaseUrl:"https://inference-api.nousresearch.com/v1",scope:"inference:invoke inference:mint_agent_key"},K=3e5}};