@techysy/10router 1.6.0 → 1.6.2

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 (652) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +21 -21
  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/experimental/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +4 -4
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.html +2 -2
  88. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  89. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  90. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +6 -6
  91. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/gateway-probe/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/gateway-probe/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/keys/rotate/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/keys/rotate/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/models/caps/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/models/caps/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/network/egress-region/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/claim-compensation/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-kill/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-status/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  285. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  291. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  297. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  300. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/security/status/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/security/status/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/settings/route.js +2 -2
  312. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  338. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/usage/quotas/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/usage/quotas/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  364. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  378. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/rerank/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/rerank/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/version/route.js +2 -2
  415. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/version/shell-update/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  422. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  424. package/app/.next-cli-build/server/app/callback.html +2 -2
  425. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  426. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  427. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +6 -6
  429. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +2 -2
  430. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  431. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +8 -8
  432. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  433. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
  436. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +8 -8
  437. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  438. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/combos.html +2 -2
  440. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  441. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +8 -8
  442. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  443. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/endpoint.html +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  446. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +8 -8
  447. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  448. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/experimental.html +2 -2
  450. package/app/.next-cli-build/server/app/dashboard/experimental.rsc +8 -8
  451. package/app/.next-cli-build/server/app/dashboard/experimental.segments/!KGRhc2hib2FyZCk/dashboard/experimental/__PAGE__.segment.rsc +8 -8
  452. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_full.segment.rsc +8 -8
  453. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_tree.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +2 -2
  455. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  456. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +8 -8
  457. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  458. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/mitm.html +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  461. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +8 -8
  462. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  463. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard/profile.html +2 -2
  465. package/app/.next-cli-build/server/app/dashboard/profile.rsc +8 -8
  466. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +8 -8
  467. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +8 -8
  468. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/providers/new.html +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  471. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +8 -8
  472. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  473. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/providers.html +2 -2
  475. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  476. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +8 -8
  477. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  478. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +8 -8
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +2 -2
  485. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +8 -8
  486. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +8 -8
  487. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +8 -8
  488. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  491. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +9 -9
  492. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  493. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  500. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  501. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  502. package/app/.next-cli-build/server/app/dashboard/skills.html +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  504. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +8 -8
  505. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  506. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  507. package/app/.next-cli-build/server/app/dashboard/token-saver.html +2 -2
  508. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +8 -8
  509. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +8 -8
  510. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +8 -8
  511. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  512. package/app/.next-cli-build/server/app/dashboard/translator.html +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  514. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +8 -8
  515. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  516. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/dashboard/usage.html +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  519. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +8 -8
  520. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  521. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  522. package/app/.next-cli-build/server/app/dashboard.html +2 -2
  523. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  524. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +8 -8
  525. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  526. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  528. package/app/.next-cli-build/server/app/index.html +1 -1
  529. package/app/.next-cli-build/server/app/index.rsc +6 -6
  530. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  531. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  532. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  534. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  535. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/app/.next-cli-build/server/app/landing.html +2 -2
  537. package/app/.next-cli-build/server/app/landing.rsc +7 -7
  538. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +7 -7
  539. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +7 -7
  541. package/app/.next-cli-build/server/app/login/page.js +1 -1
  542. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  543. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  544. package/app/.next-cli-build/server/app/login.html +2 -2
  545. package/app/.next-cli-build/server/app/login.rsc +7 -7
  546. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  547. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +7 -7
  549. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  550. package/app/.next-cli-build/server/app/page.js +1 -1
  551. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  552. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  553. package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
  554. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  555. package/app/.next-cli-build/server/chunks/1351.js +1 -0
  556. package/app/.next-cli-build/server/chunks/1622.js +1 -0
  557. package/app/.next-cli-build/server/chunks/1806.js +1 -1
  558. package/app/.next-cli-build/server/chunks/1819.js +1 -1
  559. package/app/.next-cli-build/server/chunks/1884.js +1 -1
  560. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  561. package/app/.next-cli-build/server/chunks/2380.js +21 -0
  562. package/app/.next-cli-build/server/chunks/2557.js +1 -1
  563. package/app/.next-cli-build/server/chunks/318.js +7 -8
  564. package/app/.next-cli-build/server/chunks/{5625.js → 3389.js} +1 -1
  565. package/app/.next-cli-build/server/chunks/3500.js +2 -2
  566. package/app/.next-cli-build/server/chunks/3662.js +1 -1
  567. package/app/.next-cli-build/server/chunks/3792.js +1 -1
  568. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  569. package/app/.next-cli-build/server/chunks/3962.js +1 -1
  570. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  571. package/app/.next-cli-build/server/chunks/4575.js +1 -1
  572. package/app/.next-cli-build/server/chunks/4692.js +1 -1
  573. package/app/.next-cli-build/server/chunks/4775.js +1 -1
  574. package/app/.next-cli-build/server/chunks/4906.js +1 -1
  575. package/app/.next-cli-build/server/chunks/4927.js +3 -3
  576. package/app/.next-cli-build/server/chunks/5210.js +27 -28
  577. package/app/.next-cli-build/server/chunks/539.js +1 -1
  578. package/app/.next-cli-build/server/chunks/5527.js +1 -1
  579. package/app/.next-cli-build/server/chunks/5598.js +1 -1
  580. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  581. package/app/.next-cli-build/server/chunks/5663.js +1 -1
  582. package/app/.next-cli-build/server/chunks/5757.js +1 -1
  583. package/app/.next-cli-build/server/chunks/5781.js +2 -2
  584. package/app/.next-cli-build/server/chunks/5837.js +1 -0
  585. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  586. package/app/.next-cli-build/server/chunks/615.js +1 -1
  587. package/app/.next-cli-build/server/chunks/6212.js +1 -0
  588. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  589. package/app/.next-cli-build/server/chunks/6326.js +1 -1
  590. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  591. package/app/.next-cli-build/server/chunks/6790.js +1 -1
  592. package/app/.next-cli-build/server/chunks/6956.js +1 -1
  593. package/app/.next-cli-build/server/chunks/6960.js +1 -1
  594. package/app/.next-cli-build/server/chunks/7067.js +1 -1
  595. package/app/.next-cli-build/server/chunks/7122.js +1 -1
  596. package/app/.next-cli-build/server/chunks/7209.js +1 -0
  597. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  598. package/app/.next-cli-build/server/chunks/7274.js +1 -1
  599. package/app/.next-cli-build/server/chunks/7729.js +1 -1
  600. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  601. package/app/.next-cli-build/server/chunks/8172.js +2 -2
  602. package/app/.next-cli-build/server/chunks/8318.js +1 -1
  603. package/app/.next-cli-build/server/chunks/8439.js +1 -1
  604. package/app/.next-cli-build/server/chunks/8595.js +1 -1
  605. package/app/.next-cli-build/server/chunks/8775.js +1 -1
  606. package/app/.next-cli-build/server/chunks/8895.js +6 -6
  607. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  608. package/app/.next-cli-build/server/chunks/8936.js +1 -0
  609. package/app/.next-cli-build/server/chunks/9154.js +1 -1
  610. package/app/.next-cli-build/server/chunks/9489.js +3 -3
  611. package/app/.next-cli-build/server/chunks/9536.js +1 -0
  612. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  613. package/app/.next-cli-build/server/chunks/9628.js +1 -1
  614. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  615. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  616. package/app/.next-cli-build/server/middleware.js +5 -5
  617. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  618. package/app/.next-cli-build/server/pages/404.html +2 -2
  619. package/app/.next-cli-build/server/pages/500.html +1 -1
  620. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  621. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  622. package/app/.next-cli-build/static/chunks/1321-3d22643da5d0f152.js +1 -0
  623. package/app/.next-cli-build/static/chunks/5497-ce4781ece1a27ac0.js +7 -0
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a2f5c1fa12df475b.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-6db03f8140121a40.js → page-6393f6dfae0de3e6.js} +13 -13
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9c29e4e5c17e55ea.js +14 -0
  627. package/app/.next-cli-build/static/chunks/app/landing/page-626d89125b768dcf.js +1 -0
  628. package/app/.next-cli-build/static/css/5922b1ff9e56869d.css +1 -0
  629. package/app/package.json +1 -1
  630. package/app/public/i18n/changelog/en.md +548 -513
  631. package/app/public/i18n/changelog/zh-CN.md +546 -511
  632. package/app/public/i18n/changelog/zh-TW.md +548 -513
  633. package/app/public/i18n/literals/zh-CN.json +2129 -2107
  634. package/app/public/i18n/literals/zh-TW.json +1 -0
  635. package/app/public/providers/oxion.png +0 -0
  636. package/app/public/providers/uc-web.png +0 -0
  637. package/app/public/providers/veoaifree-web.png +0 -0
  638. package/package.json +1 -1
  639. package/app/.next-cli-build/server/chunks/2154.js +0 -1
  640. package/app/.next-cli-build/server/chunks/3267.js +0 -1
  641. package/app/.next-cli-build/server/chunks/4386.js +0 -1
  642. package/app/.next-cli-build/server/chunks/6756.js +0 -1
  643. package/app/.next-cli-build/server/chunks/75.js +0 -1
  644. package/app/.next-cli-build/server/chunks/8499.js +0 -21
  645. package/app/.next-cli-build/static/chunks/1321-77ba328dd4d69fdb.js +0 -1
  646. package/app/.next-cli-build/static/chunks/5497-ec8a6308121a2b70.js +0 -7
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-8f6aadfc8bf2eb7b.js +0 -1
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a6b07fa9d0712cee.js +0 -14
  649. package/app/.next-cli-build/static/chunks/app/landing/page-c6c3a32dd06bc907.js +0 -1
  650. package/app/.next-cli-build/static/css/17275fac82e1641e.css +0 -1
  651. /package/app/.next-cli-build/static/{1q0xTGDYtD52dGw4uiY4- → KyW2U59Ruq5vPQZjvyylc}/_buildManifest.js +0 -0
  652. /package/app/.next-cli-build/static/{1q0xTGDYtD52dGw4uiY4- → KyW2U59Ruq5vPQZjvyylc}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{56836:(e,t,s)=>{Promise.resolve().then(s.bind(s,80191))},80191:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var l=s(95155),a=s(12115),r=s(44923),n=s(87256),o=s(39768),i=s(5020),d=s(35497),c=s(11059),m=s(929);s(88105);var x=s(990),p=s(31474),u=s(73006);let h=/^[a-zA-Z0-9_.\-]+$/,b=[{key:"vision",label:"Vision",icon:"visibility",desc:"Images"},{key:"audioInput",label:"Audio",icon:"graphic_eq",desc:"Audio input"}],f="oc/mimo-v2.6-flash-free",j={enabled:!0,roundRobin:!1,models:[]},g={vision:{...j},pdf:{...j},audioInput:{...j},videoInput:{...j}};function y(){let e,[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),[o,i]=(0,a.useState)(!1),[x,p]=(0,a.useState)(null),[h,f]=(0,a.useState)([]),[y,v]=(0,a.useState)({}),[N,C]=(0,a.useState)(g),{getCaps:S}=(0,m.yU)(),[M,$]=(0,a.useState)(null),{copied:E,copy:O}=(0,c.C)();(0,a.useEffect)(()=>{A()},[]);let A=async()=>{try{let[t,l,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),r=await t.json(),n=await l.json(),o=a.ok?await a.json():{};t.ok&&s((r.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),l.ok&&f(n.connections||[]),v(o.comboStrategies||{});let i=o.capacityAdapter||{},d={};for(let t of b){var e;d[t.key]=(e=i[t.key],Array.isArray(e)?{enabled:!0,roundRobin:!1,models:e.map(e=>e?.model||e).filter(Boolean)}:e&&"object"==typeof e?{enabled:!1!==e.enabled,roundRobin:!!e.roundRobin,models:Array.isArray(e.models)?e.models.filter(Boolean):[]}:{...j})}C(d)}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},R=async e=>{C(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({capacityAdapter:e})})}catch(e){console.log("Error updating capacity adapter:",e)}},P=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await A(),i(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},F=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await A(),p(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},_=async e=>{$({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{$(null);try{(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&s(t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting combo:",e)}}})},D=async(e,t)=>{try{let s={...y},l={...s[e]||{},...t};l.fallbackStrategy&&"fallback"!==l.fallbackStrategy||l.retryOnEmpty?s[e]=l:delete s[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})}),v(s)}catch(e){console.log("Error updating combo strategy:",e)}};return r?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(d.Qv,{}),(0,l.jsx)(d.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:(0,u.Tl)("Group models under one name, then pick a strategy per combo:")}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:(0,u.Tl)("Fallback")})," ",(0,u.Tl)("— tries models in order (next on failure)")]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:(0,u.Tl)("Round Robin")})," ",(0,u.Tl)("— rotates models across requests to spread load")]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:(0,u.Tl)("Fusion")})," ",(0,u.Tl)("— queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)")]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:(0,u.Tl)("Router")})," ",(0,u.Tl)("— decision model analyzes user prompt and selects the best-suited member model to answer (fast, capability-aware routing)")]})]})]}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Create Combo"})]}),0===t.length?(0,l.jsx)(d.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(e=Object.fromEntries(t.map(e=>[e.name,e.models])),t.map(t=>(0,l.jsx)(w,{combo:t,getCaps:S,comboByName:e,activeProviders:h,copied:E,onCopy:O,onEdit:()=>p(t),onDelete:()=>_(t.id),strategy:y[t.name]||{},onSetStrategy:e=>D(t.name,e)},t.id)))}),(0,l.jsx)(k,{capacityAdapter:N,onChange:R,activeProviders:h,getCaps:S}),o&&(0,l.jsx)(T,{isOpen:o,onClose:()=>i(!1),onSave:P,activeProviders:h},"create"),x&&(0,l.jsx)(T,{isOpen:!!x,combo:x,onClose:()=>p(null),onSave:e=>F(x.id,e),activeProviders:h},x.id),(0,l.jsx)(d.uo,{isOpen:!!M,onClose:()=>$(null),onConfirm:M?.onConfirm,title:M?.title||"Confirm",message:M?.message,variant:"danger"})]})}let v=e=>{if(!e)return"?";if(e>=1e6){let t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}return`${Math.round(e/1e3)}k`},N=[{value:"fallback",label:(0,u.Tl)("Fallback — try in order")},{value:"round-robin",label:(0,u.Tl)("Round Robin — rotate")},{value:"fusion",label:(0,u.Tl)("Fusion — panel + judge")},{value:"router",label:(0,u.Tl)("Router — decision model picks member")}];function w({combo:e,getCaps:t,comboByName:s={},activeProviders:r=[],copied:n,onCopy:o,onEdit:i,onDelete:c,strategy:m={},onSetStrategy:h}){let[b,f]=(0,a.useState)(!1),[j,g]=(0,a.useState)(!1),y=m.fallbackStrategy||"fallback",k=m.judgeModel||"",C=m.routerModel||"",S=(0,x.Q5)(e.models,s,t);return(0,l.jsxs)(d.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:(0,u.Tl)("No models")}):e.models.slice(0,3).map((e,a)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:s[e]?(0,x.Q5)(s[e],s,t):t?.(e)})]},a)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," ",(0,u.Tl)("more")]})]}),S&&(0,l.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-[10px] text-text-muted",children:[(0,l.jsxs)("span",{children:["ctx ",v(S.contextWindow)]}),(0,l.jsx)("span",{className:"opacity-40",children:"\xb7"}),(0,l.jsxs)("span",{children:["max ",v(S.maxOutput)]})]}),"fusion"===y&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>f(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:k||`Auto — ${e.models[0]||"first model"}`})]}),k&&(0,l.jsx)("button",{onClick:()=>h({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),"router"===y&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Router"}),(0,l.jsxs)("button",{onClick:()=>g(!0),className:(0,p.cn)("inline-flex max-w-full items-center gap-1 rounded border border-dashed px-1.5 py-0.5 font-mono text-[11px] transition-colors",C?"border-primary/40 text-primary hover:border-primary hover:bg-primary/5":"border-amber-500/50 text-amber-600 dark:text-amber-400 hover:border-amber-500"),title:C?"Pick the decision model that selects the answering member":"No decision model set — the combo falls back to the normal order",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"alt_route"}),(0,l.jsx)("span",{className:"truncate",children:C||(0,u.Tl)("Select decision model")})]}),C&&(0,l.jsx)("button",{onClick:()=>h({routerModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Clear decision model (falls back to normal order)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("div",{className:"w-full sm:w-[200px]",children:[(0,l.jsx)(d.l6,{options:N,value:y,onChange:e=>h({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"}),"fusion"!==y&&(0,l.jsxs)("label",{className:"mt-1 flex cursor-pointer items-center gap-1.5 text-[11px] text-text-muted",title:(0,u.Tl)("When the model returns an empty answer (content filter or zero output), fall through to the next model. The abandoned attempt still consumes its input tokens."),children:[(0,l.jsx)(d.lM,{size:"sm",checked:!!m.retryOnEmpty,onChange:e=>h({retryOnEmpty:e})}),(0,l.jsx)("span",{children:(0,u.Tl)("Retry on empty")})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),o(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:n===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:i,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:c,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),b&&(0,l.jsx)(d.rq,{isOpen:b,onClose:()=>f(!1),onSelect:e=>{h({judgeModel:e?.value||""}),f(!1)},activeProviders:r,title:"Select Judge Model",addedModelValues:k?[k]:[],closeOnSelect:!0}),j&&(0,l.jsx)(d.rq,{isOpen:j,onClose:()=>g(!1),onSelect:e=>{h({routerModel:e?.value||""}),g(!1)},activeProviders:r,kindFilter:"systemone",title:(0,u.Tl)("Select Decision Model"),addedModelValues:C?[C]:[],closeOnSelect:!0})]})}function k({capacityAdapter:e,onChange:t,activeProviders:s,getCaps:a}){return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:(0,u.Tl)("Vision Adapter")}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:(0,u.Tl)("Your model can't read image/audio? Auto-switches to a model in the pool below.")}),(0,l.jsxs)("ul",{className:"mt-1.5 text-[11px] text-text-muted flex flex-col gap-0.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Vision"})," — ",(0,u.Tl)("Images")," (png, jpg, webp, …)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Audio"})," — ",(0,u.Tl)("Audio input")]})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:b.map(r=>(0,l.jsx)(C,{cap:r,entry:e[r.key]||j,onChange:s=>t({...e,[r.key]:s}),activeProviders:s,getCaps:a},r.key))})]})}function C({cap:e,entry:t,onChange:s,activeProviders:r,getCaps:n}){let[o,i]=(0,a.useState)(!1),{enabled:c,roundRobin:m,models:x}=t,p=e=>s({...t,...e}),h=(e,t)=>{let s=e+t;if(s<0||s>=x.length)return;let l=[...x];[l[e],l[s]]=[l[s],l[e]],p({models:l})};return(0,l.jsxs)(d.Zp,{padding:"sm",className:`group ${!c?"opacity-50":""}`,children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[(0,l.jsx)(d.lM,{checked:c,onChange:e=>p({enabled:e}),"aria-label":`${(0,u.Tl)("Enable")} ${e.label} ${(0,u.Tl)("adapter")}`}),(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:e.icon})}),(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"font-mono text-sm font-medium",children:e.label}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["— ",(0,u.Tl)(e.desc)]})]})})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer select-none",children:[(0,l.jsx)(d.lM,{checked:m,onChange:e=>p({roundRobin:e}),disabled:!c,"aria-label":`${(0,u.Tl)("Round-robin")} ${e.label} ${(0,u.Tl)("adapter")}`}),(0,l.jsx)("span",{children:(0,u.Tl)("Round")})]}),(0,l.jsx)(d.$n,{icon:"add",variant:"ghost",size:"sm",onClick:()=>i(!0),disabled:!c,title:`${(0,u.Tl)("Add Model")} — ${e.label}`,children:(0,u.Tl)("Add Model")})]})]}),0===x.length?(0,l.jsxs)("div",{className:"mt-3 py-2 text-center text-xs text-text-muted italic",children:[(0,u.Tl)("No models in pool")," (",(0,u.Tl)("will fallback to")," ",(0,l.jsx)("code",{className:"font-mono",children:f}),")"]}):(0,l.jsx)("div",{className:"mt-3 overflow-hidden rounded-lg border border-border/50",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-border/40 bg-black/[0.02] text-text-muted dark:bg-white/[0.02]",children:[(0,l.jsx)("th",{className:"w-12 px-3 py-1.5 text-center font-medium",children:"#"}),(0,l.jsx)("th",{className:"px-3 py-1.5 font-medium",children:(0,u.Tl)("Model")}),(0,l.jsx)("th",{className:"w-24 px-3 py-1.5 text-center font-medium",children:(0,u.Tl)("Order")}),(0,l.jsx)("th",{className:"w-12 px-3 py-1.5 text-right"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-border/30 font-mono",children:x.map((e,t)=>(0,l.jsxs)("tr",{className:"transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",children:[(0,l.jsxs)("td",{className:"px-3 py-2 text-center font-sans text-[11px] text-text-muted",children:["#",t+1]}),(0,l.jsx)("td",{className:"px-3 py-2 text-text-main",children:(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"truncate",children:e}),(0,l.jsx)(d.nh,{caps:n?.(e)}),e===f&&(0,l.jsx)("span",{className:"rounded bg-emerald-500/10 px-1.5 py-0.5 font-sans text-[10px] font-medium text-emerald-600 dark:text-emerald-400",children:"free default"})]})}),(0,l.jsx)("td",{className:"px-3 py-2",children:(0,l.jsxs)("div",{className:"flex items-center justify-center gap-1",children:[(0,l.jsx)("button",{type:"button",onClick:()=>h(t,-1),disabled:!c||0===t,className:`rounded p-1 transition-colors ${!c||0===t?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:(0,u.Tl)("Move up"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] leading-none",children:"arrow_upward"})}),(0,l.jsx)("button",{type:"button",onClick:()=>h(t,1),disabled:!c||t===x.length-1,className:`rounded p-1 transition-colors ${!c||t===x.length-1?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:(0,u.Tl)("Move down"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] leading-none",children:"arrow_downward"})})]})}),(0,l.jsx)("td",{className:"px-3 py-2 text-right",children:(0,l.jsx)("button",{type:"button",onClick:()=>{let e;p({models:0===(e=x.filter((e,s)=>s!==t)).length?[f]:e})},disabled:!c,className:`rounded p-1 transition-colors ${!c?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-red-500/10 hover:text-red-500"}`,title:(0,u.Tl)("Remove model"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] leading-none",children:"close"})})})]},`${e}-${t}`))})]})}),o&&(0,l.jsx)(d.rq,{isOpen:o,onClose:()=>i(!1),onSelect:e=>{x.includes(e.value)||p({models:[...x,e.value]})},onDeselect:e=>{let t=x.filter(t=>t!==e.value);p({models:0===t.length?[f]:t})},activeProviders:r,title:`Add ${e.label} Model`,addedModelValues:x,capFilter:e.key,closeOnSelect:!1})]})}function S({id:e,index:t,model:s,isFirst:r,isLast:i,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:x}){let{attributes:p,listeners:u,setNodeRef:h,transform:b,isDragging:f}=(0,n.gl)({id:e}),j={transform:o.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[g,y]=(0,a.useState)(!1),[v,N]=(0,a.useState)(s),w=()=>{let e=v.trim();e&&e!==s?d(e):N(s),y(!1)};return(0,l.jsxs)("div",{ref:h,style:j,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...p,...u,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),g?(0,l.jsx)("input",{autoFocus:!0,value:v,onChange:e=>N(e.target.value),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w(),"Escape"===e.key&&(N(s),y(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>y(!0),title:"Click to edit",children:s}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:c,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function T({isOpen:e,combo:t,onClose:s,onSave:o,activeProviders:c,kindFilter:m=null}){let[x,p]=(0,a.useState)(t?.name||""),[u,b]=(0,a.useState)(t?.models||[]),[f,j]=(0,a.useState)(!1),[g,y]=(0,a.useState)(!1),[v,N]=(0,a.useState)(""),[w,k]=(0,a.useState)({}),C=(0,r.FR)((0,r.MS)(r.AN,{activationConstraint:{distance:5}}),(0,r.MS)(r.uN,{coordinateGetter:n.JR})),M=u.map((e,t)=>({uid:`item-${t}`,model:e})),$=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();k(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,a.useEffect)(()=>{e&&$()},[e]);let E=e=>e.trim()?h.test(e)?(N(""),!0):(N("Only letters, numbers, -, _ and . allowed"),!1):(N("Name is required"),!1),O=async()=>{E(x)&&(y(!0),await o({name:x.trim(),models:u}),y(!1))},A=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.aF,{isOpen:e,onClose:s,title:A?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.pd,{label:"Combo Name",value:x,onChange:e=>{let t=e.target.value;p(t),t?E(t):N("")},placeholder:"my-combo",error:v}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===u.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(r.Mp,{sensors:C,collisionDetection:r.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=M.findIndex(e=>e.uid===t.id),l=M.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&b(t=>(0,n.be)(t,e,l))}},modifiers:[i.FN,i.gj],children:(0,l.jsx)(n.gB,{items:M.map(e=>e.uid),strategy:n._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:t},s)=>(0,l.jsx)(S,{id:e,index:s,model:t,isFirst:0===s,isLast:s===M.length-1,onEdit:e=>{let t=[...u];t[s]=e,b(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...u];[t[e-1],t[e]]=[t[e],t[e-1]],b(t)})(s),onMoveDown:()=>(e=>{if(e===u.length-1)return;let t=[...u];[t[e],t[e+1]]=[t[e+1],t[e]],b(t)})(s),onRemove:()=>{b(u.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>j(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(d.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(d.$n,{onClick:O,fullWidth:!0,size:"sm",disabled:!x.trim()||!!v||g,children:g?"Saving...":A?"Save":"Create"})]})]})}),f&&(0,l.jsx)(d.rq,{isOpen:f,onClose:()=>j(!1),onSelect:e=>{u.includes(e.value)||b([...u,e.value])},onDeselect:e=>{b(u.filter(t=>t!==e.value))},activeProviders:c,modelAliases:w,title:"Add Model to Combo",kindFilter:m,addedModelValues:u,closeOnSelect:!1})]})}},84680:(e,t,s)=>{"use strict";s.d(t,{PM:()=>l.PM,Sj:()=>l.Sj,Vy:()=>l.Vy,fF:()=>l.fF,sl:()=>l.sl,vL:()=>l.vL,y$:()=>l.y$,zM:()=>l.zM});var l=s(44923)}},e=>{e.O(0,[3170,305,5353,1321,5497,8441,3794,7358],()=>e(e.s=56836)),_N_E=e.O()}]);
@@ -1,14 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{43073:(e,t,i)=>{"use strict";i.d(t,{O:()=>l,l:()=>a});let s=/https:\/\/accounts\.google\.com\/signin\/continue[^\s"'<>)\]]+/;function l(e){if("string"!=typeof e)return null;let t=s.exec(e);return t?t[0]:null}let n=/https:\/\/[^\s"'<>)\]]*account\.stepfun\.com\/security[^\s"'<>)\]]*/;function a(e){if("string"!=typeof e)return null;let t=n.exec(e);return t?t[0]:null}},70217:(e,t,i)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"partial"===t?"warning":"error"===t||"expired"===t||"unavailable"===t||"needs-reauth"===t?"error":"default"}i.d(t,{g:()=>s})},83204:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>er});var s=i(95155),l=i(12115),n=i(73321),a=i(98500),r=i.n(a),o=i(5772),d=i(8247),c=i(35497),u=i(88105),m=i(28777),p=i(73006);function x(e){if("string"!=typeof e)return null;let t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return null;let i=Number(t[1]),s=Number(t[2]);return i>23||s>59?null:60*i+s}function h(e,t=Date.now()){let i;if(!e||"object"!=typeof e)return null;let s=x(e.window_start),l=x(e.window_end);if(null===s||null===l||s===l)return null;let n=e.timezone||"Asia/Singapore",a=function(e,t=Date.now()){try{let i=new Intl.DateTimeFormat("en-GB",{timeZone:e,hourCycle:"h23",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(t)),s=e=>Number(i.find(t=>t.type===e)?.value),l=s("hour"),n=s("minute"),a=s("second");if([l,n,a].some(e=>!Number.isFinite(e)))return null;return{hour:l,minute:n,second:a,secondsOfDay:3600*l+60*n+a}}catch{return null}}(n,t);if(!a)return null;let r=a.minute+60*a.hour,o=s<=l?r>=s&&r<l:r>=s||r<l;return i=o?(60*l-a.secondsOfDay+86400)%86400:(60*s-a.secondsOfDay+86400)%86400,{active:o,secondsToBoundary:i,windowLabel:`${e.window_start}–${e.window_end}`,timezone:n}}function f(e,t){return e&&"object"==typeof e&&(t&&String(t).startsWith("zh")?e.zh||e.en:e.en||e.zh)||""}function g({promotion:e}){var t;let[i,n]=(0,l.useState)(()=>Date.now());(0,l.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]);let a=h(e,i);if(!a)return null;let r=f(e?.badge,(0,p.kk)()),o=f(e?.description,(0,p.kk)()),d=!Number.isFinite(t=a.secondsToBoundary)||t<0?"--:--:--":[Math.floor(t/3600),Math.floor(t%3600/60),Math.floor(t%60)].map(e=>String(e).padStart(2,"0")).join(":"),c=a.active?`${(0,p.Tl)("Off-peak discount active")} \xb7 ${d} ${(0,p.Tl)("until standard rate")}`:`${d} ${(0,p.Tl)("until off-peak discount")}`;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 rounded-[10px] bg-green-500/10 px-3 py-2 text-xs text-green-600 dark:text-green-400",title:o||void 0,children:[(0,s.jsx)("span",{className:"material-symbols-outlined",style:{fontSize:16},children:"eco"}),(0,s.jsx)("span",{className:"font-medium",children:c}),r&&(0,s.jsxs)("span",{className:"opacity-80",children:["\xb7 ",r]}),(0,s.jsxs)("span",{className:"ml-auto font-mono opacity-60",children:[a.windowLabel," ",a.timezone]})]})}var y=i(990),b=i(62630);i(67468);let v=["none","low","medium","high"],j=["none","thinking"],w=["none","low","medium","high","xhigh","max"],k={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":w,"claude-budget":w,"gemini-level":["minimal","low","medium","high"],"gemini-budget":v,zai:j,qwen:v,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],minimax:j,hunyuan:v,step:v},N=["none","minimal","low","medium","high","xhigh","max"],T=["none","low","medium","high","max"],C=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:T},{pattern:"*claude*4-6*",levels:T},{provider:"codex",pattern:"*gpt-6.1-sol*",levels:["low","medium","high","xhigh","max"]},{provider:"codex",pattern:"*gpt-6-sol*",levels:["low","medium","high","xhigh","max"]},{provider:"codex",pattern:"*gpt-6-luna*",levels:["low","medium","high","xhigh","max"]},{provider:"codex",pattern:"*gpt-6*",levels:N},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...N,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...N,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:N},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*preview*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"amd",pattern:"DeepSeek-V4-Flash*",levels:["none","minimal","low","medium","high","xhigh","max"]},{provider:"amd",pattern:"Qwen3.8-Flash-Next",levels:["none","low","medium","xhigh"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]}];function S(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 i=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(!i)return null;let{major:s,minor:l}=i;return s<4||4===s&&(null===l||l<=5||null!==l&&l>=1e3)?null:"output_config"}(t))return null;let i=(0,y.nl)(e,t);if(!i.reasoning)return null;let s=C.find(i=>(!i.provider||i.provider===e)&&(0,b.gH)(i.pattern,t)),l=s?.levels||k[i.thinkingFormat]||v;return!1===i.thinkingCanDisable&&(l=l.filter(e=>"none"!==e)),l}var $=i(11059),A=i(929),O=i(65921);let E=new Map;async function P(e){if(!e?.url||!e?.type)return[];let t=E.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),i=await fetch(`/api/providers/suggested-models?${t}`);if(!i.ok)return[];let s=(await i.json()).data??[];return E.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function D({customModels:e=[],modelAliases:t={},providerAlias:i,builtInModels:s=[],type:l="llm",includeLegacyAliases:n=!0}){let a=new Set(s.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==i)continue;let e=t?.kind||t?.type||"llm";if(l&&e!==l||a.has(t.id))continue;let s=`${i}/${t.id}`;r.has(s)||(r.add(s),o.push({id:t.id,name:t.name||t.id,fullModel:s,source:"custom",type:e,enabled:!1!==t.enabled,...void 0===t.vision?{}:{vision:t.vision},...void 0===t.reasoning?{}:{reasoning:t.reasoning},...void 0===t.contextWindow?{}:{contextWindow:t.contextWindow},...void 0===t.maxOutput?{}:{maxOutput:t.maxOutput}}))}if(!n)return o;let d=`${i}/`;for(let[e,i]of Object.entries(t||{})){if("string"!=typeof i||!i.startsWith(d))continue;let t=i.slice(d.length);!t||a.has(t)||r.has(i)||(r.add(i),o.push({id:t,alias:e,fullModel:i,source:"legacyAlias",type:l||"llm"}))}return o}var I=i(43073),R=i(90337),M=i(31474),q=i(14051),z=i.n(q),F=i(47650);let _=e=>{let t=Number(String(e).trim());return Number.isFinite(t)&&t>0?Math.floor(t):null};function U({label:e,builtIn:t,value:i,onChange:l,invalid:n,autoFocus:a}){return(0,s.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"flex items-baseline justify-between gap-2 text-text-muted",children:[(0,s.jsx)("span",{children:e}),t?(0,s.jsxs)("span",{className:"font-mono text-[10px] text-text-subtle",children:[(0,p.Tl)("Built-in")," ",t]}):null]}),(0,s.jsx)("input",{type:"number",min:"1",step:"1",value:i,autoFocus:a,onChange:e=>l(e.target.value),placeholder:t?String(t):(0,p.Tl)("Not set"),className:`rounded-md border bg-bg px-2 py-1.5 font-mono text-text focus:outline-none ${n?"border-red-500":"border-border focus:border-primary"}`})]})}function L({caps:e,baseCaps:t,pinned:i,label:n,onSave:a}){let[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),[x,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(""),y=(0,l.useRef)(null),b=(0,l.useRef)(null),v=t?.contextWindow??null,j=t?.maxOutput??null,w=_(x),k=_(f),N=""!==x.trim()&&null===w,T=""!==f.trim()&&null===k,C=!d&&!N&&!T,S=(0,l.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),i=b.current?.offsetWidth||300,s=b.current?.offsetHeight||300,l=window.innerHeight-t.bottom-8,n=l<s&&t.top-8>l;m({left:Math.min(Math.max(8,t.right-i),Math.max(8,window.innerWidth-i-8)),top:n?void 0:t.bottom+6,bottom:n?window.innerHeight-t.top+6:void 0})},[]);(0,l.useEffect)(()=>{if(!r)return;let e=e=>{b.current?.contains(e.target)||y.current?.contains(e.target)||o(!1)},t=e=>{"Escape"===e.key&&o(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[r,S]),(0,l.useLayoutEffect)(()=>{r&&S()},[r,S]);let $=async e=>{c(!0);try{await a(e?{contextWindow:null,maxOutput:null}:{contextWindow:w,maxOutput:k}),o(!1)}finally{c(!1)}};return(0,s.jsxs)("div",{className:"relative shrink-0",children:[(0,s.jsx)("button",{ref:y,onClick:()=>{r?o(!1):(h(e?.contextWindow?String(e.contextWindow):""),g(e?.maxOutput?String(e.maxOutput):""),o(!0))},"aria-haspopup":"dialog","aria-expanded":r,className:`rounded p-0.5 transition-colors hover:bg-sidebar ${i?"text-primary":"text-text-muted hover:text-primary"}`,title:(0,p.Tl)("Model limits"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"tune"})}),r&&"u">typeof document&&(0,F.createPortal)((0,s.jsxs)("div",{ref:b,role:"dialog","aria-label":(0,p.Tl)("Model limits"),onKeyDown:e=>{"Enter"===e.key&&C&&(e.preventDefault(),$(!1))},style:{position:"fixed",width:300,left:u?.left??0,top:u?.top,bottom:u?.bottom,visibility:u?"visible":"hidden"},className:"z-50 flex flex-col gap-2.5 rounded-xl border border-border bg-surface p-3 text-xs shadow-[var(--shadow-elev)]",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border-subtle pb-2",children:[(0,s.jsx)("span",{className:"min-w-0 truncate font-medium text-text",children:n||(0,p.Tl)("Model limits")}),i?(0,s.jsx)("span",{className:"shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] text-primary",children:(0,p.Tl)("Overridden")}):null]}),(0,s.jsx)(U,{label:(0,p.Tl)("Context window"),builtIn:v,value:x,onChange:h,invalid:N,autoFocus:!0}),(0,s.jsx)(U,{label:(0,p.Tl)("Max output"),builtIn:j,value:f,onChange:g,invalid:T}),(N||T)&&(0,s.jsx)("p",{className:"text-[10px] leading-snug text-red-500",children:(0,p.Tl)("Enter a whole number greater than 0")}),null!==w&&null!==k&&k>w&&(0,s.jsx)("p",{className:"text-[10px] leading-snug text-amber-600 dark:text-amber-400",children:(0,p.Tl)("Max output is larger than the context window")}),(0,s.jsx)("p",{className:"text-[10px] leading-snug text-text-muted/70",children:(0,p.Tl)("Overrides the built-in catalog values")}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-border-subtle pt-2",children:[(0,s.jsx)("button",{className:"rounded px-2 py-1 text-text-muted hover:text-red-500 disabled:opacity-40",onClick:()=>$(!0),disabled:d||!i,children:(0,p.Tl)("Restore built-in")}),(0,s.jsx)("button",{className:"rounded bg-primary px-2.5 py-1 text-white disabled:opacity-50",onClick:()=>$(!1),disabled:!C,children:(0,p.Tl)("Save")})]})]}),document.body)]})}function K({model:e,fullModel:t,alias:i,copied:n,onCopy:a,testStatus:r,isCustom:o,isFree:d,onDeleteAlias:u,onTest:m,isTesting:x,onDisable:g,onEnable:y,caps:b,baseCaps:v,thinkingSuffix:j,onSaveCaps:w,capsPinned:k}){let N=function(){let[e,t]=(0,l.useState)(()=>new Date().getHours());return(0,l.useEffect)(()=>{let e=setInterval(()=>t(new Date().getHours()),6e4);return()=>clearInterval(e)},[]),e}(),T=j?`${t}(${j})`:t,C="number"==typeof e.rateMultiplier?e.rateMultiplier:null,S=function(e,t){if(!t||"number"!=typeof e||Number.isNaN(e))return!1;let{from:i,to:s}=t;return i<=s?e>=i&&e<s:e>=i||e<s}(N,e.nightFree),$=null!==C&&C>0&&function(e,t=Date.now()){let i=function(e){let t=e?.promoFreeUntil;if("string"!=typeof t||""===t.trim())return null;let i=Date.parse(t);return Number.isFinite(i)?i:null}(e);return null!==i&&t<i}(e),A=$?0:C,O=S||0===A,E=function(e){let[t,i]=(0,l.useState)(()=>Date.now()),s=e?`${e.window_start}|${e.window_end}|${e.timezone}`:null;return(0,l.useEffect)(()=>{if(!s)return;let e=setInterval(()=>i(Date.now()),3e4);return()=>clearInterval(e)},[s]),h(e,t)}(e.promotion),P="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:P?{color:P}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,s.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:T}),(0,s.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,s.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,s.jsx)(c.nh,{caps:b,colorOverride:"text-text-muted/70",size:12}),e.paidTier&&(0,s.jsx)(c.m_,{text:(0,p.Tl)("Not available on every plan yet — needs a paid tier, or is still rolling out"),children:(0,s.jsx)(c.Ex,{size:"xs",variant:"warning",icon:"lock",className:"shrink-0 cursor-help leading-none",children:(0,p.Tl)("Paid tier")})}),e.subPriority&&(0,s.jsx)(c.m_,{text:(0,p.Tl)("Prioritized for subscribers"),children:(0,s.jsx)(c.Ex,{size:"xs",variant:"info",icon:"bolt",className:"shrink-0 cursor-help leading-none",children:(0,p.Tl)("Sub priority")})}),(null!==A||S)&&(0,s.jsx)(c.m_,{text:S?`${(0,p.Tl)("Night-free window")} (23:00–08:00) — ${(0,p.Tl)("rides the free quota")}`:$?(0,p.Tl)("Credit multiplier")+`: ${C}x — `+(0,p.Tl)("promo free until")+` ${function(e){let t=Date.parse(String(e||""));if(!Number.isFinite(t))return String(e||"");try{return new Date(t).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return String(e||"")}}(e.promoFreeUntil)}`:0===A?(0,p.Tl)("Credit multiplier")+": 0x — "+(0,p.Tl)("rides the free quota"):(0,p.Tl)("Credit multiplier")+`: ${A}x`,children:(0,s.jsx)(c.Ex,{size:"sm",variant:O?"success":"default",className:`shrink-0 cursor-help leading-none${O?"":" font-mono"}`,children:O?"free":`${A.toFixed(2)}x`})}),E&&(0,s.jsx)(c.m_,{text:[f(e.promotion?.badge,(0,p.kk)())||(0,p.Tl)("Off-peak discount"),f(e.promotion?.description,(0,p.kk)()),`${E.windowLabel} ${E.timezone}${E.active?` — ${(0,p.Tl)("active now")}`:""}`].filter(Boolean).join(" \xb7 "),children:(0,s.jsx)(c.Ex,{size:"sm",variant:E.active?"success":"default",className:"shrink-0 cursor-help leading-none",children:(0,s.jsx)("span",{className:"material-symbols-outlined align-[-1px]",style:{fontSize:10},children:"eco"})})})]})]}),w&&(0,s.jsx)(L,{caps:b,baseCaps:v,pinned:k,label:e.name||t,onSave:w}),m&&(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:m,disabled:x,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${x?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:x?{animation:"spin 1s linear infinite"}:void 0,children:x?"progress_activity":"science"})}),(0,s.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:x?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:()=>a(T,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:n===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:n===`model-${e.id}`?"Copied!":"Copy"})]}),o?(0,s.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):y?(0,s.jsx)("button",{onClick:y,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-green-500/10 hover:text-green-500",title:(0,p.Tl)("Enable this model"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"})}):g?(0,s.jsx)("button",{onClick:g,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function J({modelId:e,fullModel:t,copied:i,onCopy:l,onDeleteAlias:n,onToggle:a,enabled:r=!0,onTest:o,testStatus:d,isTesting:c}){let u="ok"===d?"#22c55e":"error"===d?"#ef4444":void 0;return(0,s.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===d?"border-green-500/40":"error"===d?"border-red-500/40":"border-border"} hover:bg-sidebar/50 ${r?"":"opacity-60"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:u?{color:u}:void 0,children:"ok"===d?"check_circle":"error"===d?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>l(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e}`?"Copied!":"Copy"})]}),o&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:o,disabled:c,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]})]})]}),a&&(0,s.jsx)("button",{onClick:a,className:`p-1 rounded ${r?"text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-500/10":"text-green-600 hover:bg-green-50 dark:hover:bg-green-500/10"}`,title:r?"Disable model":"Activate model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:r?"block":"restart_alt"})}),(0,s.jsx)("button",{onClick:n,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function W({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,customModels:n,copied:a,onCopy:r,onDeleteAlias:o,onAddCustomModel:d,onToggleCustomModel:u,onDeleteCustomModel:m,onBulkCustomModels:x,connections:h,isAnthropic:f}){let g=(0,O.i)(),[y,b]=(0,l.useState)(""),[v,j]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!1),[N,T]=(0,l.useState)(null),[C,S]=(0,l.useState)({}),$=async t=>{if(!N){T(t);try{let i=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await i.json();S(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{S(e=>({...e,[t]:"error"}))}finally{T(null)}}},A=D({customModels:n,modelAliases:i,providerAlias:e,type:"llm"}),E=A.filter(e=>!1!==e.enabled),P=A.filter(e=>!1===e.enabled),I=async()=>{if(!y.trim()||v)return;let e=y.trim();if(A.some(t=>t.id===e))return void g.warning("Model already exists for this provider.");j(!0);try{await d(e),b("")}catch(e){console.log("Error adding model:",e)}finally{j(!1)}},R=async()=>{if(w)return;let e=h.find(e=>!1!==e.isActive);if(e){k(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),i=await t.json();if(!t.ok)return void g.error(i.error||"Failed to import models");let s=i.models||[];if(0===s.length)return void g.warning("No models returned from /models.");let l=0;for(let e of s){let t=e.id||e.name||e.model;t&&(A.some(e=>e.id===t)||(await d(t,!1),l+=1))}0===l&&g.warning("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{k(!1)}}},M=h.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",f?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:y,onChange:e=>b(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:f?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary"})]}),(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:I,disabled:!y.trim()||v,children:v?"Adding...":"Add"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:R,disabled:!M||w,children:w?"Importing...":"Import from /models"})]}),!M&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),A.length>0&&x&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,s.jsxs)("span",{children:[A.length," custom model",A.length>1?"s":""]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>x(!0),className:"text-primary hover:underline",children:(0,p.Tl)("Enable all")}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>x(!1),className:"text-text-muted hover:text-red-500 hover:underline",children:(0,p.Tl)("Disable all")}),(0,s.jsxs)("span",{children:["— ",(0,p.Tl)("bulk actions affect what clients see in /v1/models")]})]}),E.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:E.map(({id:i,alias:l,source:n})=>(0,s.jsx)(J,{modelId:i,fullModel:`${t}/${i}`,copied:a,onCopy:r,onDeleteAlias:()=>"custom"===n?m(i):o(l),onToggle:"custom"===n&&u?()=>u(i,!1):void 0,onTest:h.length>0?()=>$(i):void 0,testStatus:C[i],isTesting:N===i},`${n}-${e}/${i}`))}),P.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Disabled (activate to expose again):"}),P.map(({id:i,alias:l,source:n})=>(0,s.jsx)(J,{modelId:i,fullModel:`${t}/${i}`,copied:a,onCopy:r,enabled:!1,onDeleteAlias:()=>"custom"===n?m(i):o(l),onToggle:"custom"===n&&u?()=>u(i,!0):void 0,onTest:h.length>0?()=>$(i):void 0,testStatus:C[i],isTesting:N===i},`disabled-${n}-${e}/${i}`))]})]})}K.propTypes={model:z().shape({id:z().string.isRequired,rateMultiplier:z().number,paidTier:z().bool,subPriority:z().bool,promotion:z().object,nightFree:z().shape({from:z().number,to:z().number})}).isRequired,fullModel:z().string.isRequired,alias:z().string,copied:z().string,onCopy:z().func.isRequired,testStatus:z().oneOf(["ok","error"]),isCustom:z().bool,isFree:z().bool,onDeleteAlias:z().func,onTest:z().func,isTesting:z().bool,onDisable:z().func,onEnable:z().func,caps:z().object,baseCaps:z().object,thinkingSuffix:z().string,onSaveCaps:z().func,capsPinned:z().bool},z().string.isRequired,z().string.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func,z().oneOf(["ok","error"]),z().bool,z().string.isRequired,z().object.isRequired,z().arrayOf(z().object),z().string,z().func.isRequired,z().func.isRequired,z().func.isRequired,z().func.isRequired,W.propTypes={providerStorageAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,modelAliases:z().object.isRequired,customModels:z().arrayOf(z().object),copied:z().string,onCopy:z().func.isRequired,onDeleteAlias:z().func.isRequired,onAddCustomModel:z().func.isRequired,onBulkCustomModels:z().func,onToggleCustomModel:z().func,onDeleteCustomModel:z().func.isRequired,connections:z().arrayOf(z().shape({id:z().string,isActive:z().bool})).isRequired,isAnthropic:z().bool};var B=i(70217),H=i(36109);function V({until:e,inline:t=!1}){let[i,n]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void n("");let i=Math.floor(t/1e3);if(i<60)n(`${i}s`);else if(i<3600)n(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);n(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),i)?t?(0,s.jsxs)("span",{className:"shrink-0 text-xs text-orange-500 font-mono",children:[(0,s.jsx)("span",{className:"text-[0.85em] leading-none",children:"⏱"})," ",i]}):(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:[(0,s.jsx)("span",{className:"text-[0.85em] leading-none",children:"⏱"})," ",i]}):null}function Q({connection:e,proxyPools:t,isOAuth:i,isFirst:n,isLast:a,onMoveUp:r,onMoveDown:o,onToggleActive:d,onUpdateProxy:u,onEdit:m,onDelete:x,oneByOneStatus:h=null,autoPing:f=null}){let[g,y]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),j=(0,l.useRef)(null),w=(0,l.useRef)(null),[k,N]=(0,l.useState)(null),T=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?T.get(C):null,A=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,O=!!C||A,E=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:A?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",P=[];f?.reactiveOn&&P.push("on reset"),f?.scheduleOn&&P.push(`Scheduled (${f.scheduleSummary||"active"})`);let D=P.length>0?`Auto-ping active: ${P.join(" + ")}. Click to configure.`:f?.provider==="codex"?"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.",M="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);M=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{M=t}}let q=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",z="default";S?.isActive===!0?z="success":(C||A)&&(z="error"),(0,l.useEffect)(()=>{if(!g)return;let e=e=>{j.current?.contains(e.target)||w.current?.contains(e.target)||y(!1)},t=()=>y(!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)}},[g]);let _=async e=>{v(!0);try{await u("__none__"===e?null:e)}finally{v(!1),y(!1)}},U=e.authType||(i?"oauth":"apikey"),L="oauth"===U,K="cookie"===U,J=e.providerSpecificData?.authMethod,W="string"==typeof e.accessToken?e.accessToken:"",G=e.hasDesktopSession??!!e.providerSpecificData?.mimoPassToken,Z=e.hasAccessToken??(W.length>0&&!W.startsWith("mimo-desktop-session")),Y="desktop-session"===J||G&&!Z,X=G&&Z,ee=!X&&!Y&&"oauth"===J,et=Y||X?(0,p.Tl)("Desktop Session"):ee?(0,p.Tl)("Browser sign-in"):L?"OAuth":K?"Cookie":"API Key",ei=X?(0,p.Tl)("Browser sign-in"):null,es=e.providerSpecificData?.mimoUserId||e.providerSpecificData?.uid||null,el=("xiaomi-mimo"===e.provider||"xiaomi-tokenplan"===e.provider)&&es?`MiMo ${es}`:null,en=e.name?.trim(),ea=e.email?.trim(),er=e.displayName?.trim(),eo=!!(en&&en!==ea&&(!er||en!==er)),ed=en||el||ea||er||(L?"OAuth Account":K?"Cookie Account":"API Key"),ec=eo?null:en&&ea&&en!==ea||el&&ea&&ea!==el?ea:en&&er&&en!==er?er:null,[eu,em]=(0,l.useState)(()=>(0,H._)(e));(0,l.useEffect)(()=>{let t=()=>{em(t=>{let i=(0,H._)(e);return(0,H.W)(t,i)?t:i})};t();let i=Object.keys(e).some(t=>t.startsWith("modelLock_")&&e[t])?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[e]);let{state:ep,earliestUntil:ex}=eu,eh="partial"===ep||"unavailable"===ep,ef="needs-reauth"===ep?(0,p.Tl)("Needs re-auth"):"partial"===ep?(0,p.Tl)("Partial"):ep,eg=!1!==e.isActive?(0,I.O)(e.lastError):null,ey=!1===e.isActive||eg?null:(0,I.l)(e.lastError),eb=eg||ey,{copied:ev,copy:ej}=(0,$.C)(),ew=()=>h?"queued"===h.state?(0,p.Tl)("queued"):"testing"===h.state?(0,p.Tl)("testing"):"success"===h.state?(0,p.Tl)("success"):"failed"===h.state?h.error?`${(0,p.Tl)("failed")}: ${h.error}`:(0,p.Tl)("failed"):null:null;return(0,s.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,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,s.jsx)("button",{onClick:r,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:o,disabled:a,className:`p-0.5 rounded ${a?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:G?"computer":ee?"login":K?"cookie":L?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:ed}),ec&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:ec}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(c.Ex,{variant:(0,B.g)(e.isActive,ep),size:"sm",dot:!0,children:!1===e.isActive?(0,p.Tl)("disabled"):ef||(0,p.Tl)("Unknown")}),(0,s.jsx)(c.Ex,{variant:"default",size:"sm",children:et}),ei&&(0,s.jsx)(c.Ex,{variant:"default",size:"sm",children:ei}),("qoder"===e.provider||"qoder-cn"===e.provider)&&(0,s.jsx)(c.Ex,{variant:e.providerSpecificData?.creditDaddyWebSession?"primary":"neutral",size:"sm",title:e.providerSpecificData?.creditDaddyWebSession?(0,p.Tl)("Synced via CreditDaddy web session (issue feedback goes to CreditDaddy)"):(0,p.Tl)("Native Qoder authorization"),children:e.providerSpecificData?.creditDaddyWebSession?"CD Sync":"Native"}),O&&(0,s.jsx)(c.Ex,{variant:z,size:"sm",children:"Proxy"}),e.earliestPackageExpiry&&(0,s.jsxs)(c.Ex,{variant:"outline",size:"sm",title:`${(0,p.Tl)("Earliest package")}: ${e.earliestPackageName||(0,p.Tl)("Quota package")} (${new Date(e.earliestPackageExpiry).toLocaleString()})`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] mr-1",children:"schedule"}),function(e){if(!e)return"";let t=new Date(e).getTime()-Date.now();if(t<=0)return(0,p.Tl)("expired");let i=Math.floor(t/36e5);if(i<24)return`${i}h`;let s=Math.floor(i/24);return s<30?i%24?`${s}d ${i%24}h`:`${s}d`:new Date(e).toLocaleDateString()}(e.earliestPackageExpiry)]}),eh&&!1!==e.isActive&&!e.lastError&&(0,s.jsx)(V,{until:ex}),e.lastError&&!1!==e.isActive&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 max-w-full truncate text-xs text-red-500 sm:max-w-[380px]",title:(0,R.DY)(e.lastError),children:[eh&&(0,s.jsx)(V,{until:ex,inline:!0}),(0,R.DY)(e.lastError)]}),eb&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:eb,target:"_blank",rel:"noopener noreferrer",title:(0,p.Tl)("Recommended: open in an incognito window and sign in with the affected account"),className:"shrink-0 text-xs text-blue-500 underline hover:text-blue-400",children:(0,p.Tl)(ey?"Complete verification":"Verify your account")}),(0,s.jsx)("button",{type:"button",onClick:()=>ej(eb,"verification"),title:(0,p.Tl)("Copy link"),className:"shrink-0 text-xs text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm align-middle",children:"verification"===ev?"check":"content_copy"})})]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),ew()&&(0,s.jsx)(c.Ex,{variant:h?"success"===h.state?"success":"failed"===h.state?"error":"testing"===h.state?"primary":"default":"default",size:"sm",children:ew()})]}),O&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:E,children:E}),M&&(0,s.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:M}),q&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:q,children:["no_proxy: ",q]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{ref:w,onClick:()=>{if(g)return void y(!1);let e=w.current?.getBoundingClientRect();if(!e)return void y(!0);let i=((t?.length||0)+1)*34+8,s=window.innerHeight-e.bottom,l=s<i&&e.top>s;N({position:"fixed",right:window.innerWidth-e.right,...l?{bottom:window.innerHeight-e.top+4,maxHeight:Math.max(e.top-8,120)}:{top:e.bottom+4,maxHeight:Math.max(s-8,120)}}),y(!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 ${O?"text-primary":"text-text-muted hover:text-primary"}`,disabled:b,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:b?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&"u">typeof document&&(0,F.createPortal)((0,s.jsxs)("div",{ref:j,style:k,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,s.jsx)("button",{onClick:()=>_("__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,s.jsx)("button",{onClick:()=>_(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)]}),f&&(0,s.jsx)(c.m_,{text:D,children:(0,s.jsxs)("button",{type:"button",onClick:()=>f.onConfigure?.(),"aria-label":"Configure auto-ping",className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${f.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,s.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}V.propTypes={until:z().string.isRequired,inline:z().bool},Q.propTypes={connection:z().shape({id:z().string,name:z().string,email:z().string,displayName:z().string,modelLockUntil:z().string,testStatus:z().string,isActive:z().bool,lastError:z().string,priority:z().number,globalPriority:z().number}).isRequired,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string,proxyUrl:z().string,noProxy:z().string,isActive:z().bool})),isOAuth:z().bool.isRequired,isFirst:z().bool.isRequired,isLast:z().bool.isRequired,onMoveUp:z().func.isRequired,onMoveDown:z().func.isRequired,onToggleActive:z().func.isRequired,onUpdateProxy:z().func,onEdit:z().func.isRequired,onDelete:z().func.isRequired,oneByOneStatus:z().shape({state:z().string,error:z().string}),autoPing:z().shape({isActive:z().bool,reactiveOn:z().bool,scheduleOn:z().bool,scheduleSummary:z().string,provider:z().string,onConfigure:z().func})};let G=`name1|sk-key1
2
- name2|sk-key2
3
- sk-key-only-auto-named`;function Z({isOpen:e,provider:t,providerName:i,isCompatible:n,isAnthropic:a,authType:r,authHint:o,website:d,proxyPools:m,error:x,existingNames:h,onSave:f,onBulkDone:g,onClose:y}){let b="__none__",v="ollama-local"===t,j="cookie"===r,w="xai"===t&&!j,k=j?"Cookie Value":"qoder"===t?"Personal Access Token (PAT)":"API Key",N="azure"===t,T="cloudflare-ai"===t,C=u.Q2?.[t]?.regions||null,S=u.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[$,A]=(0,l.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:b,ollamaHostUrl:""}),[O,E]=(0,l.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,D]=(0,l.useState)({accountId:""}),[I,R]=(0,l.useState)(S),[M,q]=(0,l.useState)(!1),[z,F]=(0,l.useState)(null),[_,U]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(e&&C&&!M){let e=!0;return fetch("/api/network/egress-region").then(e=>e.json()).then(i=>{if(!e)return;let s=i?.recommendedRegions?.[t];s&&C.some(e=>e.id===s)&&(R(s),F({country:i.country||i.countryCode,regionId:s}))}).catch(()=>{}),()=>{e=!1}}},[e,t,C,M]);let[L,K]=(0,l.useState)(null),[J,W]=(0,l.useState)(null),[B,H]=(0,l.useState)(!1),[V,Q]=(0,l.useState)(!1),Y=T?`name1|sk-key1|acc123456
4
- name2|sk-key2|def789012
5
- sk-key-only-auto-named`:"qoder"===t?`name1|pt-xxxxx
6
- name2|pt-yyyyy
7
- pt-only-auto-named`:G,[X,ee]=(0,l.useState)("single"),[et,ei]=(0,l.useState)(""),[es,el]=(0,l.useState)(null),en=()=>v&&$.ollamaHostUrl.trim()?{baseUrl:$.ollamaHostUrl.trim()}:N?{azureEndpoint:O.azureEndpoint,apiVersion:O.apiVersion,deployment:O.deployment,organization:O.organization}:T?{accountId:P.accountId}:C&&I?{region:I}:void 0,ea=async()=>{U(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:en()})}),i=await e.json();K(i.valid?"success":"failed"),W(i.valid?null:i.error||null),H(!!i.maintenance)}catch{K("failed"),W(null),H(!1)}finally{U(!1)}},er=async()=>{if(t&&(v||$.apiKey)&&(v||$.name)&&(!n||$.defaultModel.trim())){Q(!0);try{let e=!1;try{U(!0),K(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:en()})});e=!!(await i.json()).valid,K(e?"success":"failed")}catch{K("failed")}finally{U(!1)}await f({name:$.name||(v?"Ollama Local":""),apiKey:$.apiKey,defaultModel:n?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===b?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:en()})}finally{Q(!1)}}},eo=async()=>{let e=et.split("\n");if(!e.length)return;let i=function(e,t,i={}){let{isCloudflareAi:s=!1}=i,l=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),n=[];for(let t of e){let e,i="string"==typeof t?t.trim():"";if(!i)continue;let a=function(e,t={}){let{isCloudflareAi:i=!1}=t,s=e.split("|");if(i&&s.length>=3){let e=s[0].trim();return{baseName:e||"Key",apiKey:s.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:s[s.length-1].trim()}}}return s.length>=2?{baseName:s[0].trim()||"Key",apiKey:s.slice(1).join("|").trim()}:{baseName:"Key",apiKey:s[0].trim()}}(i,{isCloudflareAi:s});if(!a||!a.apiKey)continue;let r=a.baseName,o=1;for(;e=`${r} ${o}`,l.has(e.toLowerCase());)o+=1;l.add(e.toLowerCase());let d={name:e,apiKey:a.apiKey,skipped:!1};a.providerSpecificData&&(d.providerSpecificData=a.providerSpecificData),n.push(d)}return n}(e,h,{isCloudflareAi:T});if(!i.length)return;Q(!0),el(null);let s=0,l=0;for(let e of i)try{let i=!1;try{let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});i=!!(await s.json().catch(()=>({}))).valid}catch{i=!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:i?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?s++:l++}catch{l++}Q(!1),el({success:s,failed:l}),s>0&&g&&g()};return t?(0,s.jsx)(c.aF,{isOpen:e,title:`Add ${i||t} ${k}`,onClose:y,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{size:"sm",variant:"single"===X?"primary":"ghost",onClick:()=>{ee("single"),el(null)},children:"Single"}),(0,s.jsx)(c.$n,{size:"sm",variant:"bulk"===X?"primary":"ghost",onClick:()=>{ee("bulk"),el(null)},children:"Bulk Add"})]}),"bulk"===X&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:T?(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t?(0,s.jsxs)(s.Fragment,{children:["One PAT per line. Format: ",(0,s.jsx)("code",{children:"name|pt-..."})," or just ",(0,s.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,s.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:Y,value:et,onChange:e=>ei(e.target.value)}),es&&(0,s.jsxs)("div",{className:`text-sm font-medium ${es.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",es.success," added",es.failed>0?`, ✗ ${es.failed} failed`:""]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{onClick:eo,fullWidth:!0,disabled:V||!et.trim(),children:V?"Adding...":"Add All Keys"}),(0,s.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===X&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.pd,{label:"Name",value:$.name,onChange:e=>A({...$,name:e.target.value}),placeholder:v?"Ollama Local":"Production Key"}),v&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.pd,{label:"Ollama Host URL",value:$.ollamaHostUrl,onChange:e=>A({...$,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(c.$n,{onClick:ea,disabled:_||V,variant:"secondary",children:_?"Checking...":"Check"})})]}),!v&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.pd,{label:k,type:j?"text":"password",value:$.apiKey,onChange:e=>A({...$,apiKey:e.target.value}),placeholder:j?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":w?"xai-...":"qoder"===t?"pt-...":"",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(c.$n,{onClick:ea,disabled:!$.apiKey||_||V,variant:"secondary",children:_?"Checking...":"Check"})})]}),w&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),j&&o&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),C&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.l6,{label:"Region",value:I,onChange:e=>{R(e.target.value),q(!0)},options:C.map(e=>({value:e.id,label:e.label}))}),z&&!M&&(0,s.jsxs)("p",{className:"text-xs text-primary mt-1 flex items-center gap-1",children:[(0,s.jsx)("span",{children:"\uD83C\uDF10"}),(0,s.jsx)("span",{children:(0,p.Tl)("Auto-matched region based on network location ({country})").replace("{country}",z.country)})]})]}),n&&(0,s.jsx)(c.pd,{label:"Default Model",value:$.defaultModel,onChange:e=>A({...$,defaultModel:e.target.value}),placeholder:a?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),v&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,s.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,s.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),L&&(0,s.jsx)(c.Ex,{variant:"success"===L?"success":B?"warning":"error",children:"success"===L?(0,p.Tl)("Valid"):B?(0,p.Tl)("Check endpoint"):(0,p.Tl)("Invalid")}),B&&J&&(0,s.jsx)("p",{className:"text-xs text-amber-500 break-words",children:(0,p.Tl)(J)}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),n&&(0,s.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."}),T&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,s.jsx)(c.pd,{label:"Account ID",value:P.accountId,onChange:e=>D({...P,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,s.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),N&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(c.pd,{label:"Azure Endpoint",value:O.azureEndpoint,onChange:e=>E({...O,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,s.jsx)(c.pd,{label:"Deployment Name",value:O.deployment,onChange:e=>E({...O,deployment:e.target.value}),placeholder:"gpt-4"}),(0,s.jsx)(c.pd,{label:"API Version",value:O.apiVersion,onChange:e=>E({...O,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,s.jsx)(c.pd,{label:"Organization",value:O.organization,onChange:e=>E({...O,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,s.jsx)(c.pd,{label:"Priority",type:"number",value:$.priority,onChange:e=>A({...$,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(c.l6,{label:"Proxy Pool",value:$.proxyPoolId,onChange:e=>A({...$,proxyPoolId:e.target.value}),options:[{value:b,label:"None"},...(m||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(m||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{onClick:er,fullWidth:!0,disabled:V||!v&&(!$.name||!$.apiKey)||n&&!$.defaultModel.trim()||N&&(!O.azureEndpoint||!O.deployment||!O.organization)||T&&!P.accountId,children:V?"Saving...":"Save"}),(0,s.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function Y({isOpen:e,node:t,onSave:i,onClose:n,isAnthropic:a}){let[r,o]=(0,l.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,u]=(0,l.useState)(!1),[m,p]=(0,l.useState)(""),[x,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[y,b]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(a?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,a]);let v=async()=>{if(r.name.trim()&&r.prefix.trim()&&r.baseUrl.trim()){u(!0);try{let e={name:r.name,prefix:r.prefix,baseUrl:r.baseUrl};a||(e.apiType=r.apiType),await i(e)}finally{u(!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:r.baseUrl,apiKey:m,type:a?"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,s.jsx)(c.aF,{isOpen:e,title:`Edit ${a?"Anthropic":"OpenAI"} Compatible`,onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(c.pd,{label:"Name",value:r.name,onChange:e=>o({...r,name:e.target.value}),placeholder:`${a?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(c.pd,{label:"Prefix",value:r.prefix,onChange:e=>o({...r,prefix:e.target.value}),placeholder:a?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!a&&(0,s.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:r.apiType,onChange:e=>o({...r,apiType:e.target.value})}),(0,s.jsx)(c.pd,{label:"Base URL",value:r.baseUrl,onChange:e=>o({...r,baseUrl:e.target.value}),placeholder:a?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${a?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>p(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(c.$n,{onClick:j,disabled:!m||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,s.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,s.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!r.name.trim()||!r.prefix.trim()||!r.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,s.jsx)(c.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function X({isOpen:e,providerAlias:t,providerDisplayAlias:i,onSave:n,onClose:a}){let[r,o]=(0,l.useState)(""),[d,u]=(0,l.useState)(null),[p,x]=(0,l.useState)(""),[h,f]=(0,l.useState)(!1),[g,y]=(0,l.useState)(""),[b,v]=(0,l.useState)(""),[j,w]=(0,l.useState)("llm"),[k,N]=(0,l.useState)("");(0,l.useEffect)(()=>{e&&(o(""),u(null),x(""),y(""),v(""),w("llm"),N(""))},[e]);let T=e=>{let i=`${t}/`;return e.startsWith(i)?e.slice(i.length):e},C=async()=>{let e=T(r.trim());if(e){u("testing"),x("");try{let i=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),s=await i.json();u(s.ok?"ok":"error"),x(s.error||"")}catch(e){u("error"),x(e.message)}}},S=async()=>{let e=T(r.trim());if(!e||h)return;f(!0);let t=e=>{let t=Number(String(e).trim());return Number.isFinite(t)&&t>0?Math.floor(t):void 0},i={contextWindow:t(g),maxOutput:t(b)};try{await n(e,i,j,"stt"===j?k:null)}finally{f(!1)}};return(0,s.jsx)(c.aF,{isOpen:e,onClose:a,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:r,onChange:e=>{o(e.target.value),u(null),x("")},onKeyDown:e=>{"Enter"===e.key&&C()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary",autoFocus:!0}),(0,s.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===d,onClick:C,disabled:!r.trim()||"testing"===d,children:"testing"===d?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:T(r.trim())||"model-id"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model type"}),(0,s.jsxs)("select",{value:j,onChange:e=>{w(e.target.value),"stt"!==e.target.value&&N("")},className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"llm",children:"LLM (chat)"}),(0,s.jsx)("option",{value:"stt",children:"STT (speech to text)"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"text-sm font-medium mb-1.5 block",children:["Transport ","stt"===j?"":"(STT only)"]}),(0,s.jsxs)("select",{value:k,onChange:e=>N(e.target.value),disabled:"stt"!==j,className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary disabled:opacity-50",children:[(0,s.jsx)("option",{value:"",children:"Provider default (REST)"}),m.vp.map(e=>(0,s.jsx)("option",{value:e,children:m.qw[e].label},e))]})]})]}),"ok"===d&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===d&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:p||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Context window"}),(0,s.jsx)("input",{type:"number",min:"1",step:"1",value:g,onChange:e=>y(e.target.value),placeholder:"e.g. 200000",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Max output"}),(0,s.jsx)("input",{type:"number",min:"1",step:"1",value:b,onChange:e=>v(e.target.value),placeholder:"e.g. 8192",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-surface focus:outline-none focus:border-primary"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(c.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(c.$n,{onClick:S,fullWidth:!0,size:"sm",disabled:!r.trim()||h,children:h?"Adding...":"Add Model"})]})]})})}Z.propTypes={isOpen:z().bool.isRequired,provider:z().string,providerName:z().string,isCompatible:z().bool,isAnthropic:z().bool,authType:z().string,authHint:z().string,website:z().string,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string})),error:z().string,existingNames:z().arrayOf(z().string),onSave:z().func.isRequired,onBulkDone:z().func,onClose:z().func.isRequired},Y.propTypes={isOpen:z().bool.isRequired,node:z().shape({id:z().string,name:z().string,prefix:z().string,apiType:z().string,baseUrl:z().string}),onSave:z().func.isRequired,onClose:z().func.isRequired,isAnthropic:z().bool},X.propTypes={isOpen:z().bool.isRequired,providerAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,onSave:z().func.isRequired,onClose:z().func.isRequired};let ee=`[
8
- {
9
- "accessToken": "eyJhbGc...",
10
- "refreshToken": "rt_...",
11
- "idToken": "eyJhbGc...",
12
- "email": "user@example.com"
13
- }
14
- ]`;function et({isOpen:e,onClose:t,onSuccess:i}){let[n,a]=(0,l.useState)(""),[r,o]=(0,l.useState)(!1),[d,u]=(0,l.useState)(""),[m,x]=(0,l.useState)(null),h=()=>{r||(a(""),u(""),x(null),t())},f=async()=>{var e;let t;u(""),x(null);let s=n.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){u(`${(0,p.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void u((0,p.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:l})}),t=await e.json();if(!e.ok)return void u(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof i&&i()}catch(e){u(e.message||(0,p.Tl)("Request failed"))}finally{o(!1)}},g=m?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(c.aF,{isOpen:e,title:(0,p.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,p.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.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:ee,value:n,onChange:e=>a(e.target.value),disabled:r}),d&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),m&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,p.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,p.Tl)("failed")}`:""]}),g.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{onClick:f,fullWidth:!0,disabled:r||!n.trim(),children:r?(0,p.Tl)("Importing..."):(0,p.Tl)("Import All")}),(0,s.jsx)(c.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,p.Tl)("Close")})]})]})})}function ei({isOpen:e,onClose:t,onSuccess:i,password:n=""}){let[a,r]=(0,l.useState)(""),[o,d]=(0,l.useState)(""),[u,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(null),y=(0,l.useRef)(null),b=()=>{u||(r(""),d(""),h(""),g(null),y.current&&(y.current.value=""),t())},v=async()=>{let e;h(""),g(null);let t=a.trim();if(!t)return;try{e=JSON.parse(t)}catch(e){h(`${(0,p.Tl)("Invalid JSON")}: ${e.message}`);return}let s=Array.isArray(e)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!s||0===s.length)return void h((0,p.Tl)("No accounts found in input"));m(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/bulk-import",{method:"POST",headers:{"Content-Type":"application/json",...n?{"x-10r-password":n}:{}},body:JSON.stringify({accounts:s})}),t=await e.json();if(!e.ok)return void h(401===e.status?(0,p.Tl)("Invalid password"):t?.error||`Request failed: ${e.status}`);g(t),(t.imported>0||t.updated>0)&&"function"==typeof i&&i()}catch(e){h(e.message||(0,p.Tl)("Request failed"))}finally{m(!1)}},j=f?.results?.filter(e=>!e.ok)||[],w=f?.skipped??0;return(0,s.jsx)(c.aF,{isOpen:e,title:(0,p.Tl)("Import CodeBuddy CN Accounts"),onClose:b,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(c.$n,{variant:"secondary",fullWidth:!0,icon:"upload_file",onClick:()=>y.current?.click(),disabled:u,children:o||(0,p.Tl)("Choose JSON file...")}),(0,s.jsx)("input",{ref:y,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(!t)return;d(t.name),h(""),g(null);let i=new FileReader;i.onload=()=>r(String(i.result||"")),i.onerror=()=>h((0,p.Tl)("Failed to read file")),i.readAsText(t)}})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute -top-2 left-2 bg-sidebar px-1 text-[10px] text-text-muted",children:(0,p.Tl)("Or paste JSON")}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 pt-4 text-sm font-mono resize-y min-h-[160px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:'[{ "access_token": "eyJ...", "refresh_token": "eyJ...", "nickname": "<nickname>" }]',value:a,onChange:e=>r(e.target.value),disabled:u})]}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),f&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${f.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",f.imported," ",(0,p.Tl)("added"),", ",f.updated," ",(0,p.Tl)("updated"),w>0?`, ${w} ${(0,p.Tl)("skipped")}`:"",f.failed>0?`, ✗ ${f.failed} ${(0,p.Tl)("failed")}`:""]}),j.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:j.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:u||!a.trim(),children:u?(0,p.Tl)("Importing..."):(0,p.Tl)("Import All")}),(0,s.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:u,children:(0,p.Tl)("Close")})]})]})})}function es({isOpen:e,mode:t,provider:i,providerName:n,dashboardPassword:a,onClose:r,onSuccess:o}){let[d,u]=(0,l.useState)(""),[m,x]=(0,l.useState)(""),[h,f]=(0,l.useState)(!1),[g,y]=(0,l.useState)(""),[b,v]=(0,l.useState)(null),[j,w]=(0,l.useState)(""),[k,N]=(0,l.useState)(null),T=(0,l.useRef)(null),C=(0,l.useRef)(null),S=e=>{clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,$(),r()},e)};(0,l.useEffect)(()=>()=>clearTimeout(C.current),[]);let $=()=>{u(""),x(""),f(!1),y(""),v(null),w(""),N(null),T.current&&(T.current.value="")},A={"Content-Type":"application/json","x-10r-password":a||""},O=async()=>{if(y(""),v(null),clearTimeout(C.current),d.length<4)return void y((0,p.Tl)("Passphrase must be at least 4 characters"));if(d!==m)return void y((0,p.Tl)("Passphrases do not match"));f(!0);try{let e=await fetch("/api/oauth/transfer/export",{method:"POST",headers:A,body:JSON.stringify({provider:i,passphrase:d})}),t=await e.json();if(!e.ok)throw Error((0,p.Tl)(t?.error)||`Request failed: ${e.status}`);let s=JSON.stringify(t.blob,null,2),l=URL.createObjectURL(new Blob([s],{type:"application/json"})),n=document.createElement("a");n.href=l,n.download=`oauth-${i}-transfer-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(l),1e3),v({exported:t.count}),S(1200)}catch(e){y(e.message||(0,p.Tl)("Export failed"))}finally{f(!1)}},E=async()=>{if(y(""),v(null),clearTimeout(C.current),!k)return void y((0,p.Tl)("Pick a transfer file first"));if(!d)return void y((0,p.Tl)("Transfer passphrase required"));f(!0);try{let e=await fetch("/api/oauth/transfer/import",{method:"POST",headers:A,body:JSON.stringify({provider:i,passphrase:d,blob:k})}),t=await e.json();if(!e.ok){if(401===e.status&&/passphrase/i.test(t?.error||""))throw Error((0,p.Tl)("Wrong passphrase"));throw Error((0,p.Tl)(t?.error)||`Request failed: ${e.status}`)}v(t),"function"==typeof o&&o(),!((t?.webSessions?.failed||0)>0)&&(t?.imported||0)+(t?.updated||0)>0&&S(1800)}catch(e){y(e.message||(0,p.Tl)("Import failed"))}finally{f(!1)}};return(0,s.jsx)(c.aF,{isOpen:e,title:"export"===t?(0,p.Tl)("Export OAuth accounts"):(0,p.Tl)("Import OAuth accounts"),onClose:()=>{h||(clearTimeout(C.current),C.current=null,$(),r())},children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,p.Tl)("Provider"),": ",(0,s.jsx)("span",{className:"font-medium text-text-main",children:n||i})]}),"export"===t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.pd,{type:"password",reveal:!0,label:(0,p.Tl)("Transfer passphrase"),value:d,onChange:e=>u(e.target.value),placeholder:"••••••••"}),(0,s.jsx)(c.pd,{type:"password",reveal:!0,label:(0,p.Tl)("Confirm passphrase"),value:m,onChange:e=>x(e.target.value),placeholder:"••••••••"})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,p.Tl)("The file is encrypted with this passphrase — it is required again at import, and cannot be recovered.")}),g&&(0,s.jsx)("p",{className:"text-xs text-red-500",children:g}),b&&(0,s.jsxs)("p",{className:"text-xs text-green-600",children:[(0,p.Tl)("Export complete")," — ",b.exported," ",(0,p.Tl)("accounts exported")]}),(0,s.jsx)(c.$n,{onClick:O,disabled:h,fullWidth:!0,children:(0,p.Tl)("Export encrypted file")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.pd,{label:(0,p.Tl)("Transfer file"),value:j,readOnly:!0,placeholder:(0,p.Tl)("Pick a transfer file first"),className:"cursor-pointer",onClick:()=>T.current?.click()}),(0,s.jsx)("input",{ref:T,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(!t)return;w(t.name),y(""),v(null);let i=new FileReader;i.onload=()=>{try{let e=JSON.parse(String(i.result||""));if(e?.format!=="10router-oauth-secure-v1"){y((0,p.Tl)("Unrecognized transfer file (expected an encrypted OAuth transfer)")),N(null);return}N(e)}catch(e){y(`${(0,p.Tl)("Invalid JSON")}: ${e.message}`),N(null)}},i.onerror=()=>y((0,p.Tl)("Failed to read file")),i.readAsText(t)}}),(0,s.jsx)(c.pd,{type:"password",reveal:!0,label:(0,p.Tl)("Transfer passphrase"),value:d,onChange:e=>u(e.target.value),placeholder:"••••••••"}),g&&(0,s.jsx)("p",{className:"text-xs text-red-500",children:g}),b&&(0,s.jsxs)("div",{className:"text-xs text-text-muted",children:[(0,s.jsxs)("p",{children:[(0,p.Tl)("Import complete"),": ",b.imported||0," ",(0,p.Tl)("imported"),", ",b.updated||0," ",(0,p.Tl)("updated"),(b.failed||0)>0?`, ${b.failed} ${(0,p.Tl)("failed")}`:""]}),b.webSessions?.failed>0&&(0,s.jsxs)("p",{className:"mt-1 text-amber-600 dark:text-amber-400",children:[(0,p.Tl)("Web session check failed for"),": ",b.webSessions.failures.map(e=>e.name).join(", ")]}),b.webSessions?.checked>0&&0===b.webSessions.failed&&(0,s.jsxs)("p",{className:"mt-1 text-green-600",children:[(0,p.Tl)("Web sessions verified"),": ",b.webSessions.ok,"/",b.webSessions.checked]})]}),(0,s.jsx)(c.$n,{onClick:E,disabled:h,fullWidth:!0,children:(0,p.Tl)("Import connections")})]})]})})}et.propTypes={isOpen:z().bool.isRequired,onClose:z().func.isRequired,onSuccess:z().func},ei.propTypes={isOpen:z().bool.isRequired,onClose:z().func.isRequired,onSuccess:z().func,password:z().string},es.propTypes={isOpen:z().bool.isRequired,mode:z().oneOf(["export","import"]).isRequired,provider:z().string.isRequired,providerName:z().string,dashboardPassword:z().string,onClose:z().func.isRequired,onSuccess:z().func};var el=i(97132),en=i(93195);let ea={claude:"claudeAutoPing",codex:"codexAutoPing"};function er(){let e,t,i,a,x,h,f,y,b=(0,n.useParams)(),v=(0,n.useRouter)(),j=b.id,{getCaps:w,getBaseCaps:k,overrides:N,refresh:T}=(0,A.yU)(),C=(0,O.i)(),[E,q]=(0,l.useState)([]),[z,F]=(0,l.useState)(!0),[_,U]=(0,l.useState)(null),[L,J]=(0,l.useState)([]),[B,H]=(0,l.useState)(!1),[V,G]=(0,l.useState)(!1),[ee,er]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ec,eu]=(0,l.useState)(""),[em,ep]=(0,l.useState)(!1),[ex,eh]=(0,l.useState)(!1),[ef,eg]=(0,l.useState)(!1),[ey,eb]=(0,l.useState)(!1),[ev,ej]=(0,l.useState)(!1),[ew,ek]=(0,l.useState)(null),[eN,eT]=(0,l.useState)({}),[eC,eS]=(0,l.useState)([]),[e$,eA]=(0,l.useState)(!1),[eO,eE]=(0,l.useState)(!1),[eP,eD]=(0,l.useState)(!1),[eI,eR]=(0,l.useState)(!1),[eM,eq]=(0,l.useState)(!1),[ez,eF]=(0,l.useState)(!1),[e_,eU]=(0,l.useState)({open:!1,action:null,value:""}),[eL,eK]=(0,l.useState)(!1),[eJ,eW]=(0,l.useState)(""),[eB,eH]=(0,l.useState)(""),[eV,eQ]=(0,l.useState)(!1),[eG,eZ]=(0,l.useState)({}),[eY,eX]=(0,l.useState)(""),[e0,e1]=(0,l.useState)(()=>new Set),[e2,e5]=(0,l.useState)(!1),[e4,e3]=(0,l.useState)([]),[e6,e8]=(0,l.useState)("__none__"),[e7,e9]=(0,l.useState)(!1),[te,tt]=(0,l.useState)(null),[ti,ts]=(0,l.useState)(""),[tl,tn]=(0,l.useState)(!1),[ta,tr]=(0,l.useState)("auto"),[to,td]=(0,l.useState)({enabled:!1,connections:{}}),[tc,tu]=(0,l.useState)([]),[tm,tp]=(0,l.useState)(!1),[tx,th]=(0,l.useState)([]),[tf,tg]=(0,l.useState)([]),[ty,tb]=(0,l.useState)([]),[tv,tj]=(0,l.useState)(null),[tw,tk]=(0,l.useState)(!1),[tN,tT]=(0,l.useState)(!1),[tC,tS]=(0,l.useState)(!1),t$="__provider_default__",[tA,tO]=(0,l.useState)(t$),[tE,tP]=(0,l.useState)(null),[tD,tI]=(0,l.useState)({}),[tR,tM]=(0,l.useState)(null),tq=(0,l.useRef)(!1),[tz,tF]=(0,l.useState)(!1),{copied:t_,copy:tU}=(0,$.C)(),tL="ag_risk_confirmed",tK=()=>{"xiaomi-mimo"===j||"mimo-desktop"===j?G(!0):H(!0)},tJ=()=>{"antigravity"===j&&"true"!==window.localStorage.getItem(tL)?tk(!0):t9?tK():(eu(""),ed(!0))},tW=()=>{eu(""),ed(!0)},tB=()=>{t9?tJ():tW()},tH=async()=>{if(!eL){eK(!0),eW("");try{let e=await fetch("/api/auth/verify-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e_.value})});if(!e.ok){let t=await e.json().catch(()=>({}));eW(t?.error||(0,p.Tl)("Invalid password"));return}let{action:t,value:i}=e_;eU({open:!1,action:null,value:""}),"export"===t&&(tX(i),tZ(t),tQ(!0))}catch(e){eW(e.message||(0,p.Tl)("Invalid password"))}finally{eK(!1)}}},[tV,tQ]=(0,l.useState)(!1),[tG,tZ]=(0,l.useState)("export"),[tY,tX]=(0,l.useState)(""),[t0,t1]=(0,l.useState)(null),t2=async()=>{eR(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/checkin",{method:"POST",cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t?.error||`Request failed: ${e.status}`);let i=Array.isArray(t?.results)?t.results:[];if(0===i.length)return void C.warning((0,p.Tl)("No CodeBuddy CN connections to check in"));let s=i.filter(e=>"checked-in"===e.status).length,l=i.filter(e=>"already"===e.status).length,n=i.filter(e=>"failed"===e.status).length;0===n?C.success(`${(0,p.Tl)("Check-in complete")}: ${s} ${(0,p.Tl)("checked-in")}, ${l} ${(0,p.Tl)("already checked in")}`):C.error(`${(0,p.Tl)("Check-in complete with errors")}: ${n} ${(0,p.Tl)("failed")}`)}catch(e){C.error((0,p.Tl)("Check-in failed")+": "+e.message)}finally{eR(!1)}},t5=async()=>{eq(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/claim-compensation",{method:"POST",cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t?.error||`Request failed: ${e.status}`);let i=Array.isArray(t?.results)?t.results:[];if(0===i.length)return void C.warning((0,p.Tl)("No CodeBuddy CN connections found"));let s=i.filter(e=>"claimed"===e.status),l=i.filter(e=>"already"===e.status);i.filter(e=>"no-activity"===e.status);let n=i.filter(e=>"failed"===e.status),a=s.reduce((e,t)=>e+(t.claimedAmount||0),0);s.length>0?C.success(`${(0,p.Tl)("Claim successful")}: +${a} Credits (${s.length} ${(0,p.Tl)("accounts")})`):n.length>0?C.error(`${(0,p.Tl)("Claim failed")}: ${n.map(e=>e.error).join(", ")}`):l.length>0?C.info((0,p.Tl)("Compensation credits already claimed")):C.info((0,p.Tl)("No claimable activity available for this account"))}catch(e){C.error((0,p.Tl)("Claim failed")+": "+e.message)}finally{eq(!1)}},t4=()=>(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(c.$n,{size:"sm",icon:"calendar_today",onClick:t2,disabled:eI,className:"w-full sm:w-auto",title:(0,p.Tl)("CodeBuddy CN auto-checks in daily (retries all day until confirmed)"),children:eI?(0,p.Tl)("Checking in..."):(0,p.Tl)("Check in now")}),(0,s.jsx)(c.$n,{size:"sm",icon:"redeem",variant:"secondary",onClick:t5,disabled:eM,className:"w-full sm:w-auto",title:(0,p.Tl)("Claim extra compensation & gifts"),children:eM?(0,p.Tl)("Claiming..."):(0,p.Tl)("Claim Compensation")})]}),t3=async()=>{eF(!0);try{let e="qoder-cn"===j?"/api/oauth/qoder-cn/checkin":"qoder"===j?"/api/oauth/qoder/checkin":`/api/oauth/${j}/checkin`,t=await fetch(e,{method:"POST",cache:"no-store"}),i=await t.json();if(!t.ok)throw Error(i?.error||`Request failed: ${t.status}`);let s=Array.isArray(i?.results)?i.results:[];if(0===s.length)return void C.warning((0,p.Tl)("No active Qoder connections found"));let l=s.filter(e=>"checked-in"===e.status),n=s.filter(e=>"already"===e.status),a=s.filter(e=>"no-activity"===e.status),r=s.filter(e=>"failed"===e.status),o=l.reduce((e,t)=>e+(t.claimedAmount||0),0);if(l.length>0)C.success(`${(0,p.Tl)("Claim successful")}: +${o} Credits (${l.length} ${(0,p.Tl)("accounts")})`);else if(r.length>0)C.error(`${(0,p.Tl)("Claim failed")}: ${r.map(e=>e.error).join(", ")}`);else if(a.length>0){let e=n.length>0?` / ${(0,p.Tl)("Daily credits already claimed for today")} (${n.length} ${(0,p.Tl)("accounts")})`:` (${a.length} ${(0,p.Tl)("accounts")})`;C.info((0,p.Tl)("No claimable activity available for this account")+e)}else C.info((0,p.Tl)("Daily credits already claimed for today"))}catch(e){C.error((0,p.Tl)("Claim failed")+": "+e.message)}finally{eF(!1)}},t6=()=>(0,s.jsx)(c.$n,{size:"sm",icon:"redeem",variant:"secondary",onClick:t3,disabled:ez,className:"w-full sm:w-auto",title:(0,p.Tl)("Claim daily activity Credits"),children:ez?(0,p.Tl)("Claiming..."):(0,p.Tl)("Claim Credits")}),t8=_?{id:_.id,name:_.name||("anthropic-compatible"===_.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===_.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===_.type?"AC":"OC",apiType:_.apiType,baseUrl:_.baseUrl,type:_.type}:u.zN[j]||u.fg[j]||u.IS[j]||u.nJ[j]||u.br[j],t7=t8?.authModes||[],t9=!!u.zN[j]||!!u.IS[j]||t7.includes("oauth"),ie=!!u.fg[j]||t7.includes("apikey"),it=!!u.IS[j]?.noAuth,ii="codebuddy-cn"===j,is=t9&&t8?.authModes?.includes("oauth")&&e$,il=ii&&(eO||eP),ia=["qoder","qoder-cn","minimax-code","minimax-code-global"].includes(j),ir=e=>is&&!il?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>{eH(""),eU({open:!0,action:"export",value:""})},className:e,children:(0,p.Tl)("Export")}),(0,s.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>{tZ("import"),tQ(!0)},className:e,children:(0,p.Tl)("Import")})]}):null,io=(0,m.KC)(j),id="qoder"===j||"qoder-cn"===j,ic="qoder"===j||"qoder-cn"===j||"xiaomi-mimo"===j,iu="cursor"===j&&tx.length>0?tx:id?function(e,t){if(!Array.isArray(e)||!Array.isArray(t)||0===t.length)return e;let i=new Map(t.map(e=>[String(e.id).split("/").pop(),e]));return e.map(e=>{let t=i.get(e.id);if(!t)return e;let s="string"==typeof e.promoFreeUntil&&""!==e.promoFreeUntil.trim(),l="number"==typeof t.rateMultiplier?t.rateMultiplier:null;return{...e,rateMultiplier:s?"number"==typeof e.rateMultiplier?e.rateMultiplier:l:l??e.rateMultiplier,promoFreeUntil:e.promoFreeUntil,promotion:t.promotion??e.promotion??null}})}(io,tx):io,im=id&&iu.find(e=>e.promotion)?.promotion||null,ip=(0,u.wG)(j),ix=(0,u.mq)(j),ih=(0,u.gb)(j),ig=ix||ih,iy=!ig&&t9&&ie,ib="xai"===j?"Grok Build OAuth":"grok-cli"===j?"Grok CLI Device Login":"kimi"===j?"Kimi Coding OAuth":"OAuth",iv="xai"===j?"xAI API Key":"kimi"===j?"Kimi API Key":"qoder"===j?"PAT":"API Key",ij=e=>{if(!ta||"auto"===ta)return null;let t=S(j,e);return t&&t.includes(ta)?ta:null},iw=ig?j:ip,ik=(()=>{let e=new Set,t=new Set,i=i=>{if(!i||t.has(i))return;t.add(i);let s=S(j,i);s&&s.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of iu)i(e.id);for(let e of tf)i(e.id);for(let e of eC)e.providerAlias===iw&&"llm"===(e.kind||e.type||"llm")&&i(e.id);return e.size?["auto",...e]:null})(),iN=ig?_?.prefix||j:ip,iT=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(iw)}`,{cache:"no-store"}),t=await e.json();e.ok&&tb(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[iw]),iC=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:iw,ids:[e]})})).ok&&await iT()}catch(e){console.log("Error disabling model:",e)}},iS=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(iw)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await iT()}catch(e){console.log("Error enabling model:",e)}},i$=async(e,t)=>{await fetch("/api/models/custom",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:iw,id:e,type:"llm",enabled:t})})},iA=async(e,t=[])=>{let i=e.length+t.length;i&&tj({title:"Disable All Models",message:`Disable all ${i} model(s)?`,onConfirm:async()=>{tj(null);try{for(let i of(e.length&&(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:iw,ids:e})})).ok&&await iT(),t))await i$(i,!1);t.length&&await iP()}catch(e){console.log("Error disabling all models:",e)}}})},iO=async(e=[])=>{try{for(let t of((await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(iw)}`,{method:"DELETE"})).ok&&await iT(),e))await i$(t,!0);e.length&&await iP()}catch(e){console.log("Error enabling all models:",e)}},iE=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&eT(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),iP=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eS(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===j&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&tg(e.models)}).catch(()=>{})},[j]);let iD=(0,l.useCallback)(async()=>{try{let[e,t,i,s]=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"})]),l=await e.json(),n=await t.json(),a=await i.json(),r=s.ok?await s.json():{};if(e.ok){let e=(l.connections||[]).filter(e=>e.provider===j);q(e)}i.ok&&J(a.proxyPools||[]);let o=(r.providerStrategies||{})[j]||{};tt(o.fallbackStrategy||null),ts(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1"),tn(!0===o.earliestExpiryFirst),eA(!0===r.codeBuddyOAuthImport);let d=(r.providerThinking||{})[j]||{};tr(d.mode||"auto");let c=ea[j],u=c&&r[c]||{};if(td({enabled:!0===u.enabled,connections:u.connections||{},schedules:u.schedules||{}}),t.ok){let e=(n.nodes||[]).find(e=>e.id===j)||null;if(!e&&ig)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===j)||null))break}U(e)}}catch(e){console.log("Error fetching connections:",e)}finally{F(!1)}},[j,ig]),iI=(0,l.useCallback)(async()=>{await iD(),await iT()},[iD,iT]),iR=async e=>{try{let t=await fetch(`/api/provider-nodes/${j}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await t.json();t.ok&&(U(i.node),await iD(),eb(!1))}catch(e){console.log("Error updating provider node:",e)}},iM=async(e,t,i=tl)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),l=(s.ok?await s.json():{}).providerStrategies||{},n={...l[j]||{}};e?n.fallbackStrategy=e:delete n.fallbackStrategy,"round-robin"===e&&""!==t?n.stickyRoundRobinLimit=Number(t)||3:delete n.stickyRoundRobinLimit,i?n.earliestExpiryFirst=!0:delete n.earliestExpiryFirst;let a={...l};0===Object.keys(n).length?delete a[j]:a[j]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:a})})}catch(e){console.log("Error saving provider strategy:",e)}},iq=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),i={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?i[j]={mode:e}:delete i[j],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:i})})}catch(e){console.log("Error saving thinking config:",e)}},iz=async e=>{let t=ea[j];if(t){td(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,l.useEffect)(()=>{iD(),iE(),iP(),iT()},[iD,iE,iP,iT]),(0,l.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(e=>{eA(!0===e.codeBuddyOAuthImport),"boolean"==typeof e.codeBuddyCheckin&&eE(e.codeBuddyCheckin),"boolean"==typeof e.codeBuddyCompensation&&eD(e.codeBuddyCompensation)}).catch(e=>console.log("Error reading settings:",e))},[]),(0,l.useEffect)(()=>{if("cursor"!==j&&!id)return void th([]);let e=E.find(e=>!1!==e.isActive);if(!e?.id)return void th([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:i})=>{!t&&e&&Array.isArray(i.models)&&i.models.length>0&&th(i.models)}).catch(()=>{}),()=>{t=!0}},[j,E]),(0,l.useEffect)(()=>{let e=(u.zN[j]||u.fg[j]||u.IS[j]||u.nJ[j])?.modelsFetcher;e&&P(e).then(tu)},[j]);let iF=async(e,t,i=ip)=>{let s=`${i}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await iE();else{let t=await e.json();C.error(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},i_=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await iE()}catch(e){console.log("Error deleting alias:",e)}},iU=async(e,t="llm",i=iw,s={},l,n)=>{try{let a={providerAlias:i,id:e,type:t};if(void 0!==l&&(a.enabled=l),n&&(a.transport=n),s&&"object"==typeof s)for(let e of["vision","reasoning","contextWindow","maxOutput","thinkingFormat"])void 0!==s[e]&&(a[e]=s[e]);let r=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(r.ok)await iP(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await r.json();C.error(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},iL=e=>!!(N?.[iw]?.[e]||N?.[j]?.[e]),iK=async(e,t)=>{try{let i=await fetch("/api/models/caps",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:iw||j,modelId:e,...t||{}})});if(!i.ok){let e=await i.json().catch(()=>({}));C.error(e?.error||"Failed to save model settings");return}T()}catch(e){console.log("Error saving model caps:",e),C.error("Failed to save model settings")}},iJ=async(e,t="llm",i=iw)=>{try{let s=new URLSearchParams({providerAlias:i,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await iP(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},iW=async(e,t,i="llm")=>{try{(await fetch("/api/models/custom",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:iw,id:e,type:i,enabled:t})})).ok&&(await iP(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error toggling custom model:",e)}},iB=(e,t="llm")=>{tj({title:e?(0,p.Tl)("Enable all custom models?"):(0,p.Tl)("Disable all custom models?"),message:e?(0,p.Tl)("All custom models of this provider will be listed in /v1/models and exposed to clients."):(0,p.Tl)("All custom models of this provider will disappear from /v1/models until re-enabled. Clients will no longer see them."),onConfirm:async()=>{tj(null);try{(await fetch("/api/models/custom/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:iw,type:t,enabled:e})})).ok&&(await iP(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error bulk-updating custom models:",e)}}})},iH=async()=>{if(tz)return;let e=E.find(e=>!1!==e.isActive);if(!e)return void C.warning("xiaomi-mimo"===j?(0,p.Tl)("Please add an active MiMo connection first"):(0,p.Tl)("Please add an active Qoder connection first"));tF(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),i=await t.json();if(!t.ok)return void C.error(i.error||(0,p.Tl)("Failed to fetch models"));let s=i.models||[];if(0===s.length)return void C.warning((0,p.Tl)("No models returned"));let l=0,n=0;for(let e of s){let t=e.id||e.name;if(!t)continue;if("llm"!==(e.kind||"llm")){n+=1;continue}let i=t.replace(/^qoder(-cn)?\//,"");!s.some(e=>e.id===i)&&(eC.some(e=>e.providerAlias===iw&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(eN).includes(`${iw}/${i}`)||(await iU(i,"llm",iw,{},!1),l+=1))}0===l?C.warning((0,p.Tl)("All models already exist, no new models added")):C.success((0,p.Tl)("Successfully added")+` ${l} `+(0,p.Tl)("models")),n>0&&C.info((0,p.Tl)("Media models skipped (use Media Providers)")+` (${n})`)}catch(e){console.log("Error importing Qoder models:",e),C.error((0,p.Tl)("Error fetching models")+": "+e.message)}finally{tF(!1)}},iV="opencode-go"===j||"bai"===j||"cline"===j,iQ=async()=>{if(tm)return;let e=E.find(e=>!1!==e.isActive);if(!e?.id)return void C.warning((0,p.Tl)("Add a connection to enable importing models."));tp(!0);try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),i=await t.json();if(!t.ok)throw Error(i?.error||`Request failed: ${t.status}`);let s=(Array.isArray(i.models)?i.models:[]).map(e=>{let t=e?.id||e?.name||e?.model;return t?{...e,id:String(t),name:e.name||String(t)}:null}).filter(Boolean);tu(s),C.success(`${(0,p.Tl)("Models refreshed")} (${s.length})`)}catch(e){C.error((0,p.Tl)("Failed to fetch models")+": "+e.message)}finally{tp(!1)}},iG=async()=>{if(tN||0===E.length)return;let e=Object.fromEntries(E.map(e=>[e.id,{state:"queued",error:null}]));tq.current=!1,tT(!0),tS(!1),tP(null),tI(e),tM({total:E.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,i=0;try{for(let e=0;e<E.length;e+=1){if(tq.current){tM({total:E.length,completed:e,passed:t,failed:i,stopped:!0});break}let s=E[e];tP(s.id),tI(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=iu.some(e=>e.id===tA)?tA:null,l=await fetch(`/api/providers/${s.id}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e&&e!==t$?{model:e}:{})}),n=await l.json(),a=!!n.valid;a?t+=1:i+=1,tI(e=>({...e,[s.id]:{state:a?"success":"failed",error:a?null:n.error||null}}))}catch(e){i+=1,tI(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}tM({total:E.length,completed:e+1,passed:t,failed:i,stopped:!1}),e<E.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tP(null),tT(!1),tS(!1),tq.current=!1,iD()}},iZ=async e=>{tj({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{tj(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&q(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},iY=()=>{eX(""),eZ({}),tI({}),tM(null),iD(),H(!1)},iX=async e=>{eu("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:j,...e})}),i=null;try{i=await t.json()}catch{i=null}if(t.ok){eX(""),eZ({}),await iI(),ed(!1);return}eu(i?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),eu("Failed to save connection")}},i0=async e=>{try{(await fetch(`/api/providers/${ew.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(eX(""),eZ({}),tI({}),tM(null),await iD(),eg(!1))}catch(e){console.log("Error updating connection:",e)}},i1=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&q(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},i2=async(e,t)=>{let i=[...E];[i[e],i[t]]=[i[t],i[e]],q(i);try{await Promise.all([fetch(`/api/providers/${i[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${i[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await iD()}},i5=E.filter(e=>e4.includes(e.id)),i4=E.length>0&&e4.length===E.length;(0,l.useEffect)(()=>{e3(e=>e.filter(e=>E.some(t=>t.id===e)))},[E]),(()=>{if(0===i5.length)return;let e=new Set(i5.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let i=L.find(e=>e.id===t);return i?.name}})();let i3=()=>{e7||ej(!1)},i6=async e=>{e9(!0);try{let t=0;for(let{connectionId:i,proxyPoolId:s}of e)try{(await fetch(`/api/providers/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:s})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",i,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await iD(),ej(!1)}finally{e9(!1)}},i8=e=>i6(E.map(t=>({connectionId:t.id,proxyPoolId:e}))),i7=(0,s.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:E.map((e,t)=>{let i;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(i=e.id,e4.includes(i)),onChange:()=>{var t;return t=e.id,void e3(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,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(Q,{connection:e,proxyPools:L,isOAuth:t9,isFirst:0===t,isLast:t===E.length-1,onMoveUp:()=>i2(t,t-1),onMoveDown:()=>i2(t,t+1),onToggleActive:t=>i1(e.id,t),autoPing:ea[j]&&"oauth"===e.authType?{isActive:!0===to.connections[e.id]||to.schedules?.[e.id]?.enabled===!0,reactiveOn:!0===to.connections[e.id],provider:j,scheduleOn:to.schedules?.[e.id]?.enabled===!0,scheduleSummary:(0,en.JW)(to.schedules?.[e.id]).join(" / "),onConfigure:()=>t1(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&&q(i=>i.map(i=>i.id===e.id?{...i,providerSpecificData:{...i.providerSpecificData,proxyPoolId:t||null}}:i))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ek(e),eg(!0)},onDelete:()=>iZ(e.id),oneByOneStatus:tD[e.id]||null})})]},e.id)})}),i9=L.filter(e=>!0===e.isActive),se=(0,s.jsx)(c.aF,{isOpen:ev,onClose:i3,title:`Apply Proxy (${E.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{onClick:()=>{let e=L.filter(e=>!0===e.isActive);return 0===e.length?void C.warning("No active proxy pools available."):i6(E.map((t,i)=>({connectionId:t.id,proxyPoolId:e[i%e.length].id})))},disabled:e7||0===i9.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,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,s.jsxs)("button",{onClick:()=>i8(null),disabled:e7,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,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),L.map(e=>(0,s.jsxs)("button",{onClick:()=>i8(e.id),disabled:e7||!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,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,s.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),e7&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(c.$n,{onClick:i3,variant:"ghost",fullWidth:!0,disabled:e7,children:"Cancel"})]})}),st=async e=>{if(!e0.has(e)){e1(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:`${iw}/${e}`})}),i=await t.json();eZ(t=>({...t,[e]:i.ok?"ok":"error"})),eX(i.ok?"":i.error||"Model not reachable")}catch{eZ(t=>({...t,[e]:"error"})),eX("Network error")}finally{setTimeout(()=>{iD()},600),e1(t=>{let i=new Set(t);return i.delete(e),i})}}};if(z)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(c.Qv,{}),(0,s.jsx)(c.Qv,{})]});if(!t8)return(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let si=()=>ix&&t8.apiType?"responses"===t8.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":ih?"/providers/anthropic-m.png":(0,d.HY)(t8.id);return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${t8.color}15`},children:eV||!si()?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:t8.color},children:t8.textIcon||t8.id.slice(0,2).toUpperCase()}):(0,s.jsx)(o.default,{src:si(),alt:t8.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(t8.id),eQ(!0)},loading:"lazy",decoding:"async"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:t8.name}),(t8.notice?.webUrl||t8.notice?.apiKeyUrl||t8.notice?.signupUrl||t8.website)&&(0,s.jsxs)("a",{href:t8.notice?.webUrl||t8.notice?.apiKeyUrl||t8.notice?.signupUrl||t8.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),t8.notice?.webUrl?"Web console":t8.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,s.jsx)(c.N5,{code:t8.notice?.inviteCode})]}),!it&&(0,s.jsx)("p",{className:"text-text-muted",children:1===E.length?(0,p.Tl)("1 connection"):(0,p.Tl)("{n} connections").replace("{n}",String(E.length))})]})]})]}),t8.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:t8.deprecationNotice})]}),t8.notice?.text&&!t8.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:(0,p.Tl)(t8.notice.text)}),t8.notice.apiKeyUrl&&(0,s.jsx)("a",{href:t8.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:(0,p.Tl)("Get API Key →")})]}),ig&&_&&(0,s.jsx)(c.Zp,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:ih?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[ih?"Messages API":"responses"===_.apiType?"Responses API":"Chat Completions"," \xb7 ",(_.baseUrl||"").replace(/\/$/,""),"/",ih?"messages":"responses"===_.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{eu(""),ed(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>eb(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{tj({title:"Delete Compatible Node",message:`Delete this ${ih?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{tj(null);try{(await fetch(`/api/provider-nodes/${j}`,{method:"DELETE"})).ok&&v.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),it?(0,s.jsx)(c.gw,{providerId:j}):(0,s.jsxs)(c.Zp,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[E.length>0&&L.length>0&&(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ej(!0),children:"Apply Proxy"}),E.length>0&&(0,s.jsxs)(s.Fragment,{children:[e4.length>0&&(0,s.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=e4.length;0!==e&&tj({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{tj(null);let e=0,t=[...e4];for(let i of t)try{(await fetch(`/api/providers/${i}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}q(e=>e.filter(e=>!t.includes(e.id))),e3([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",e4.length,")"]}),E.length>0&&iu.length>1&&(0,s.jsx)(c.l6,{value:tA,onChange:e=>tO(e.target.value),disabled:tN,options:[{value:t$,label:(0,p.Tl)("Provider default")},...iu.filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>({value:e.id,label:e.name||e.id}))],selectClassName:"!py-2 !text-xs w-44"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:iG,disabled:tN,children:tN?(0,p.Tl)("Testing Connection One-by-One..."):(0,p.Tl)("Test Connection One-by-One")}),tN&&(0,s.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{tN&&(tq.current=!0,tS(!0))},disabled:tC,children:tC?(0,p.Tl)("Stopping..."):(0,p.Tl)("Stop")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",title:(0,p.Tl)("Prioritize accounts whose quota (packages, subscription windows, balances) expires soonest"),children:(0,p.Tl)("Earliest Expiry First")}),(0,s.jsx)(c.lM,{checked:tl,onChange:e=>{tn(e),iM(te,ti,e)}})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:(0,M.cn)("text-xs font-medium",tl?"text-text-muted/50 cursor-not-allowed":"text-text-muted"),title:tl?(0,p.Tl)("Disabled while Earliest Expiry First is active (earliest-expiry takes precedence over round-robin)"):void 0,children:(0,p.Tl)("Round Robin")}),(0,s.jsx)(c.lM,{checked:"round-robin"===te,disabled:tl,onChange:e=>{let t=e?"round-robin":null,i=e?ti||"1":ti;e&&!ti&&ts("1"),tt(t),iM(t,i,tl)}}),"round-robin"===te&&(0,s.jsxs)("div",{className:(0,M.cn)("flex items-center gap-1.5",tl&&"opacity-50 pointer-events-none"),children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:(0,p.Tl)("Sticky:")}),(0,s.jsx)("input",{type:"number",min:1,disabled:tl,value:ti,onChange:e=>{var t;ts(t=e.target.value),iM("round-robin",t,tl)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-surface focus:outline-none focus:border-primary"})]})]})]})]}),0===E.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:t9?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),iy&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ib," or ",iv,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:iy?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tJ,children:ib}),(0,s.jsx)(c.$n,{size:"sm",icon:"key",onClick:tW,children:iv}),ir(),il&&t4()]}):(0,s.jsxs)(s.Fragment,{children:[!ig&&"iflow"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>er(!0),children:"Cookie"}),ia&&t6(),"codex"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ep(!0),children:(0,p.Tl)("Bulk Add")}),(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:tB,children:ig?"Add API Key":"iflow"===j?"OAuth":"mimo-desktop"===j?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,p.Tl)("Connect with Desktop Session"),(0,s.jsx)(c.m_,{text:(0,p.Tl)("Requires sign-in to Xiaomi MiMo Desktop app first"),position:"top",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] opacity-60",children:"info"})})]}):"Add Connection"}),ir()]})})]}):(0,s.jsxs)(s.Fragment,{children:[tR&&(0,s.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,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:[(0,p.Tl)("Total:")," ",tR.total]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Completed:")," ",tR.completed]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Passed:")," ",tR.passed]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Failed:")," ",tR.failed]}),tR.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:(0,p.Tl)("Stopped")}),tN&&tE&&(0,s.jsxs)("span",{children:[(0,p.Tl)("Running:")," ",E.find(e=>e.id===tE)?.name||tE]})]})}),E.length>0&&(0,s.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,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:i4,onChange:()=>{i4?e3([]):e3(E.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),i7,!ig&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>er(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ep(!0),title:(0,p.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,p.Tl)("Bulk Add")}),iy?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tJ,className:"w-full sm:w-auto",children:ib}),(0,s.jsx)(c.$n,{size:"sm",icon:"key",onClick:tW,className:"w-full sm:w-auto",children:iv}),ir("w-full sm:w-auto"),il&&t4(),ia&&t6()]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:tB,className:"w-full sm:w-auto",children:"Add"}),ir("w-full sm:w-auto"),ia&&t6()]})]})]})]}),(0,s.jsxs)(c.Zp,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),ik&&(0,s.jsx)("select",{value:ta,onChange:e=>{var t;tr(t=e.target.value),iq(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-surface px-2 py-1 text-xs focus:border-primary focus:outline-none",children:ik.map(e=>(0,s.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!ig&&(e=[...iu,...tf.filter(e=>!iu.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!ty.includes(e)),i=(t=eC.filter(e=>e?.providerAlias===iw&&"llm"===(e.kind||e.type||"llm"))).filter(e=>!1!==e.enabled).map(e=>e.id),a=t.filter(e=>!1===e.enabled).map(e=>e.id),x=ty.length>0||a.length>0,h=e.length>0||i.length>0,(0,s.jsxs)("div",{className:"flex gap-2",children:[x&&(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:()=>iO(a),children:"Active All"}),h&&(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>iA(e,i),children:"Disable All"})]}))]}),!!eY&&(f=(0,I.O)(eY),y=function(e){if(!e)return"";let t=(0,R.DY)(e);if(t&&t!==e)return t;let i=(0,p.Tl)(e);if(i&&i!==e)return i;let s=String(e).match(/^HTTP\s+\d+:\s*(?:\[(?:\d+|[A-Z0-9_]+)\]:\s*)?(.*)$/i);if(s&&s[1]){let e=s[1].trim(),t=(0,p.Tl)(e);if(t&&t!==e)return t}return(0,p.Tl)(e)}(eY),(0,s.jsxs)("p",{className:"text-xs text-red-500 mb-3 break-words",children:[y," ",f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",title:(0,p.Tl)("Recommended: open in an incognito window and sign in with the affected account"),className:"text-blue-500 underline hover:text-blue-400",children:(0,p.Tl)("Verify your account")})," ",(0,s.jsx)("button",{type:"button",onClick:()=>tU(f,"verification"),className:"text-text-muted underline hover:text-primary",children:"verification"===t_?(0,p.Tl)("Copied"):(0,p.Tl)("Copy link")}),(0,s.jsxs)("span",{className:"text-text-muted",children:[" ","(",(0,p.Tl)("Recommended: open in an incognito window and sign in with the affected account"),")"]})]})]})),(()=>{let e,t,i;if(ig)return(0,s.jsx)(W,{providerStorageAlias:iw,providerDisplayAlias:iN,modelAliases:eN,customModels:eC,copied:t_,onCopy:tU,onSetAlias:iF,onDeleteAlias:i_,onAddCustomModel:(e,t)=>iU(e,"llm",iw,{},t),onToggleCustomModel:iW,onDeleteCustomModel:e=>iJ(e,"llm",iw),onBulkCustomModels:iB,connections:E,isAnthropic:ih});let l=[...iu,...tf.filter(e=>!iu.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),n=new Set(ty),a=l.filter(e=>!n.has(e.id)),r=l.filter(e=>n.has(e.id)),o=D({customModels:eC,modelAliases:eN,providerAlias:iw,builtInModels:iu,type:"llm"}),d=o.filter(e=>!1!==e.enabled),c=o.filter(e=>!1===e.enabled);return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[im&&(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(g,{promotion:im})}),d.length+c.length>0&&(0,s.jsxs)("div",{className:"w-full flex items-center gap-2 text-xs text-text-muted -mb-1",children:[(0,s.jsxs)("span",{children:[(0,p.Tl)("Custom models")," (",d.length+c.length,")"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>iB(!0),className:"text-primary hover:underline",children:(0,p.Tl)("Enable all")}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>iB(!1),className:"text-text-muted hover:text-red-500 hover:underline",children:(0,p.Tl)("Disable all")})]}),d.map(e=>(0,s.jsx)(K,{model:{id:e.id,name:e.name},fullModel:`${iN}/${e.id}`,alias:e.alias,copied:t_,onCopy:tU,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?iJ(e.id,"llm",iw):i_(e.alias)},testStatus:eG[e.id],onTest:E.length>0||it?()=>st(e.id):void 0,isTesting:e0.has(e.id),isCustom:!0,isFree:!1,caps:w(`${j}/${e.id}`),baseCaps:k(`${j}/${e.id}`),onSaveCaps:t=>iK(e.id,t),capsPinned:iL(e.id),thinkingSuffix:ij(e.id)},`${e.source}-${e.fullModel}`)),a.map(e=>{let t=`${iw}/${e.id}`,i=`${j}/${e.id}`,l=Object.entries(eN).find(([,e])=>e===t||e===i)?.[0];return(0,s.jsx)(K,{model:e,fullModel:`${iN}/${e.id}`,alias:l,copied:t_,onCopy:tU,onSetAlias:t=>iF(e.id,t,iw),onDeleteAlias:()=>i_(l),testStatus:eG[e.id],onTest:E.length>0||it?()=>st(e.id):void 0,isTesting:e0.has(e.id),isFree:e.isFree,onDisable:()=>iC(e.id),caps:w(`${j}/${e.id}`),baseCaps:k(`${j}/${e.id}`),onSaveCaps:t=>iK(e.id,t),capsPinned:iL(e.id),thinkingSuffix:ij(e.id)},e.id)}),(0,s.jsxs)("button",{onClick:()=>e5(!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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"cline"===j&&E.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:iQ,disabled:tm,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:tm?{animation:"spin 1s linear infinite"}:void 0,children:tm?"progress_activity":"download"}),tm?(0,p.Tl)("Importing..."):(0,p.Tl)("Import from /models")]}),ic&&E.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:iH,disabled:tz,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:tz?{animation:"spin 1s linear infinite"}:void 0,children:tz?"progress_activity":"download"}),tz?(0,p.Tl)("Fetching..."):(0,p.Tl)("xiaomi-mimo"===j?"Fetch MiMo Models":"Fetch Qoder Models")]}),iV&&"cline"!==j&&(0,s.jsxs)("button",{onClick:iQ,disabled:tm||!E.some(e=>!1!==e.isActive),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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:tm?{animation:"spin 1s linear infinite"}:void 0,children:tm?"progress_activity":"refresh"}),tm?(0,p.Tl)("Refreshing..."):(0,p.Tl)("Refresh Official Models")]}),tc.length>0&&(e=new Set([...Object.values(eN),...o.map(e=>e.fullModel)]),t=new Set(iu.map(e=>e.id)),0===(i=tc.filter(i=>!e.has(`${iw}/${i.id}`)&&!t.has(i.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await iU(e.id,"llm",iw)},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,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),(r.length>0||c.length>0)&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length+c.length,"):"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[c.map(e=>(0,s.jsx)(K,{model:{id:e.id,name:e.name},fullModel:`${iN}/${e.id}`,copied:t_,onCopy:tU,testStatus:eG[e.id],onTest:E.length>0||it?()=>st(e.id):void 0,isTesting:e0.has(e.id),onEnable:()=>iW(e.id,!0),isCustom:!1,isFree:!1,caps:w(`${j}/${e.id}`),baseCaps:k(`${j}/${e.id}`),onSaveCaps:t=>iK(e.id,t),capsPinned:iL(e.id)},`custom-${e.fullModel}`)),r.map(e=>(0,s.jsx)(K,{model:e,fullModel:`${iN}/${e.id}`,copied:t_,onCopy:tU,testStatus:eG[e.id],onTest:E.length>0||it?()=>st(e.id):void 0,isTesting:e0.has(e.id),onEnable:()=>iS(e.id),isFree:e.isFree,caps:w(`${j}/${e.id}`),baseCaps:k(`${j}/${e.id}`),onSaveCaps:t=>iK(e.id,t),capsPinned:iL(e.id),thinkingSuffix:ij(e.id)},e.id))]})]})]})})()]}),se,"kiro"===j?(0,s.jsx)(c.Mh,{isOpen:B,providerInfo:t8,onSuccess:iY,onClose:()=>H(!1)}):"cursor"===j?(0,s.jsx)(c.G9,{isOpen:B,onSuccess:iY,onClose:()=>H(!1)}):"zed"===j?(0,s.jsx)(c.TE,{isOpen:B,providerInfo:t8,onSuccess:iY,onClose:()=>H(!1)}):"gitlab"===j?(0,s.jsx)(c.vj,{isOpen:B,providerInfo:t8,onSuccess:iY,onClose:()=>H(!1)}):(0,s.jsx)(c.LF,{isOpen:B,provider:j,providerInfo:t8,onSuccess:iY,onClose:()=>H(!1)}),("xiaomi-mimo"===j||"mimo-desktop"===j)&&(0,s.jsx)(c.LH,{provider:j,isOpen:V,onSuccess:iY,onClose:()=>G(!1)}),"iflow"===j&&(0,s.jsx)(c.vE,{isOpen:ee,onSuccess:()=>{iD(),er(!1)},onClose:()=>er(!1)}),(0,s.jsx)(Z,{isOpen:eo,provider:j,providerName:t8.name,isCompatible:ig,isAnthropic:ih,authType:t8?.authType,authHint:t8?.authHint,website:t8?.website,proxyPools:L,error:ec,existingNames:E.map(e=>e.name).filter(Boolean),onSave:iX,onBulkDone:iI,onClose:()=>{eu(""),ed(!1)}}),(0,s.jsx)(c.wI,{isOpen:ef,connection:ew,proxyPools:L,onSave:i0,onClose:()=>eg(!1)}),ig&&(0,s.jsx)(Y,{isOpen:ey,node:_,onSave:iR,onClose:()=>eb(!1),isAnthropic:ih}),!ig&&(0,s.jsx)(X,{isOpen:e2,providerAlias:iw,providerDisplayAlias:iN,onSave:async(e,t,i,s)=>{await iU(e,i||"llm",iw,t||{},void 0,s),e5(!1)},onClose:()=>e5(!1)}),"codex"===j&&(0,s.jsx)(et,{isOpen:em,onClose:()=>ep(!1),onSuccess:iD}),"codebuddy-cn"===j&&(0,s.jsx)(ei,{isOpen:ex,password:eB,onClose:()=>eh(!1),onSuccess:iD}),(0,s.jsx)(es,{isOpen:tV,mode:tG,provider:j,providerName:t8?.name,dashboardPassword:tY,onClose:()=>{tQ(!1),tX("")},onSuccess:iD}),(0,s.jsxs)(c.aF,{isOpen:e_.open,onClose:()=>eU({open:!1,action:null,value:""}),title:(0,p.Tl)("Confirm Password"),size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{variant:"ghost",onClick:()=>eU({open:!1,action:null,value:""}),children:(0,p.Tl)("Cancel")}),(0,s.jsx)(c.$n,{variant:"primary",onClick:tH,disabled:!e_.value||eL,children:eL?(0,p.Tl)("Verifying..."):(0,p.Tl)("Confirm")})]}),children:[(0,s.jsx)("p",{className:"text-text-muted mb-3 text-sm",children:(0,p.Tl)("Enter your dashboard password to export OAuth accounts (the file will be encrypted with the transfer passphrase you pick next).")}),(0,s.jsx)(c.pd,{type:"password",reveal:!0,autoFocus:!0,value:e_.value,onChange:e=>eU(t=>({...t,value:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&e_.value&&tH()},placeholder:(0,p.Tl)("Password")}),eJ&&(0,s.jsx)("p",{className:"text-xs text-red-500 mt-2",children:eJ})]}),(0,s.jsx)(c.uo,{isOpen:tw,onClose:()=>tk(!1),onConfirm:()=>{(window.localStorage.setItem(tL,"true"),tk(!1),t9)?tK():tW()},title:"Risk Notice",message:t8?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(c.uo,{isOpen:!!tv,onClose:()=>tj(null),onConfirm:tv?.onConfirm,title:tv?.title||"Confirm",message:tv?.message,variant:"danger"}),t0&&(0,s.jsx)(el.A,{isOpen:!!t0,onClose:()=>t1(null),connection:t0,reactive:!0===to.connections[t0.id],schedule:to.schedules?.[t0.id]||null,onSave:e=>((e,{reactive:t,schedule:i})=>{iz({...to,connections:{...to.connections,[e]:t},schedules:{...to.schedules||{},[e]:i}})})(t0.id,e)})]})}},90337:(e,t,i)=>{"use strict";i.d(t,{DY:()=>o});var s=i(73006),l=i(22862),n=i(43073);let a=/subscription_quota_exhausted|本周用量已满|本周额度已用完/i;function r(e,t){return(0,s.Tl)(e).replace("{n}",String(t))}function o(e){if(!e||"string"!=typeof e)return e??"";let t=(0,s.Tl)(e);if(t&&t!==e)return t;if(a.test(e))return(0,s.Tl)("Subscription quota used up. Please wait for the quota reset.");if(l.AZ.test(e)){let t=(0,n.l)(e),i=(0,s.Tl)("This account must complete real-name verification before StepFun will serve it. Complete it at {url}, then retry.");return i.replace("{url}",t||(0,s.Tl)("the provider's console"))}if(/Individual quota reached|QUOTA_EXHAUSTED|RESOURCE_EXHAUSTED/i.test(e)){let t,i,l,n,a,o,d,c,{delay:u,timestamp:m,model:p}=(t=String(e||""),i=null,l=null,n=/"quotaResetDelay"\s*:\s*"([^"]+)"/.exec(t),a=/\bResets in\s+([0-9hms.]+)/i.exec(t),i=n&&n[1]||a&&a[1]||null,o=/"quotaResetTimeStamp"\s*:\s*"([^"]+)"/.exec(t),d=/"quotaResetTimeStamp"\s*:\s*(".*?"|\S+)/.exec(t),(l=o&&o[1]||d&&d[1]||null)&&(l=l.replace(/^"|"$/g,"")),{delay:i,timestamp:l,model:/"model"\s*:\s*"([^"]+)"/.exec(t)?.[1]||null}),x=function(e){if(!e)return"";let{h:t,m:i,s}=e;if(s>=60&&(i+=Math.floor(s/60),s%=60),i>=60&&(t+=Math.floor(i/60),i%=60),t>=24){let e=Math.floor(t/24),i=t%24;return i>0?`${r("{n}d",e)} ${r("{n}h",i)}`:r("{n}d",e)}let l=[];return t>0&&l.push(r("{n}h",t)),i>0&&l.push(r("{n}m",i)),(s>0||0===l.length)&&l.push(r("{n}s",s)),l.join(" ")}((c=/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?$/i.exec(String(u||"").trim()))&&(c[1]||c[2]||c[3])?{h:Math.floor(parseFloat(c[1]||0)),m:Math.floor(parseFloat(c[2]||0)),s:Math.round(parseFloat(c[3]||0))}:null),h=m?function(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e||"";try{return t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t.toISOString()}}(m):"",f=(0,s.Tl)(p?"Individual quota reached for model {model}. Resets at {time} (in {duration}).":"Individual quota reached. Resets at {time} (in {duration}).");return(f=(f=f.replace("{model}",p||"")).replace("{time}",h||(0,s.Tl)("shortly"))).replace("{duration}",x||(0,s.Tl)("a short while"))}return t}},93195:(e,t,i)=>{"use strict";function s(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}i.d(t,{JW:()=>o,Vm:()=>s,fB:()=>n,gy:()=>l,nz:()=>a});let l={anchor:"09:30",timezone:s(),windowHours:5,slotsPerDay:3};function n(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let i=Number(t[1]),s=Number(t[2]);return i>23||s>59?null:{hour:i,minute:s}}function a(e){return Math.max(1,Math.floor(24/e))}function r(e,t,i,s){let l="number"==typeof e?e:Number(e);return Number.isFinite(l)?Math.min(s,Math.max(i,l)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=n(e.anchor)||n(l.anchor),i=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,s=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?l.timezone:e.timezone,o=r(e.windowHours,l.windowHours,.5,24),d=Math.round(r(e.slotsPerDay,l.slotsPerDay,1,a(o)));return{enabled:!0,anchor:i,timezone:s,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:i,minute:s}=n(t.anchor),o=60*i+s;return Array.from({length:t.slotsPerDay},(e,i)=>{let s=Math.round(o+i*t.windowHours*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})}},93578:(e,t,i)=>{Promise.resolve().then(i.bind(i,83204))},97132:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var s=i(95155),l=i(12115),n=i(14051),a=i.n(n),r=i(35497),o=i(31474),d=i(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function u({isOpen:e,onClose:t,onSave:i,connection:n,reactive:a=!1,schedule:m=null}){let[p,x]=(0,l.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===a?"reset":"off",anchor:m?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(m?.windowHours??d.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??d.gy.slotsPerDay)})),h=Number(p.windowHours),f=Number(p.slotsPerDay),g=!!(0,d.fB)(p.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"!==p.mode||j,k=j?(0,d.JW)({enabled:!0,...p,windowHours:h,slotsPerDay:f}):[],N=k.length&&y?(()=>{let{hour:e,minute:t}=(0,d.fB)(p.anchor),i=Math.round(60*e+t+f*h*60)%1440;return`${String(Math.floor(i/60)).padStart(2,"0")}:${String(i%60).padStart(2,"0")}`})():"",T=e=>x(t=>({...t,...e}));return(0,s.jsx)(r.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,s.jsx)(r.$n,{onClick:()=>{w&&(i({reactive:"reset"===p.mode,schedule:"schedule"===p.mode?{enabled:!0,anchor:p.anchor,timezone:p.timezone,windowHours:h,slotsPerDay:f}:{enabled:!1}}),t())},disabled:!w,children:"Save"})]}),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",n?.name?` for ${n.name}`:""," — pick one mode."]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=p.mode===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>T({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,s.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,s.jsx)("span",{children:e.label})]},e.value)})}),"reset"===p.mode&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===p.mode&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,s.jsx)(r.pd,{label:"Anchor time",type:"time",value:p.anchor,onChange:e=>T({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,s.jsx)(r.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:p.windowHours,onChange:e=>T({windowHours:e.target.value}),error:y?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,s.jsx)(r.pd,{label:"Pings per day",type:"number",min:"1",max:String(b),step:"1",value:p.slotsPerDay,onChange:e=>T({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,s.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,s.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",p.timezone,")"]}),(0,s.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:k.join(" → ")}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",k[0]," – ",N,", then pauses until ",k[0]," next day."]})]})]})]})})}u.propTypes={isOpen:a().bool.isRequired,onClose:a().func.isRequired,onSave:a().func.isRequired,connection:a().object,reactive:a().bool,schedule:a().object}}},e=>{e.O(0,[3170,305,5772,1321,5497,6109,8441,3794,7358],()=>e(e.s=93578)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{8247:(e,t,s)=>{"use strict";s.d(t,{HY:()=>l,Kw:()=>o});let r={"perplexity-agent":"perplexity","gitlab-duo":"gitlab","vercel-ai-gateway":"vercel","b.ai":"bai","b-ai":"bai","siliconflow-cn":"siliconflow","longcat-intl":"longcat","stepfun-cn":"stepfun","stepfun-plan":"stepfun","stepfun-plan-cn":"stepfun","step-cn":"stepfun","stepp-cn":"stepfun",stepp:"stepfun",step:"stepfun","sfp-cn":"stepfun",sfp:"stepfun",sfpcn:"stepfun","sf-cn":"stepfun",sfcn:"stepfun",sf:"stepfun","step-plan-cn":"stepfun","step-plan":"stepfun","alitp-intl":"alitp-intl","alims-intl":"alitp-intl","alicode-intl":"alitp-intl","alitp-cn":"alitp",alims:"alitp",alicode:"alitp"},a={bai:".svg"},n=new Set;function i(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function l(e){let t=function(e){let t=i(e);if(!t||n.has(t))return"";let s=r[t]||t;return n.has(s)?"":s}(e);return t?`/providers/${t}${a[t]||".png"}`:null}function o(e){let t=i(e);t&&n.add(t);let s=r[t];s&&n.add(s)}},11059:(e,t,s)=>{"use strict";s.d(t,{C:()=>n});var r=s(12115),a=s(65635);function n(e=2e3){let[t,s]=(0,r.useState)(null),i=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(0,a.e)(t),s(r),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{s(null)},e)},[e])}}},23333:()=>{},27565:(e,t,s)=>{Promise.resolve().then(s.bind(s,85941))},39092:(e,t,s)=>{"use strict";e.exports=s(73279).style},65635:(e,t,s)=>{"use strict";async function r(e){let t=String(e??"");try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}try{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();let s=document.execCommand("copy");return document.body.removeChild(e),s}catch{return!1}}s.d(t,{e:()=>r})},67852:(e,t,s)=>{"use strict";s.d(t,{A:()=>em});var r=s(95155),a=s(12115),n=s(14051),i=s.n(n),l=s(8247),o=s(35650),c=s(41658),d=s(74519),h=s(69036),x=s(50247),u=s(77622),m=s(89403),f=s(29892),p=s(70224),g=s(84670),b=s(68031),v=s(54173),y=s(49651),j=s(87111),w=s(41909),N=s(50159),_=s(80323),S=s(54689),A=s(41185),k=s(53006),C=s(36900),R=s(71657),z=s(40942),I=s(62391),F=s(42887),T=s(25097),O=s(82640),H=s(10572),D=s(91685),E=s(73119),P=s(50661),L=s(86619),M=s(89717),W=s(50658),$=s(59435),G=s(4722),q=s(85836),B=s(76189),K=s(12068),U=s(76147),Y=s(37058),J=s(46201),V=s(83482),Q=s(72057),X=s(72638),Z=s(16743),ee=s(35811),et=s(28296),es=s(52302),er=s(72769),ea=s(85979),en=s(13448),ei=s(37841),el=s(9897),eo=s(94938),ec=s(56513),ed=s(86097),eh=s(8297);let ex={openai:o.A,anthropic:c.A,claude:d.A,gemini:h.A,deepseek:x.A,minimax:u.A,"minimax-cn":u.A,groq:m.A,nvidia:f.A,xai:p.A,openrouter:g.A,mistral:b.A,cohere:v.A,perplexity:y.A,together:j.A,fireworks:w.A,siliconflow:N.A,"siliconflow-cn":N.A,kimi:_.A,glm:S.A,"glm-cn":S.A,"aws-polly":A.A,azure:k.A,"cloudflare-ai":C.A,huggingface:R.A,ollama:z.A,sambanova:I.A,cerebras:F.A,venice:T.A,nebius:O.A,hyperbolic:H.A,featherless:D.A,baidu:E.A,tencent:P.A,"volcengine-ark":L.A,github:M.A,cursor:W.A,cline:$.A,windsurf:G.A,kiro:q.A,trae:B.A,"jina-ai":K.A,exa:U.A,tavily:Y.A,"brave-search":J.A,searchapi:V.A,searxng:Q.A,"fish-audio":X.A,assemblyai:Z.A,elevenlabs:ee.A,"voyage-ai":et.A,"fal-ai":es.A,recraft:er.A,"stability-ai":ea.A,runwayml:en.A,morph:ei.A,comfyui:el.A,sensenova:eo.A,longcat:ec.A,vertex:ed.A,"vercel-ai-gateway":eh.A};function eu({providerId:e,size:t=32,className:s=""}){let a=ex[e];if(!a)return null;let n=a.Color||a;return(0,r.jsx)(n,{size:t,className:s})}function em({src:e,providerId:t,alt:s,size:n=32,className:i="",fallbackText:o="?",fallbackColor:c}){let d=function(e,t){if(t)return(0,l.HY)(t);if(!e)return null;let s=String(e).match(/^\/providers\/([^/]+)\.png$/i);return s?(0,l.HY)(s[1]):e}(e,t),[h,x]=(0,a.useState)(!1);return t&&ex[t]?(0,r.jsx)(eu,{providerId:t,size:n,className:i}):!d||h?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${i}`.trim(),style:{width:n,height:n,color:c,fontSize:Math.max(10,Math.floor(.38*n))},children:o}):(0,r.jsx)("img",{src:d,alt:s,width:n,height:n,className:i,loading:"lazy",decoding:"async",onError:()=>{let e=d.match(/^\/providers\/([^/]+)\.png$/i);e&&(0,l.Kw)(e[1]),t&&(0,l.Kw)(t),x(!0)}})}em.propTypes={src:i().string,providerId:i().string,alt:i().string,size:i().number,className:i().string,fallbackText:i().string,fallbackColor:i().string}},73279:(e,t,s)=>{"use strict";var r=s(41463);s(23333);var a=s(12115),n=a&&"object"==typeof a&&"default"in a?a:{default:a},i=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,a=t.optimizeForSpeed,n=void 0===a?i:a;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var s="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(r){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},s.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return s?a.insertBefore(r,s):a.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},h={};function x(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return h[r]||(h[r]="jsx-"+d(e+"-"+s)),h[r]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return h[s]||(h[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[s]}var m=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,a=t.optimizeForSpeed,n=void 0!==a&&a;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),r&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),r=s.styleId,a=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var n=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=n,this._instancesCounts[r]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],r=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var a=x(r,s);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return u(a,e)}):[u(a,t)]}}return{styleId:x(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=a.createContext(null);f.displayName="StyleSheetContext";var p=n.default.useInsertionEffect||n.default.useLayoutEffect,g="u">typeof window?new m:void 0;function b(e){var t=g||a.useContext(f);return t&&("u"<typeof window?t.add(e):p(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}b.dynamic=function(e){return e.map(function(e){return x(e[0],e[1])}).join(" ")},t.style=b},85941:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var r=s(95155),a=s(39092),n=s.n(a),i=s(73321),l=s(12115);function o(){let[e,t]=(0,l.useState)(!1),s=(0,i.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#181411]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#f97815] to-orange-700 flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"hub"})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"10Router"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/techysy/10router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#f97815] hover:bg-[#e0650a] transition-all text-[#181411] text-sm font-bold shadow-[0_0_15px_rgba(249,120,21,0.4)] hover:shadow-[0_0_20px_rgba(249,120,21,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#181411]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/techysy/10router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-sm font-bold",children:"Get Started"})]})})]})}function c(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#f97815]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#23180f]/50 px-3 py-1 text-xs font-medium text-[#f97815]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#f97815] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{className:"h-12 px-8 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-base font-bold transition-all shadow-[0_0_15px_rgba(249,120,21,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#3a2f27] bg-[#23180f] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var d=s(67852);let h=[{id:"claude",name:"Claude Code",image:"/providers/claude.png"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.png"},{id:"cline",name:"Cline",image:"/providers/cline.png"},{id:"cursor",name:"Cursor",image:"/providers/cursor.png"}],x=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function u(){let[e,t]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%x.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#23180f] border-2 border-[#f97815] shadow-[0_0_40px_rgba(249,120,21,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815]",children:"hub"}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"10Router"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#f97815]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:h.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#23180f] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#f97815]/50 transition-all hover:scale-105",children:(0,r.jsx)(d.A,{src:e.image,alt:e.name,size:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:x.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#f97815]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#23180f] border border-[#3a2f27]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function m(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#23180f]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How 10Router Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#f97815] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border-2 border-[#f97815] flex items-center justify-center shadow-[0_0_30px_rgba(249,120,21,0.2)] z-10 mx-auto",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815] animate-pulse",children:"hub"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#f97815]",children:"2. 10Router Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let f=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function p(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:f.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#23180f] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var g=s(11059);function b(){let{copied:e,copy:t}=(0,g.C)();return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#120f0d]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install 10Router, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install 10Router"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://localhost:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx @techysy/10router","landing")},children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx @techysy/10router"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Starting 10Router...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Server running on ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Dashboard: ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.10router/db/data.sqlite",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/10router/db/data.sqlite"]})]})]})})]})})})}function v(){return(0,r.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#120f0d] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#f97815] flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"hub"})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"10Router"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/techysy/10router#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://www.npmjs.com/package/10router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/techysy/10router/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 10Router. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/techysy/10router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/10router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function y(){let e=(0,i.useRouter)();return(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#f97815] selection:text-white",children:[(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#181411]",children:[(0,r.jsx)("div",{style:{backgroundImage:"linear-gradient(to right, #f97815 1px, transparent 1px), linear-gradient(to bottom, #f97815 1px, transparent 1px)",backgroundSize:"50px 50px"},className:"jsx-d14ef8389c385e6a absolute inset-0 opacity-[0.06]"}),(0,r.jsx)("div",{className:"jsx-d14ef8389c385e6a absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#f97815]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"2s",animationDuration:"22s"},className:"jsx-d14ef8389c385e6a absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"4s",animationDuration:"25s"},className:"jsx-d14ef8389c385e6a absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{background:"radial-gradient(circle at center, transparent 0%, rgba(24, 20, 17, 0.4) 100%)"},className:"jsx-d14ef8389c385e6a absolute inset-0"})]}),(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a relative z-10",children:[(0,r.jsx)(o,{}),(0,r.jsxs)("main",{className:"jsx-d14ef8389c385e6a",children:[(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a relative",children:[(0,r.jsx)(c,{}),(0,r.jsx)("div",{className:"jsx-d14ef8389c385e6a flex justify-center pb-20",children:(0,r.jsx)(u,{})})]}),(0,r.jsx)(b,{}),(0,r.jsx)(m,{}),(0,r.jsx)(p,{}),(0,r.jsxs)("section",{className:"jsx-d14ef8389c385e6a py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"jsx-d14ef8389c385e6a absolute inset-0 bg-linear-to-t from-[#f97815]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"jsx-d14ef8389c385e6a text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"jsx-d14ef8389c385e6a text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with 10Router. Open source and free to start."}),(0,r.jsxs)("div",{className:"jsx-d14ef8389c385e6a flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>e.push("/dashboard"),className:"jsx-d14ef8389c385e6a w-full sm:w-auto h-14 px-10 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-lg font-bold transition-all shadow-[0_0_20px_rgba(249,120,21,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{onClick:()=>window.open("https://github.com/techysy/10router#readme","_blank"),className:"jsx-d14ef8389c385e6a w-full sm:w-auto h-14 px-10 rounded-lg border border-[#3a2f27] hover:bg-[#23180f] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(v,{})]}),(0,r.jsx)(n(),{id:"d14ef8389c385e6a",children:"@keyframes float{0%,100%{transform:translatey(0)}50%{transform:translatey(-10px)}}@keyframes dash{to{stroke-dashoffset:-20}}@keyframes blob{0%,100%{transform:translate(0,0)scale(1)}33%{transform:translate(30px,-50px)scale(1.1)}66%{transform:translate(-20px,20px)scale(.9)}}.animate-blob{animation:blob 20s ease-in-out infinite}"})]})}}},e=>{e.O(0,[3170,8441,3794,7358],()=>e(e.s=27565)),_N_E=e.O()}]);