@techysy/10router 1.1.3 → 1.2.1

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 (1164) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +57 -0
  3. package/README.zh-CN.md +49 -0
  4. package/app/.next-cli-build/BUILD_ID +1 -1
  5. package/app/.next-cli-build/app-path-routes-manifest.json +11 -8
  6. package/app/.next-cli-build/build-manifest.json +3 -3
  7. package/app/.next-cli-build/prerender-manifest.json +51 -23
  8. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  9. package/app/.next-cli-build/routes-manifest.json +18 -0
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js +1 -0
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js.nft.json +1 -0
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page_client-reference-manifest.js +1 -0
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +6 -6
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  83. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  91. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.rsc +18 -17
  95. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +18 -17
  96. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +10 -9
  97. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  98. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +2 -2
  111. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  113. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  125. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/keys/rotate/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/keys/rotate/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  189. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  191. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/caps/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/caps/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/network/egress-region/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/network/egress-region/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  263. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  297. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  299. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  303. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  305. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  309. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  311. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  313. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  315. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  317. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  319. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/security/status/route.js +1 -0
  321. package/app/.next-cli-build/server/app/api/security/status/route.js.nft.json +1 -0
  322. package/app/.next-cli-build/server/app/api/security/status/route_client-reference-manifest.js +1 -0
  323. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  340. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  362. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/quotas/route.js +1 -0
  378. package/app/.next-cli-build/server/app/api/usage/quotas/route.js.nft.json +1 -0
  379. package/app/.next-cli-build/server/app/api/usage/quotas/route_client-reference-manifest.js +1 -0
  380. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  401. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  427. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  431. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  433. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  434. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  435. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  436. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  437. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  439. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  440. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  441. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  442. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  443. package/app/.next-cli-build/server/app/callback.html +1 -1
  444. package/app/.next-cli-build/server/app/callback.rsc +22 -21
  445. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +22 -21
  446. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +3 -3
  447. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +10 -9
  448. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +20 -19
  450. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +12 -11
  451. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +20 -19
  452. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +3 -3
  453. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +21 -20
  455. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +12 -11
  456. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +21 -20
  457. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -3
  458. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/combos.rsc +23 -22
  460. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +12 -11
  461. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +23 -22
  462. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -3
  463. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +21 -20
  465. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +12 -11
  466. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +21 -20
  467. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -3
  468. package/app/.next-cli-build/server/app/dashboard/experimental.html +1 -0
  469. package/app/.next-cli-build/server/app/dashboard/experimental.meta +36 -0
  470. package/app/.next-cli-build/server/app/dashboard/experimental.rsc +23 -0
  471. package/app/.next-cli-build/server/app/dashboard/experimental.segments/!KGRhc2hib2FyZCk/dashboard/experimental/__PAGE__.segment.rsc +31 -0
  472. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_full.segment.rsc +23 -0
  473. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_tree.segment.rsc +3 -0
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +23 -22
  476. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +12 -11
  477. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +23 -22
  478. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +3 -3
  479. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +20 -19
  481. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +12 -11
  482. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +20 -19
  483. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -3
  484. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/profile.rsc +23 -22
  486. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +12 -11
  487. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +23 -22
  488. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -3
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +23 -22
  491. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +12 -11
  492. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +23 -22
  493. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -3
  494. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/providers.rsc +23 -22
  496. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +12 -11
  497. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +23 -22
  498. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -3
  499. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +23 -22
  501. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +12 -11
  502. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +23 -22
  503. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +3 -3
  504. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +20 -19
  506. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +12 -11
  507. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +20 -19
  508. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +3 -3
  509. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  510. package/app/.next-cli-build/server/app/dashboard/quota.rsc +21 -20
  511. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +13 -12
  512. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +21 -20
  513. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -3
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  517. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +22 -21
  519. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +22 -21
  520. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -3
  521. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +11 -10
  522. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/skills.rsc +23 -22
  524. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +12 -11
  525. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +23 -22
  526. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +3 -3
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +20 -19
  529. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +12 -11
  530. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +20 -19
  531. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +3 -3
  532. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/translator.rsc +23 -22
  534. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +12 -11
  535. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +23 -22
  536. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -3
  537. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/usage.rsc +23 -22
  539. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +12 -11
  540. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +23 -22
  541. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -3
  542. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  543. package/app/.next-cli-build/server/app/dashboard.rsc +21 -20
  544. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +12 -11
  545. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +21 -20
  546. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +3 -3
  547. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  548. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  549. package/app/.next-cli-build/server/app/index.html +1 -1
  550. package/app/.next-cli-build/server/app/index.rsc +17 -16
  551. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +10 -9
  552. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +17 -16
  553. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +3 -3
  554. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  555. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  556. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  557. package/app/.next-cli-build/server/app/landing.html +1 -1
  558. package/app/.next-cli-build/server/app/landing.rsc +22 -21
  559. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +22 -21
  560. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +3 -3
  561. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +11 -10
  562. package/app/.next-cli-build/server/app/login/page.js +1 -1
  563. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  564. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  565. package/app/.next-cli-build/server/app/login.html +1 -1
  566. package/app/.next-cli-build/server/app/login.rsc +22 -21
  567. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +22 -21
  568. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +3 -3
  569. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +11 -10
  570. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  571. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  572. package/app/.next-cli-build/server/app/page.js +1 -1
  573. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  574. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  575. package/app/.next-cli-build/server/app-paths-manifest.json +11 -8
  576. package/app/.next-cli-build/server/chunks/112.js +1 -0
  577. package/app/.next-cli-build/server/chunks/1219.js +4 -0
  578. package/app/.next-cli-build/server/chunks/1261.js +1 -0
  579. package/app/.next-cli-build/server/chunks/1330.js +1 -0
  580. package/app/.next-cli-build/server/chunks/1710.js +6 -0
  581. package/app/.next-cli-build/server/chunks/2112.js +1 -1
  582. package/app/.next-cli-build/server/chunks/2120.js +1 -1
  583. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  584. package/app/.next-cli-build/server/chunks/2182.js +9 -0
  585. package/app/.next-cli-build/server/chunks/241.js +1 -1
  586. package/app/.next-cli-build/server/chunks/271.js +1 -0
  587. package/app/.next-cli-build/server/chunks/2812.js +2 -0
  588. package/app/.next-cli-build/server/chunks/2926.js +1 -0
  589. package/app/.next-cli-build/server/chunks/3245.js +1 -0
  590. package/app/.next-cli-build/server/chunks/3256.js +1 -0
  591. package/app/.next-cli-build/server/chunks/3433.js +120 -0
  592. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  593. package/app/.next-cli-build/server/chunks/3651.js +3 -3
  594. package/app/.next-cli-build/server/chunks/3792.js +1 -0
  595. package/app/.next-cli-build/server/chunks/3885.js +1 -0
  596. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  597. package/app/.next-cli-build/server/chunks/4123.js +2 -2
  598. package/app/.next-cli-build/server/chunks/4125.js +1 -1
  599. package/app/.next-cli-build/server/chunks/{9927.js → 4177.js} +1 -1
  600. package/app/.next-cli-build/server/chunks/4282.js +1 -0
  601. package/app/.next-cli-build/server/chunks/4293.js +1 -1
  602. package/app/.next-cli-build/server/chunks/4575.js +1 -0
  603. package/app/.next-cli-build/server/chunks/4739.js +1 -1
  604. package/app/.next-cli-build/server/chunks/4746.js +1 -0
  605. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  606. package/app/.next-cli-build/server/chunks/4803.js +9 -0
  607. package/app/.next-cli-build/server/chunks/4927.js +85 -0
  608. package/app/.next-cli-build/server/chunks/4990.js +9 -0
  609. package/app/.next-cli-build/server/chunks/507.js +1 -1
  610. package/app/.next-cli-build/server/chunks/5182.js +1 -1
  611. package/app/.next-cli-build/server/chunks/5210.js +304 -0
  612. package/app/.next-cli-build/server/chunks/5258.js +2 -2
  613. package/app/.next-cli-build/server/chunks/5330.js +6 -6
  614. package/app/.next-cli-build/server/chunks/539.js +1 -0
  615. package/app/.next-cli-build/server/chunks/5433.js +1 -1
  616. package/app/.next-cli-build/server/chunks/5485.js +1 -1
  617. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  618. package/app/.next-cli-build/server/chunks/5692.js +5 -0
  619. package/app/.next-cli-build/server/chunks/5781.js +2 -2
  620. package/app/.next-cli-build/server/chunks/595.js +1 -1
  621. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  622. package/app/.next-cli-build/server/chunks/6103.js +1 -0
  623. package/app/.next-cli-build/server/chunks/6133.js +6 -0
  624. package/app/.next-cli-build/server/chunks/615.js +1 -1
  625. package/app/.next-cli-build/server/chunks/6252.js +9 -0
  626. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  627. package/app/.next-cli-build/server/chunks/6326.js +1 -1
  628. package/app/.next-cli-build/server/chunks/6457.js +1 -4
  629. package/app/.next-cli-build/server/chunks/6492.js +1 -0
  630. package/app/.next-cli-build/server/chunks/653.js +1 -1
  631. package/app/.next-cli-build/server/chunks/6756.js +1 -1
  632. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  633. package/app/.next-cli-build/server/chunks/6875.js +1 -0
  634. package/app/.next-cli-build/server/chunks/6947.js +1 -0
  635. package/app/.next-cli-build/server/chunks/6956.js +1 -0
  636. package/app/.next-cli-build/server/chunks/6960.js +2 -2
  637. package/app/.next-cli-build/server/chunks/698.js +1 -1
  638. package/app/.next-cli-build/server/chunks/6982.js +1 -0
  639. package/app/.next-cli-build/server/chunks/7067.js +1 -1
  640. package/app/.next-cli-build/server/chunks/7122.js +1 -1
  641. package/app/.next-cli-build/server/chunks/7239.js +4 -4
  642. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  643. package/app/.next-cli-build/server/chunks/7274.js +15 -8
  644. package/app/.next-cli-build/server/chunks/7322.js +1 -1
  645. package/app/.next-cli-build/server/chunks/7568.js +1 -0
  646. package/app/.next-cli-build/server/chunks/7726.js +1 -0
  647. package/app/.next-cli-build/server/chunks/7753.js +1 -0
  648. package/app/.next-cli-build/server/chunks/7775.js +1 -0
  649. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  650. package/app/.next-cli-build/server/chunks/8062.js +9 -0
  651. package/app/.next-cli-build/server/chunks/808.js +1 -1
  652. package/app/.next-cli-build/server/chunks/8172.js +1 -0
  653. package/app/.next-cli-build/server/chunks/8469.js +9 -0
  654. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  655. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  656. package/app/.next-cli-build/server/chunks/8595.js +1 -0
  657. package/app/.next-cli-build/server/chunks/8658.js +1 -0
  658. package/app/.next-cli-build/server/chunks/8672.js +1 -0
  659. package/app/.next-cli-build/server/chunks/8689.js +1 -0
  660. package/app/.next-cli-build/server/chunks/869.js +1 -1
  661. package/app/.next-cli-build/server/chunks/8749.js +44 -0
  662. package/app/.next-cli-build/server/chunks/8838.js +1 -1
  663. package/app/.next-cli-build/server/chunks/8895.js +10 -7
  664. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  665. package/app/.next-cli-build/server/chunks/9046.js +1 -0
  666. package/app/.next-cli-build/server/chunks/9154.js +1 -0
  667. package/app/.next-cli-build/server/chunks/9489.js +7 -0
  668. package/app/.next-cli-build/server/chunks/9539.js +9 -0
  669. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  670. package/app/.next-cli-build/server/chunks/9628.js +1 -0
  671. package/app/.next-cli-build/server/instrumentation.js +1 -1
  672. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  673. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  674. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  675. package/app/.next-cli-build/server/middleware.js +8 -8
  676. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  677. package/app/.next-cli-build/server/pages/404.html +1 -1
  678. package/app/.next-cli-build/server/pages/500.html +1 -1
  679. package/app/.next-cli-build/server/prefetch-hints.json +24 -0
  680. package/app/.next-cli-build/static/Qmgbf1CsCnKFbpB4QvL8M/_buildManifest.js +1 -0
  681. package/app/.next-cli-build/static/chunks/1243-d0e0b9458266e912.js +3 -0
  682. package/app/.next-cli-build/static/chunks/1321-502b5305b875636f.js +1 -0
  683. package/app/.next-cli-build/static/chunks/{3346-0ae97d50d86ac1f7.js → 3346-509e8dd58ea4832d.js} +7 -7
  684. package/app/.next-cli-build/static/chunks/{3521.3c9be8ed83af460d.js → 3521.3107c4bff48fe566.js} +1 -1
  685. package/app/.next-cli-build/static/chunks/5497-10ab12f860a6a157.js +7 -0
  686. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-fa4ba47a6bf0da15.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/experimental/page-4dd5e46a2d6f4486.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-9ca09f92fcb7be9f.js +59 -0
  689. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-9a471accf206ea43.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-a2510813ebd64f72.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-93f4c31ccd56a895.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d3edcb35175434d5.js +14 -0
  693. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-9ec9a9251e22a7c8.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-e84b8de5542a9dc9.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f62700ce9aa54572.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-7833d8a884ba922a.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-158175db070fe14c.js → layout-434f2e27f8b21ae1.js} +1 -1
  698. package/app/.next-cli-build/static/chunks/app/_global-error/page-72924bfdaa66606d.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-72924bfdaa66606d.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-72924bfdaa66606d.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-72924bfdaa66606d.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-72924bfdaa66606d.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-72924bfdaa66606d.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-72924bfdaa66606d.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-72924bfdaa66606d.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-72924bfdaa66606d.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-72924bfdaa66606d.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-72924bfdaa66606d.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-72924bfdaa66606d.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/auth/verify-password/route-72924bfdaa66606d.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-72924bfdaa66606d.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-72924bfdaa66606d.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-72924bfdaa66606d.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-72924bfdaa66606d.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-72924bfdaa66606d.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-72924bfdaa66606d.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-72924bfdaa66606d.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-72924bfdaa66606d.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-72924bfdaa66606d.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-72924bfdaa66606d.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-72924bfdaa66606d.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-72924bfdaa66606d.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-72924bfdaa66606d.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-72924bfdaa66606d.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-72924bfdaa66606d.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-72924bfdaa66606d.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-72924bfdaa66606d.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-72924bfdaa66606d.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-72924bfdaa66606d.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-72924bfdaa66606d.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/combos/route-72924bfdaa66606d.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-72924bfdaa66606d.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-72924bfdaa66606d.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-72924bfdaa66606d.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-72924bfdaa66606d.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-72924bfdaa66606d.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-72924bfdaa66606d.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/health/route-72924bfdaa66606d.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/init/route-72924bfdaa66606d.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-72924bfdaa66606d.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/keys/rotate/route-72924bfdaa66606d.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/keys/route-72924bfdaa66606d.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/locale/route-72924bfdaa66606d.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-72924bfdaa66606d.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-72924bfdaa66606d.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-72924bfdaa66606d.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-72924bfdaa66606d.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-72924bfdaa66606d.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-72924bfdaa66606d.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-72924bfdaa66606d.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-72924bfdaa66606d.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-72924bfdaa66606d.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/models/caps/route-72924bfdaa66606d.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/models/custom/bulk/route-72924bfdaa66606d.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-72924bfdaa66606d.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-72924bfdaa66606d.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/models/route-72924bfdaa66606d.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/models/test/route-72924bfdaa66606d.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/network/egress-region/route-72924bfdaa66606d.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-72924bfdaa66606d.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-72924bfdaa66606d.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/checkin/route-72924bfdaa66606d.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-72924bfdaa66606d.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-72924bfdaa66606d.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-72924bfdaa66606d.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-72924bfdaa66606d.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-72924bfdaa66606d.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-72924bfdaa66606d.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-72924bfdaa66606d.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-72924bfdaa66606d.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-72924bfdaa66606d.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-72924bfdaa66606d.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-72924bfdaa66606d.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-72924bfdaa66606d.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-72924bfdaa66606d.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder/checkin/route-72924bfdaa66606d.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder-cn/checkin/route-72924bfdaa66606d.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/export/route-72924bfdaa66606d.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/import/route-72924bfdaa66606d.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-72924bfdaa66606d.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-72924bfdaa66606d.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/pricing/route-72924bfdaa66606d.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-72924bfdaa66606d.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-72924bfdaa66606d.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-72924bfdaa66606d.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-72924bfdaa66606d.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-72924bfdaa66606d.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-72924bfdaa66606d.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-72924bfdaa66606d.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-72924bfdaa66606d.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-72924bfdaa66606d.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/providers/route-72924bfdaa66606d.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-72924bfdaa66606d.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-72924bfdaa66606d.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-72924bfdaa66606d.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-72924bfdaa66606d.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-72924bfdaa66606d.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-72924bfdaa66606d.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-72924bfdaa66606d.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-72924bfdaa66606d.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-72924bfdaa66606d.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-72924bfdaa66606d.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-72924bfdaa66606d.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-72924bfdaa66606d.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-72924bfdaa66606d.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-72924bfdaa66606d.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-72924bfdaa66606d.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-72924bfdaa66606d.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-72924bfdaa66606d.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/security/status/route-72924bfdaa66606d.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-72924bfdaa66606d.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-72924bfdaa66606d.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-72924bfdaa66606d.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-72924bfdaa66606d.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/settings/route-72924bfdaa66606d.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-72924bfdaa66606d.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/tags/route-72924bfdaa66606d.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-72924bfdaa66606d.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-72924bfdaa66606d.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-72924bfdaa66606d.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-72924bfdaa66606d.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-72924bfdaa66606d.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-72924bfdaa66606d.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-72924bfdaa66606d.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-72924bfdaa66606d.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-72924bfdaa66606d.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-72924bfdaa66606d.js +1 -0
  828. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-72924bfdaa66606d.js +1 -0
  829. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-72924bfdaa66606d.js +1 -0
  830. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-72924bfdaa66606d.js +1 -0
  831. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-72924bfdaa66606d.js +1 -0
  832. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-72924bfdaa66606d.js +1 -0
  833. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-72924bfdaa66606d.js +1 -0
  834. package/app/.next-cli-build/static/chunks/app/api/usage/dashboard/route-72924bfdaa66606d.js +1 -0
  835. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-72924bfdaa66606d.js +1 -0
  836. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-72924bfdaa66606d.js +1 -0
  837. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-72924bfdaa66606d.js +1 -0
  838. package/app/.next-cli-build/static/chunks/app/api/usage/quotas/route-72924bfdaa66606d.js +1 -0
  839. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-72924bfdaa66606d.js +1 -0
  840. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-72924bfdaa66606d.js +1 -0
  841. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-72924bfdaa66606d.js +1 -0
  842. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-72924bfdaa66606d.js +1 -0
  843. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-72924bfdaa66606d.js +1 -0
  844. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-72924bfdaa66606d.js +1 -0
  845. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-72924bfdaa66606d.js +1 -0
  846. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-72924bfdaa66606d.js +1 -0
  847. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-72924bfdaa66606d.js +1 -0
  848. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-72924bfdaa66606d.js +1 -0
  849. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-72924bfdaa66606d.js +1 -0
  850. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-72924bfdaa66606d.js +1 -0
  851. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-72924bfdaa66606d.js +1 -0
  852. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-72924bfdaa66606d.js +1 -0
  853. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-72924bfdaa66606d.js +1 -0
  854. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-72924bfdaa66606d.js +1 -0
  855. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-72924bfdaa66606d.js +1 -0
  856. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-72924bfdaa66606d.js +1 -0
  857. package/app/.next-cli-build/static/chunks/app/api/v1/route-72924bfdaa66606d.js +1 -0
  858. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-72924bfdaa66606d.js +1 -0
  859. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-72924bfdaa66606d.js +1 -0
  860. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-72924bfdaa66606d.js +1 -0
  861. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-72924bfdaa66606d.js +1 -0
  862. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-72924bfdaa66606d.js +1 -0
  863. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-72924bfdaa66606d.js +1 -0
  864. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-72924bfdaa66606d.js +1 -0
  865. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-72924bfdaa66606d.js +1 -0
  866. package/app/.next-cli-build/static/chunks/app/api/version/route-72924bfdaa66606d.js +1 -0
  867. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-72924bfdaa66606d.js +1 -0
  868. package/app/.next-cli-build/static/chunks/app/api/version/update/route-72924bfdaa66606d.js +1 -0
  869. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-9170ddf38e76b3cf.js → page-3659ea13d950adc1.js} +1 -1
  870. package/app/.next-cli-build/static/chunks/app/landing/page-acb1434862d18ac7.js +1 -0
  871. package/app/.next-cli-build/static/chunks/app/layout-ba8ee035fd3fda5f.js +1 -0
  872. package/app/.next-cli-build/static/chunks/app/login/page-38ed66b1e6930f46.js +1 -0
  873. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-72924bfdaa66606d.js +1 -0
  874. package/app/.next-cli-build/static/chunks/app/page-72924bfdaa66606d.js +1 -0
  875. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-72924bfdaa66606d.js +1 -0
  876. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-72924bfdaa66606d.js +1 -0
  877. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-72924bfdaa66606d.js +1 -0
  878. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-72924bfdaa66606d.js +1 -0
  879. package/app/.next-cli-build/static/chunks/{webpack-77a7ed7beb6725df.js → webpack-b43a2a1c513882e9.js} +1 -1
  880. package/app/.next-cli-build/static/css/7a3e1568f247f3d0.css +1 -0
  881. package/app/.next-cli-build/static/css/ab87cc8491e8d0fb.css +1 -0
  882. package/app/custom-server.js +8 -8
  883. package/app/package.json +1 -1
  884. package/app/public/i18n/changelog/en.md +72 -0
  885. package/app/public/i18n/changelog/zh-CN.md +72 -0
  886. package/app/public/i18n/changelog/zh-TW.md +72 -0
  887. package/app/public/i18n/literals/ar.json +4 -4
  888. package/app/public/i18n/literals/bn.json +4 -4
  889. package/app/public/i18n/literals/cs.json +4 -4
  890. package/app/public/i18n/literals/da.json +4 -4
  891. package/app/public/i18n/literals/de.json +4 -4
  892. package/app/public/i18n/literals/el.json +4 -4
  893. package/app/public/i18n/literals/es.json +4 -4
  894. package/app/public/i18n/literals/fa.json +31 -34
  895. package/app/public/i18n/literals/fi.json +4 -4
  896. package/app/public/i18n/literals/fr.json +4 -4
  897. package/app/public/i18n/literals/he.json +4 -4
  898. package/app/public/i18n/literals/hi.json +4 -4
  899. package/app/public/i18n/literals/hu.json +4 -4
  900. package/app/public/i18n/literals/id.json +4 -4
  901. package/app/public/i18n/literals/it.json +4 -4
  902. package/app/public/i18n/literals/ja.json +4 -4
  903. package/app/public/i18n/literals/km.json +31 -34
  904. package/app/public/i18n/literals/ko.json +4 -4
  905. package/app/public/i18n/literals/nl.json +4 -4
  906. package/app/public/i18n/literals/no.json +4 -4
  907. package/app/public/i18n/literals/pl.json +4 -4
  908. package/app/public/i18n/literals/pt-BR.json +12 -12
  909. package/app/public/i18n/literals/pt-PT.json +4 -4
  910. package/app/public/i18n/literals/ro.json +4 -4
  911. package/app/public/i18n/literals/ru.json +4 -4
  912. package/app/public/i18n/literals/sv.json +4 -4
  913. package/app/public/i18n/literals/th.json +31 -34
  914. package/app/public/i18n/literals/tl.json +4 -4
  915. package/app/public/i18n/literals/tr.json +4 -4
  916. package/app/public/i18n/literals/uk.json +4 -4
  917. package/app/public/i18n/literals/ur.json +4 -4
  918. package/app/public/i18n/literals/vi.json +4 -4
  919. package/app/public/i18n/literals/zh-CN.json +1879 -1792
  920. package/app/public/i18n/literals/zh-TW.json +720 -612
  921. package/app/public/providers/mimo-desktop.png +0 -0
  922. package/app/public/providers/stepfun.png +0 -0
  923. package/app/public/providers/xiaomi-tokenplan.png +0 -0
  924. package/app/src/lib/db/adapters/betterSqliteAdapter.js +6 -2
  925. package/app/src/lib/db/migrate.js +5 -2
  926. package/app/src/lib/oauth/xiaomiIdentity.js +50 -41
  927. package/app/src/lib/updater/updater.js +95 -5
  928. package/app/src/mitm/server.js +14 -14
  929. package/app/src/sse/services/qoderCheckin.js +32 -4
  930. package/cli.js +100 -10
  931. package/hooks/postinstall.js +11 -1
  932. package/hooks/sqliteRuntime.js +27 -9
  933. package/hooks/trayRuntime.js +5 -2
  934. package/package.json +11 -2
  935. package/src/cli/api/client.js +9 -2
  936. package/src/cli/doctor.js +525 -0
  937. package/src/cli/i18n/locales/en/core.json +42 -2
  938. package/src/cli/i18n/locales/en/settings.json +3 -3
  939. package/src/cli/i18n/locales/zh-CN/core.json +42 -2
  940. package/src/cli/i18n/locales/zh-CN/settings.json +3 -3
  941. package/src/cli/i18n/locales/zh-TW/core.json +42 -2
  942. package/src/cli/i18n/locales/zh-TW/settings.json +3 -3
  943. package/src/cli/menus/settings.js +27 -9
  944. package/src/cli/staleServer.js +216 -0
  945. package/app/.next-cli-build/server/chunks/1260.js +0 -1
  946. package/app/.next-cli-build/server/chunks/1281.js +0 -1
  947. package/app/.next-cli-build/server/chunks/1377.js +0 -1
  948. package/app/.next-cli-build/server/chunks/2179.js +0 -1
  949. package/app/.next-cli-build/server/chunks/3007.js +0 -1
  950. package/app/.next-cli-build/server/chunks/3662.js +0 -1
  951. package/app/.next-cli-build/server/chunks/3962.js +0 -1
  952. package/app/.next-cli-build/server/chunks/4037.js +0 -1
  953. package/app/.next-cli-build/server/chunks/4055.js +0 -9
  954. package/app/.next-cli-build/server/chunks/4862.js +0 -1
  955. package/app/.next-cli-build/server/chunks/4985.js +0 -1
  956. package/app/.next-cli-build/server/chunks/5217.js +0 -9
  957. package/app/.next-cli-build/server/chunks/6212.js +0 -1
  958. package/app/.next-cli-build/server/chunks/6360.js +0 -1
  959. package/app/.next-cli-build/server/chunks/6520.js +0 -1
  960. package/app/.next-cli-build/server/chunks/6871.js +0 -1
  961. package/app/.next-cli-build/server/chunks/7180.js +0 -6
  962. package/app/.next-cli-build/server/chunks/8145.js +0 -1
  963. package/app/.next-cli-build/server/chunks/8546.js +0 -1
  964. package/app/.next-cli-build/server/chunks/8635.js +0 -7
  965. package/app/.next-cli-build/server/chunks/8910.js +0 -2
  966. package/app/.next-cli-build/server/chunks/8990.js +0 -1
  967. package/app/.next-cli-build/server/chunks/9251.js +0 -1
  968. package/app/.next-cli-build/server/chunks/9713.js +0 -1
  969. package/app/.next-cli-build/server/chunks/9896.js +0 -1
  970. package/app/.next-cli-build/static/chunks/1243-220f1fd87235cb92.js +0 -3
  971. package/app/.next-cli-build/static/chunks/1321-3c120e93be69e929.js +0 -1
  972. package/app/.next-cli-build/static/chunks/5497-6254f96ca64b6030.js +0 -7
  973. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-395c2359af9bc2a9.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-b0d4fedb7b84fe8a.js +0 -59
  975. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-502e7efb917191b9.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-720b5ab2e46fc6bb.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-4b4f1e8dd8aa7e92.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-6550d226457d7487.js +0 -14
  979. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-5038d14b38d853a5.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-5f5434b22c7f7b73.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2650e9a5b8e872ce.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-27bf96f0f2568f09.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/_global-error/page-dc2c34db3b327370.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-dc2c34db3b327370.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-dc2c34db3b327370.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-dc2c34db3b327370.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-dc2c34db3b327370.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-dc2c34db3b327370.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-dc2c34db3b327370.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-dc2c34db3b327370.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-dc2c34db3b327370.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-dc2c34db3b327370.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-dc2c34db3b327370.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-dc2c34db3b327370.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/auth/verify-password/route-dc2c34db3b327370.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-dc2c34db3b327370.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-dc2c34db3b327370.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-dc2c34db3b327370.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-dc2c34db3b327370.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-dc2c34db3b327370.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-dc2c34db3b327370.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-dc2c34db3b327370.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-dc2c34db3b327370.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-dc2c34db3b327370.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-dc2c34db3b327370.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-dc2c34db3b327370.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-dc2c34db3b327370.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-dc2c34db3b327370.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-dc2c34db3b327370.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-dc2c34db3b327370.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-dc2c34db3b327370.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-dc2c34db3b327370.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-dc2c34db3b327370.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-dc2c34db3b327370.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-dc2c34db3b327370.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/combos/route-dc2c34db3b327370.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-dc2c34db3b327370.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-dc2c34db3b327370.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-dc2c34db3b327370.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-dc2c34db3b327370.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-dc2c34db3b327370.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-dc2c34db3b327370.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/health/route-dc2c34db3b327370.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/init/route-dc2c34db3b327370.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-dc2c34db3b327370.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/keys/rotate/route-dc2c34db3b327370.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/keys/route-dc2c34db3b327370.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/locale/route-dc2c34db3b327370.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-dc2c34db3b327370.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-dc2c34db3b327370.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-dc2c34db3b327370.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-dc2c34db3b327370.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-dc2c34db3b327370.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-dc2c34db3b327370.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-dc2c34db3b327370.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-dc2c34db3b327370.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-dc2c34db3b327370.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/api/models/caps/route-dc2c34db3b327370.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/api/models/custom/bulk/route-dc2c34db3b327370.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-dc2c34db3b327370.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-dc2c34db3b327370.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/api/models/route-dc2c34db3b327370.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/api/models/test/route-dc2c34db3b327370.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/api/network/egress-region/route-dc2c34db3b327370.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-dc2c34db3b327370.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-dc2c34db3b327370.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/checkin/route-dc2c34db3b327370.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-dc2c34db3b327370.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-dc2c34db3b327370.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-dc2c34db3b327370.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-dc2c34db3b327370.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-dc2c34db3b327370.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-dc2c34db3b327370.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-dc2c34db3b327370.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-dc2c34db3b327370.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-dc2c34db3b327370.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-dc2c34db3b327370.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-dc2c34db3b327370.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-dc2c34db3b327370.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-dc2c34db3b327370.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder/checkin/route-dc2c34db3b327370.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder-cn/checkin/route-dc2c34db3b327370.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/export/route-dc2c34db3b327370.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/import/route-dc2c34db3b327370.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-dc2c34db3b327370.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-dc2c34db3b327370.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/pricing/route-dc2c34db3b327370.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-dc2c34db3b327370.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-dc2c34db3b327370.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-dc2c34db3b327370.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-dc2c34db3b327370.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-dc2c34db3b327370.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-dc2c34db3b327370.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-dc2c34db3b327370.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-dc2c34db3b327370.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-dc2c34db3b327370.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/providers/route-dc2c34db3b327370.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-dc2c34db3b327370.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-dc2c34db3b327370.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-dc2c34db3b327370.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-dc2c34db3b327370.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-dc2c34db3b327370.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-dc2c34db3b327370.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-dc2c34db3b327370.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-dc2c34db3b327370.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-dc2c34db3b327370.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-dc2c34db3b327370.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-dc2c34db3b327370.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-dc2c34db3b327370.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-dc2c34db3b327370.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-dc2c34db3b327370.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-dc2c34db3b327370.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-dc2c34db3b327370.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-dc2c34db3b327370.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-dc2c34db3b327370.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-dc2c34db3b327370.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-dc2c34db3b327370.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-dc2c34db3b327370.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/settings/route-dc2c34db3b327370.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-dc2c34db3b327370.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/tags/route-dc2c34db3b327370.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-dc2c34db3b327370.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-dc2c34db3b327370.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-dc2c34db3b327370.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-dc2c34db3b327370.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-dc2c34db3b327370.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-dc2c34db3b327370.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-dc2c34db3b327370.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-dc2c34db3b327370.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-dc2c34db3b327370.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-dc2c34db3b327370.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-dc2c34db3b327370.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-dc2c34db3b327370.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-dc2c34db3b327370.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-dc2c34db3b327370.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-dc2c34db3b327370.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-dc2c34db3b327370.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/usage/dashboard/route-dc2c34db3b327370.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-dc2c34db3b327370.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-dc2c34db3b327370.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-dc2c34db3b327370.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-dc2c34db3b327370.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-dc2c34db3b327370.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-dc2c34db3b327370.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-dc2c34db3b327370.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-dc2c34db3b327370.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-dc2c34db3b327370.js +0 -1
  1128. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-dc2c34db3b327370.js +0 -1
  1129. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-dc2c34db3b327370.js +0 -1
  1130. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-dc2c34db3b327370.js +0 -1
  1131. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-dc2c34db3b327370.js +0 -1
  1132. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-dc2c34db3b327370.js +0 -1
  1133. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-dc2c34db3b327370.js +0 -1
  1134. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-dc2c34db3b327370.js +0 -1
  1135. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-dc2c34db3b327370.js +0 -1
  1136. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-dc2c34db3b327370.js +0 -1
  1137. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-dc2c34db3b327370.js +0 -1
  1138. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-dc2c34db3b327370.js +0 -1
  1139. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-dc2c34db3b327370.js +0 -1
  1140. package/app/.next-cli-build/static/chunks/app/api/v1/route-dc2c34db3b327370.js +0 -1
  1141. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-dc2c34db3b327370.js +0 -1
  1142. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-dc2c34db3b327370.js +0 -1
  1143. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-dc2c34db3b327370.js +0 -1
  1144. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-dc2c34db3b327370.js +0 -1
  1145. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-dc2c34db3b327370.js +0 -1
  1146. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-dc2c34db3b327370.js +0 -1
  1147. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-dc2c34db3b327370.js +0 -1
  1148. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-dc2c34db3b327370.js +0 -1
  1149. package/app/.next-cli-build/static/chunks/app/api/version/route-dc2c34db3b327370.js +0 -1
  1150. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-dc2c34db3b327370.js +0 -1
  1151. package/app/.next-cli-build/static/chunks/app/api/version/update/route-dc2c34db3b327370.js +0 -1
  1152. package/app/.next-cli-build/static/chunks/app/landing/page-3c92a951f3cc5eee.js +0 -1
  1153. package/app/.next-cli-build/static/chunks/app/layout-034acae46f56c420.js +0 -1
  1154. package/app/.next-cli-build/static/chunks/app/login/page-0da5fcc5d841cbb9.js +0 -1
  1155. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-dc2c34db3b327370.js +0 -1
  1156. package/app/.next-cli-build/static/chunks/app/page-dc2c34db3b327370.js +0 -1
  1157. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-dc2c34db3b327370.js +0 -1
  1158. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-dc2c34db3b327370.js +0 -1
  1159. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-dc2c34db3b327370.js +0 -1
  1160. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-dc2c34db3b327370.js +0 -1
  1161. package/app/.next-cli-build/static/css/822bb46e0ce1f8af.css +0 -1
  1162. package/app/.next-cli-build/static/css/8f9ac5a7bd3a79e5.css +0 -1
  1163. package/app/.next-cli-build/static/ywoOd9C5swOj24BZAUkYk/_buildManifest.js +0 -1
  1164. /package/app/.next-cli-build/static/{ywoOd9C5swOj24BZAUkYk → Qmgbf1CsCnKFbpB4QvL8M}/_ssgManifest.js +0 -0
@@ -1,14 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{33229:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>ei});var s=i(95155),l=i(12115),a=i(73321),n=i(98500),r=i.n(n),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 a=e.timezone||"Asia/Singapore",n=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"),a=s("minute"),n=s("second");if([l,a,n].some(e=>!Number.isFinite(e)))return null;return{hour:l,minute:a,second:n,secondsOfDay:3600*l+60*a+n}}catch{return null}}(a,t);if(!n)return null;let r=n.minute+60*n.hour,o=s<=l?r>=s&&r<l:r>=s||r<l;return i=o?(60*l-n.secondsOfDay+86400)%86400:(60*s-n.secondsOfDay+86400)%86400,{active:o,secondsToBoundary:i,windowLabel:`${e.window_start}–${e.window_end}`,timezone:a}}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,a]=(0,l.useState)(()=>Date.now());(0,l.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let n=h(e,i);if(!n)return null;let r=f(e?.badge,(0,p.kk)()),o=f(e?.description,(0,p.kk)()),d=!Number.isFinite(t=n.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=n.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:[n.windowLabel," ",n.timezone]})]})}var y=i(990),b=i(62630);i(67468);let v=["none","low","medium","high"],j=["none","thinking"],w=["none","low","medium","high","max"],k={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":w,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":v,zai:j,qwen:v,kimi:w,deepseek:["none","high","max"],minimax:j,hunyuan:v,step:v},N=["none","minimal","low","medium","high","xhigh","max"],T=[{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"]},{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 C(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=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!i)return null;let[,s,l]=i,a=Number(s),n=void 0===l?null:Number(l);return a<4||4===a&&(null===n||n<=5||null!==n&&n>=1e3)?null:"output_config"}(t))return null;let i=(0,y.nl)(e,t);if(!i.reasoning)return null;let s=T.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 S=i(11059),$=i(929),A=i(65921);let O=new Map;async function E(e){if(!e?.url||!e?.type)return[];let t=O.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 O.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function P({customModels:e=[],modelAliases:t={},providerAlias:i,builtInModels:s=[],type:l="llm",includeLegacyAliases:a=!0}){let n=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||n.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(!a)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||n.has(t)||r.has(i)||(r.add(i),o.push({id:t,alias:e,fullModel:i,source:"legacyAlias",type:l||"llm"}))}return o}let I=/https:\/\/accounts\.google\.com\/signin\/continue[^\s"'<>)\]]+/;function D(e){if("string"!=typeof e)return null;let t=I.exec(e);return t?t[0]:null}function R(e,t){return(0,p.Tl)(e).replace("{n}",String(t))}function q(e){if(!e||"string"!=typeof e)return e??"";let t=(0,p.Tl)(e);if(t&&t!==e)return t;if(/Individual quota reached|QUOTA_EXHAUSTED|RESOURCE_EXHAUSTED/i.test(e)){let t,i,s,l,a,n,r,o,{delay:d,timestamp:c}=(t=String(e||""),i=null,s=null,l=/"quotaResetDelay"\s*:\s*"([^"]+)"/.exec(t),a=/\bResets in\s+([0-9hms.]+)/i.exec(t),i=l&&l[1]||a&&a[1]||null,n=/"quotaResetTimeStamp"\s*:\s*"([^"]+)"/.exec(t),r=/"quotaResetTimeStamp"\s*:\s*(".*?"|\S+)/.exec(t),(s=n&&n[1]||r&&r[1]||null)&&(s=s.replace(/^"|"$/g,"")),{delay:i,timestamp:s}),u=function(e){if(!e)return"";let{h:t,m:i,s}=e;s>=60&&(i+=Math.floor(s/60),s%=60),i>=60&&(t+=Math.floor(i/60),i%=60);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(" ")}((o=/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?$/i.exec(String(d||"").trim()))&&(o[1]||o[2]||o[3])?{h:Math.floor(parseFloat(o[1]||0)),m:Math.floor(parseFloat(o[2]||0)),s:Math.round(parseFloat(o[3]||0))}:null),m=c?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()}}(c):"",x=(0,p.Tl)("Individual quota reached. Resets at {time} (in {duration}).");return(x=x.replace("{time}",m||(0,p.Tl)("shortly"))).replace("{duration}",u||(0,p.Tl)("a short while"))}return t}var M=i(14051),_=i.n(M);let z=e=>{let t=Number(String(e).trim());return Number.isFinite(t)&&t>0?Math.floor(t):null};function U({caps:e,pinned:t,onSave:i}){let[a,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(""),[u,m]=(0,l.useState)("");(0,l.useEffect)(()=>{a&&(c(e?.contextWindow?String(e.contextWindow):""),m(e?.maxOutput?String(e.maxOutput):""))},[a]);let x=async e=>{o(!0);try{await i(e?{contextWindow:null,maxOutput:null}:{contextWindow:z(d),maxOutput:z(u)}),n(!1)}finally{o(!1)}};return(0,s.jsxs)("div",{className:"relative shrink-0",children:[(0,s.jsx)("button",{onClick:()=>n(e=>!e),className:`rounded p-0.5 transition-colors hover:bg-sidebar ${t?"text-primary":"text-text-muted hover:text-primary"}`,title:(0,p.Tl)("Context window"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"tune"})}),a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-20",onClick:()=>n(!1)}),(0,s.jsxs)("div",{className:"absolute right-0 top-6 z-30 flex w-60 flex-col gap-2 rounded-lg border border-border bg-background p-3 text-xs shadow-lg",children:[(0,s.jsxs)("label",{className:"flex flex-col gap-1 text-text-muted",children:[(0,p.Tl)("Context window"),(0,s.jsx)("input",{type:"number",min:"1",step:"1",value:d,onChange:e=>c(e.target.value),placeholder:"e.g. 200000",className:"rounded border border-border bg-sidebar px-2 py-1 text-text focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("label",{className:"flex flex-col gap-1 text-text-muted",children:[(0,p.Tl)("Max output"),(0,s.jsx)("input",{type:"number",min:"1",step:"1",value:u,onChange:e=>m(e.target.value),placeholder:"e.g. 8192",className:"rounded border border-border bg-sidebar px-2 py-1 text-text focus:outline-none focus:border-primary"})]}),(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",children:[(0,s.jsx)("button",{className:"rounded px-2 py-1 text-text-muted hover:text-red-500 disabled:opacity-40",onClick:()=>x(!0),disabled:r||!t,children:(0,p.Tl)("Clear")}),(0,s.jsx)("button",{className:"rounded bg-primary px-2.5 py-1 text-white disabled:opacity-50",onClick:()=>x(!1),disabled:r,children:(0,p.Tl)("Save")})]})]})]})]})}function F({model:e,fullModel:t,alias:i,copied:a,onCopy:n,testStatus:r,isCustom:o,isFree:d,onDeleteAlias:u,onTest:m,isTesting:x,onDisable:g,onEnable:y,caps:b,thinkingSuffix:v,onSaveCaps:j,capsPinned:w}){let k=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}(),N=v?`${t}(${v})`:t,T="number"==typeof e.rateMultiplier?e.rateMultiplier:null,C=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}(k,e.nightFree),S=null!==T&&T>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),$=S?0:T,A=C||0===$,O=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),E="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:E?{color:E}: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:N}),(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}),(null!==$||C)&&(0,s.jsx)(c.m_,{text:C?`${(0,p.Tl)("Night-free window")} (23:00–08:00) — ${(0,p.Tl)("rides the free quota")}`:S?(0,p.Tl)("Credit multiplier")+`: ${T}x — `+(0,p.Tl)("promo free until")+` ${e.promoFreeUntil}`:0===$?(0,p.Tl)("Credit multiplier")+": 0x — "+(0,p.Tl)("rides the free quota"):(0,p.Tl)("Credit multiplier")+`: ${$}x`,children:(0,s.jsx)(c.Ex,{size:"sm",variant:A?"success":"default",className:`shrink-0 cursor-help leading-none${A?"":" font-mono"}`,children:A?"free":`${$.toFixed(2)}x`})}),O&&(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)()),`${O.windowLabel} ${O.timezone}${O.active?` — ${(0,p.Tl)("active now")}`:""}`].filter(Boolean).join(" \xb7 "),children:(0,s.jsx)(c.Ex,{size:"sm",variant:O.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"})})})]})]}),j&&(0,s.jsx)(U,{caps:b,pinned:w,onSave:j}),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:()=>n(N,`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:a===`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:a===`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 K({modelId:e,fullModel:t,copied:i,onCopy:l,onDeleteAlias:a,onToggle:n,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"})]})]})]}),n&&(0,s.jsx)("button",{onClick:n,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:a,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 J({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,customModels:a,copied:n,onCopy:r,onDeleteAlias:o,onAddCustomModel:d,onToggleCustomModel:u,onDeleteCustomModel:m,onBulkCustomModels:x,connections:h,isAnthropic:f}){let g=(0,A.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)}}},O=P({customModels:a,modelAliases:i,providerAlias:e,type:"llm"}),E=O.filter(e=>!1!==e.enabled),I=O.filter(e=>!1===e.enabled),D=async()=>{if(!y.trim()||v)return;let e=y.trim();if(O.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&&(O.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)}}},q=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&&D(),placeholder:f?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:D,disabled:!y.trim()||v,children:v?"Adding...":"Add"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:R,disabled:!q||w,children:w?"Importing...":"Import from /models"})]}),!q&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),O.length>0&&x&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,s.jsxs)("span",{children:[O.length," custom model",O.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:a})=>(0,s.jsx)(K,{modelId:i,fullModel:`${t}/${i}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===a?m(i):o(l),onToggle:"custom"===a&&u?()=>u(i,!1):void 0,onTest:h.length>0?()=>$(i):void 0,testStatus:C[i],isTesting:N===i},`${a}-${e}/${i}`))}),I.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):"}),I.map(({id:i,alias:l,source:a})=>(0,s.jsx)(K,{modelId:i,fullModel:`${t}/${i}`,copied:n,onCopy:r,enabled:!1,onDeleteAlias:()=>"custom"===a?m(i):o(l),onToggle:"custom"===a&&u?()=>u(i,!0):void 0,onTest:h.length>0?()=>$(i):void 0,testStatus:C[i],isTesting:N===i},`disabled-${a}-${e}/${i}`))]})]})}F.propTypes={model:_().shape({id:_().string.isRequired,rateMultiplier:_().number,promotion:_().object,nightFree:_().shape({from:_().number,to:_().number})}).isRequired,fullModel:_().string.isRequired,alias:_().string,copied:_().string,onCopy:_().func.isRequired,testStatus:_().oneOf(["ok","error"]),isCustom:_().bool,isFree:_().bool,onDeleteAlias:_().func,onTest:_().func,isTesting:_().bool,onDisable:_().func,onEnable:_().func,caps:_().object,thinkingSuffix:_().string,onSaveCaps:_().func,capsPinned:_().bool},_().string.isRequired,_().string.isRequired,_().string,_().func.isRequired,_().func.isRequired,_().func,_().oneOf(["ok","error"]),_().bool,_().string.isRequired,_().object.isRequired,_().arrayOf(_().object),_().string,_().func.isRequired,_().func.isRequired,_().func.isRequired,_().func.isRequired,J.propTypes={providerStorageAlias:_().string.isRequired,providerDisplayAlias:_().string.isRequired,modelAliases:_().object.isRequired,customModels:_().arrayOf(_().object),copied:_().string,onCopy:_().func.isRequired,onDeleteAlias:_().func.isRequired,onAddCustomModel:_().func.isRequired,onBulkCustomModels:_().func,onToggleCustomModel:_().func,onDeleteCustomModel:_().func.isRequired,connections:_().arrayOf(_().shape({id:_().string,isActive:_().bool})).isRequired,isAnthropic:_().bool};var L=i(70217);function W({until:e,inline:t=!1}){let[i,a]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let i=Math.floor(t/1e3);if(i<60)a(`${i}s`);else if(i<3600)a(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);a(`${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 B({connection:e,proxyPools:t,isOAuth:i,isFirst:a,isLast:n,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=new Map((t||[]).map(e=>[e.id,e])),k=e.providerSpecificData?.proxyPoolId||null,N=k?w.get(k):null,T=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!k||T,$=N?`Pool: ${N.name}`:k?`Pool: ${k} (inactive/missing)`:T?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=f?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",O="";if(N?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=N?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);O=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{O=t}}let E=N?.noProxy||e.providerSpecificData?.connectionNoProxy||"",P="default";N?.isActive===!0?P="success":(k||T)&&(P="error"),(0,l.useEffect)(()=>{if(!g)return;let e=e=>{j.current&&!j.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let I=async e=>{v(!0);try{await u("__none__"===e?null:e)}finally{v(!1),y(!1)}},R=e.authType||(i?"oauth":"apikey"),M="oauth"===R,_="cookie"===R,z=e.providerSpecificData?.authMethod,U="string"==typeof e.accessToken?e.accessToken:"",F=e.hasDesktopSession??!!e.providerSpecificData?.mimoPassToken,K=e.hasAccessToken??(U.length>0&&!U.startsWith("mimo-desktop-session")),J="desktop-session"===z||F&&!K,H=F&&K,V=!H&&!J&&"oauth"===z,G=J||H?(0,p.Tl)("Desktop Session"):V?(0,p.Tl)("Browser sign-in"):M?"OAuth":_?"Cookie":"API Key",Q=H?(0,p.Tl)("Browser sign-in"):null,Z=e.providerSpecificData?.mimoUserId||e.providerSpecificData?.uid||null,X=("xiaomi-mimo"===e.provider||"xiaomi-tokenplan"===e.provider)&&Z?`MiMo ${Z}`:null,Y=e.name?.trim()||X||e.email?.trim()||e.displayName?.trim()||(M?"OAuth Account":_?"Cookie Account":"API Key"),ee=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()||X&&e.email?.trim()&&e.email.trim()!==X?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[et,ei]=(0,l.useState)(!1),es=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{ei(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let i=es?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[es]);let el="unavailable"!==e.testStatus||et?e.testStatus:"active",ea=!1!==e.isActive?D(e.lastError):null,{copied:en,copy:er}=(0,S.C)(),eo=()=>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: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_up"})}),(0,s.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,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:F?"computer":V?"login":_?"cookie":M?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:Y}),ee&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:ee}),(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,L.g)(e.isActive,el),size:"sm",dot:!0,children:!1===e.isActive?(0,p.Tl)("disabled"):el||(0,p.Tl)("Unknown")}),(0,s.jsx)(c.Ex,{variant:"default",size:"sm",children:G}),Q&&(0,s.jsx)(c.Ex,{variant:"default",size:"sm",children:Q}),C&&(0,s.jsx)(c.Ex,{variant:P,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?`${s}d`:new Date(e).toLocaleDateString()}(e.earliestPackageExpiry)]}),et&&!1!==e.isActive&&!e.lastError&&(0,s.jsx)(W,{until:es}),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:q(e.lastError),children:[et&&(0,s.jsx)(W,{until:es,inline:!0}),q(e.lastError)]}),ea&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:ea,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)("Verify your account")}),(0,s.jsx)("button",{type:"button",onClick:()=>er(ea,"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"===en?"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]}),eo()&&(0,s.jsx)(c.Ex,{variant:h?"success"===h.state?"success":"failed"===h.state?"error":"testing"===h.state?"primary":"default":"default",size:"sm",children:eo()})]}),C&&(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:$,children:$}),O&&(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:O}),E&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(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",{className:"relative",ref:j,children:[(0,s.jsxs)("button",{onClick:()=>y(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled: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&&(0,s.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,s.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!k?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>I(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),f&&(0,s.jsx)(c.m_,{text:A,children:(0,s.jsxs)("button",{onClick:()=>f.onToggle(!f.on),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.on?"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"})]})]})}W.propTypes={until:_().string.isRequired,inline:_().bool},B.propTypes={connection:_().shape({id:_().string,name:_().string,email:_().string,displayName:_().string,modelLockUntil:_().string,testStatus:_().string,isActive:_().bool,lastError:_().string,priority:_().number,globalPriority:_().number}).isRequired,proxyPools:_().arrayOf(_().shape({id:_().string,name:_().string,proxyUrl:_().string,noProxy:_().string,isActive:_().bool})),isOAuth:_().bool.isRequired,isFirst:_().bool.isRequired,isLast:_().bool.isRequired,onMoveUp:_().func.isRequired,onMoveDown:_().func.isRequired,onToggleActive:_().func.isRequired,onUpdateProxy:_().func,onEdit:_().func.isRequired,onDelete:_().func.isRequired,oneByOneStatus:_().shape({state:_().string,error:_().string}),autoPing:_().shape({on:_().bool,onToggle:_().func,provider:_().string})};let H=`name1|sk-key1
2
- name2|sk-key2
3
- sk-key-only-auto-named`;function V({isOpen:e,provider:t,providerName:i,isCompatible:a,isAnthropic:n,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,I]=(0,l.useState)({accountId:""}),[D,R]=(0,l.useState)(S),[q,M]=(0,l.useState)(!1),[_,z]=(0,l.useState)(null),[U,F]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(e&&C&&!q){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),z({country:i.country||i.countryCode,regionId:s}))}).catch(()=>{}),()=>{e=!1}}},[e,t,C,q]);let[K,J]=(0,l.useState)(null),[L,W]=(0,l.useState)(null),[B,G]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(!1),X=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`:H,[Y,ee]=(0,l.useState)("single"),[et,ei]=(0,l.useState)(""),[es,el]=(0,l.useState)(null),ea=()=>v&&$.ollamaHostUrl.trim()?{baseUrl:$.ollamaHostUrl.trim()}:N?{azureEndpoint:O.azureEndpoint,apiVersion:O.apiVersion,deployment:O.deployment,organization:O.organization}:T?{accountId:P.accountId}:C&&D?{region:D}:void 0,en=async()=>{F(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ea()})}),i=await e.json();J(i.valid?"success":"failed"),W(i.valid?null:i.error||null),G(!!i.maintenance)}catch{J("failed"),W(null),G(!1)}finally{F(!1)}},er=async()=>{if(t&&(v||$.apiKey)&&(v||$.name)&&(!a||$.defaultModel.trim())){Z(!0);try{let e=!1;try{F(!0),J(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ea()})});e=!!(await i.json()).valid,J(e?"success":"failed")}catch{J("failed")}finally{F(!1)}await f({name:$.name||(v?"Ollama Local":""),apiKey:$.apiKey,defaultModel:a?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===b?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:ea()})}finally{Z(!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():"")),a=[];for(let t of e){let e,i="string"==typeof t?t.trim():"";if(!i)continue;let n=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(!n||!n.apiKey)continue;let r=n.baseName,o=1;for(;e=`${r} ${o}`,l.has(e.toLowerCase());)o+=1;l.add(e.toLowerCase());let d={name:e,apiKey:n.apiKey,skipped:!1};n.providerSpecificData&&(d.providerSpecificData=n.providerSpecificData),a.push(d)}return a}(e,h,{isCloudflareAi:T});if(!i.length)return;Z(!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++}Z(!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"===Y?"primary":"ghost",onClick:()=>{ee("single"),el(null)},children:"Single"}),(0,s.jsx)(c.$n,{size:"sm",variant:"bulk"===Y?"primary":"ghost",onClick:()=>{ee("bulk"),el(null)},children:"Bulk Add"})]}),"bulk"===Y&&(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:X,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:Q||!et.trim(),children:Q?"Adding...":"Add All Keys"}),(0,s.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===Y&&(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:en,disabled:U||Q,variant:"secondary",children:U?"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:en,disabled:!$.apiKey||U||Q,variant:"secondary",children:U?"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:D,onChange:e=>{R(e.target.value),M(!0)},options:C.map(e=>({value:e.id,label:e.label}))}),_&&!q&&(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}",_.country)})]})]}),a&&(0,s.jsx)(c.pd,{label:"Default Model",value:$.defaultModel,onChange:e=>A({...$,defaultModel:e.target.value}),placeholder:n?"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"}),")."]}),K&&(0,s.jsx)(c.Ex,{variant:"success"===K?"success":B?"warning":"error",children:"success"===K?"Valid":B?"Check endpoint":"Invalid"}),B&&L&&(0,s.jsx)("p",{className:"text-xs text-amber-500 break-words",children:L}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),a&&(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=>I({...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:Q||!v&&(!$.name||!$.apiKey)||a&&!$.defaultModel.trim()||N&&(!O.azureEndpoint||!O.deployment||!O.organization)||T&&!P.accountId,children:Q?"Saving...":"Save"}),(0,s.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function G({isOpen:e,node:t,onSave:i,onClose:a,isAnthropic:n}){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||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,n]);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};n||(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:n?"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 ${n?"Anthropic":"OpenAI"} Compatible`,onClose:a,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:`${n?"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:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(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:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,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:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function Q({isOpen:e,providerAlias:t,providerDisplayAlias:i,onSave:a,onClose:n}){let[r,o]=(0,l.useState)(""),[d,u]=(0,l.useState)(null),[m,p]=(0,l.useState)(""),[x,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)(""),[y,b]=(0,l.useState)("");(0,l.useEffect)(()=>{e&&(o(""),u(null),p(""),g(""),b(""))},[e]);let v=e=>{let i=`${t}/`;return e.startsWith(i)?e.slice(i.length):e},j=async()=>{let e=v(r.trim());if(e){u("testing"),p("");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"),p(s.error||"")}catch(e){u("error"),p(e.message)}}},w=async()=>{let e=v(r.trim());if(!e||x)return;h(!0);let t=e=>{let t=Number(String(e).trim());return Number.isFinite(t)&&t>0?Math.floor(t):void 0},i={contextWindow:t(f),maxOutput:t(y)};try{await a(e,i)}finally{h(!1)}};return(0,s.jsx)(c.aF,{isOpen:e,onClose:n,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),p("")},onKeyDown:e=>{"Enter"===e.key&&j()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,s.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===d,onClick:j,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:v(r.trim())||"model-id"})]})]}),"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:m||"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:f,onChange:e=>g(e.target.value),placeholder:"e.g. 200000",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background 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:y,onChange:e=>b(e.target.value),placeholder:"e.g. 8192",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(c.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(c.$n,{onClick:w,fullWidth:!0,size:"sm",disabled:!r.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}V.propTypes={isOpen:_().bool.isRequired,provider:_().string,providerName:_().string,isCompatible:_().bool,isAnthropic:_().bool,authType:_().string,authHint:_().string,website:_().string,proxyPools:_().arrayOf(_().shape({id:_().string,name:_().string})),error:_().string,existingNames:_().arrayOf(_().string),onSave:_().func.isRequired,onBulkDone:_().func,onClose:_().func.isRequired},G.propTypes={isOpen:_().bool.isRequired,node:_().shape({id:_().string,name:_().string,prefix:_().string,apiType:_().string,baseUrl:_().string}),onSave:_().func.isRequired,onClose:_().func.isRequired,isAnthropic:_().bool},Q.propTypes={isOpen:_().bool.isRequired,providerAlias:_().string.isRequired,providerDisplayAlias:_().string.isRequired,onSave:_().func.isRequired,onClose:_().func.isRequired};let Z=`[
8
- {
9
- "accessToken": "eyJhbGc...",
10
- "refreshToken": "rt_...",
11
- "idToken": "eyJhbGc...",
12
- "email": "user@example.com"
13
- }
14
- ]`;function X({isOpen:e,onClose:t,onSuccess:i}){let[a,n]=(0,l.useState)(""),[r,o]=(0,l.useState)(!1),[d,u]=(0,l.useState)(""),[m,x]=(0,l.useState)(null),h=()=>{r||(n(""),u(""),x(null),t())},f=async()=>{var e;let t;u(""),x(null);let s=a.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:Z,value:a,onChange:e=>n(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||!a.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 Y({isOpen:e,onClose:t,onSuccess:i,password:a=""}){let[n,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=n.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",...a?{"x-9r-password":a}:{}},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:n,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||!n.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 ee({isOpen:e,mode:t,provider:i,providerName:a,dashboardPassword:n,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-9r-password":n||""},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"})),a=document.createElement("a");a.href=l,a.download=`oauth-${i}-transfer-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(a),a.click(),a.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?.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:a||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.jsx)("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")}`:""]})}),(0,s.jsx)(c.$n,{onClick:E,disabled:h,fullWidth:!0,children:(0,p.Tl)("Import connections")})]})]})})}X.propTypes={isOpen:_().bool.isRequired,onClose:_().func.isRequired,onSuccess:_().func},Y.propTypes={isOpen:_().bool.isRequired,onClose:_().func.isRequired,onSuccess:_().func,password:_().string},ee.propTypes={isOpen:_().bool.isRequired,mode:_().oneOf(["export","import"]).isRequired,provider:_().string.isRequired,providerName:_().string,dashboardPassword:_().string,onClose:_().func.isRequired,onSuccess:_().func};let et={claude:"claudeAutoPing",codex:"codexAutoPing"};function ei(){let e,t,i,n,x,h,f,y,b=(0,a.useParams)(),v=(0,a.useRouter)(),j=b.id,{getCaps:w,overrides:k,refresh:N}=(0,$.y)(),T=(0,A.i)(),[O,I]=(0,l.useState)([]),[R,M]=(0,l.useState)(!0),[_,z]=(0,l.useState)(null),[U,K]=(0,l.useState)([]),[L,W]=(0,l.useState)(!1),[H,Z]=(0,l.useState)(!1),[ei,es]=(0,l.useState)(!1),[el,ea]=(0,l.useState)(!1),[en,er]=(0,l.useState)(""),[eo,ed]=(0,l.useState)(!1),[ec,eu]=(0,l.useState)(!1),[em,ep]=(0,l.useState)(!1),[ex,eh]=(0,l.useState)(!1),[ef,eg]=(0,l.useState)(!1),[ey,eb]=(0,l.useState)(null),[ev,ej]=(0,l.useState)({}),[ew,ek]=(0,l.useState)([]),[eN,eT]=(0,l.useState)(!1),[eC,eS]=(0,l.useState)(!1),[e$,eA]=(0,l.useState)(!1),[eO,eE]=(0,l.useState)(!1),[eP,eI]=(0,l.useState)({open:!1,action:null,value:""}),[eD,eR]=(0,l.useState)(!1),[eq,eM]=(0,l.useState)(""),[e_,ez]=(0,l.useState)(""),[eU,eF]=(0,l.useState)(!1),[eK,eJ]=(0,l.useState)({}),[eL,eW]=(0,l.useState)(""),[eB,eH]=(0,l.useState)(()=>new Set),[eV,eG]=(0,l.useState)(!1),[eQ,eZ]=(0,l.useState)([]),[eX,eY]=(0,l.useState)("__none__"),[e0,e1]=(0,l.useState)(!1),[e2,e5]=(0,l.useState)(null),[e3,e4]=(0,l.useState)(""),[e6,e8]=(0,l.useState)(!1),[e7,e9]=(0,l.useState)("auto"),[te,tt]=(0,l.useState)({enabled:!1,connections:{}}),[ti,ts]=(0,l.useState)([]),[tl,ta]=(0,l.useState)(!1),[tn,tr]=(0,l.useState)([]),[to,td]=(0,l.useState)([]),[tc,tu]=(0,l.useState)([]),[tm,tp]=(0,l.useState)(null),[tx,th]=(0,l.useState)(!1),[tf,tg]=(0,l.useState)(!1),[ty,tb]=(0,l.useState)(!1),[tv,tj]=(0,l.useState)(null),[tw,tk]=(0,l.useState)({}),[tN,tT]=(0,l.useState)(null),tC=(0,l.useRef)(!1),[tS,t$]=(0,l.useState)(!1),{copied:tA,copy:tO}=(0,S.C)(),tE="ag_risk_confirmed",tP=()=>{"xiaomi-mimo"===j?Z(!0):W(!0)},tI=()=>{"antigravity"===j&&"true"!==window.localStorage.getItem(tE)?th(!0):tQ?tP():(er(""),ea(!0))},tD=()=>{er(""),ea(!0)},tR=()=>{tQ?tI():tD()},tq=async()=>{if(!eD){eR(!0),eM("");try{let e=await fetch("/api/auth/verify-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:eP.value})});if(!e.ok){let t=await e.json().catch(()=>({}));eM(t?.error||(0,p.Tl)("Invalid password"));return}let{action:t,value:i}=eP;eI({open:!1,action:null,value:""}),"export"===t&&(tJ(i),tF(t),tz(!0))}catch(e){eM(e.message||(0,p.Tl)("Invalid password"))}finally{eR(!1)}}},tM=e=>{ez(""),eI({open:!0,action:e,value:""})},[t_,tz]=(0,l.useState)(!1),[tU,tF]=(0,l.useState)("export"),[tK,tJ]=(0,l.useState)(""),tL=async()=>{eA(!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 T.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,a=i.filter(e=>"failed"===e.status).length;0===a?T.success(`${(0,p.Tl)("Check-in complete")}: ${s} ${(0,p.Tl)("checked-in")}, ${l} ${(0,p.Tl)("already checked in")}`):T.error(`${(0,p.Tl)("Check-in complete with errors")}: ${a} ${(0,p.Tl)("failed")}`)}catch(e){T.error((0,p.Tl)("Check-in failed")+": "+e.message)}finally{eA(!1)}},tW=()=>(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsx)(c.$n,{size:"sm",icon:"calendar_today",onClick:tL,disabled:e$,className:"w-full sm:w-auto",title:(0,p.Tl)("CodeBuddy CN auto-checks in daily (retries all day until confirmed)"),children:e$?(0,p.Tl)("Checking in..."):(0,p.Tl)("Check in now")})}),tB=async()=>{eE(!0);try{let e="qoder-cn"===j?"/api/oauth/qoder-cn/checkin":"/api/oauth/qoder/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 T.warning((0,p.Tl)("No active Qoder connections found"));let l=s.filter(e=>"checked-in"===e.status);s.filter(e=>"already"===e.status);let a=s.filter(e=>"failed"===e.status),n=l.reduce((e,t)=>e+(t.claimedAmount||0),0);l.length>0?T.success(`${(0,p.Tl)("Claim successful")}: +${n} Credits (${l.length} ${(0,p.Tl)("accounts")})`):0===a.length?T.info((0,p.Tl)("Daily credits already claimed for today")):T.error(`${(0,p.Tl)("Claim failed")}: ${a.map(e=>e.error).join(", ")}`)}catch(e){T.error((0,p.Tl)("Claim failed")+": "+e.message)}finally{eE(!1)}},tH=()=>(0,s.jsx)(c.$n,{size:"sm",icon:"redeem",variant:"secondary",onClick:tB,disabled:eO,className:"w-full sm:w-auto",title:(0,p.Tl)("Claim daily activity Credits"),children:eO?(0,p.Tl)("Claiming..."):(0,p.Tl)("Claim Credits")}),tV=_?{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],tG=tV?.authModes||[],tQ=!!u.zN[j]||!!u.IS[j]||tG.includes("oauth"),tZ=!!u.fg[j]||tG.includes("apikey"),tX=!!u.IS[j]?.noAuth,tY="codebuddy-cn"===j,t0=tQ&&tV?.authModes?.includes("oauth")&&eN,t1=tY&&eC,t2=(0,m.KC)(j),t5="qoder"===j||"qoder-cn"===j,t3="qoder"===j||"qoder-cn"===j||"xiaomi-mimo"===j,t4="cursor"===j&&tn.length>0?tn:t5?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);return t?{...e,rateMultiplier:"number"==typeof t.rateMultiplier?t.rateMultiplier:e.rateMultiplier,promotion:t.promotion??e.promotion??null}:e})}(t2,tn):t2,t6=t5&&t4.find(e=>e.promotion)?.promotion||null,t8=(0,u.wG)(j),t7=(0,u.mq)(j),t9=(0,u.gb)(j),ie=t7||t9,it=!ie&&tQ&&tZ,ii="xai"===j?"Grok Build OAuth":"grok-cli"===j?"Grok CLI Device Login":"kimi"===j?"Kimi Coding OAuth":"OAuth",is="xai"===j?"xAI API Key":"kimi"===j?"Kimi API Key":"qoder"===j?"PAT":"API Key",il=e=>{if(!e7||"auto"===e7)return null;let t=C(j,e);return t&&t.includes(e7)?e7:null},ia=ie?j:t8,ir=(()=>{let e=new Set,t=new Set,i=i=>{if(!i||t.has(i))return;t.add(i);let s=C(j,i);s&&s.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of t4)i(e.id);for(let e of to)i(e.id);for(let e of ew)e.providerAlias===ia&&"llm"===(e.kind||e.type||"llm")&&i(e.id);return e.size?["auto",...e]:null})(),io=ie?_?.prefix||j:t8,id=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ia)}`,{cache:"no-store"}),t=await e.json();e.ok&&tu(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[ia]),ic=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ia,ids:[e]})})).ok&&await id()}catch(e){console.log("Error disabling model:",e)}},iu=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ia)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await id()}catch(e){console.log("Error enabling model:",e)}},im=async(e,t)=>{await fetch("/api/models/custom",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ia,id:e,type:"llm",enabled:t})})},ip=async(e,t=[])=>{let i=e.length+t.length;i&&tp({title:"Disable All Models",message:`Disable all ${i} model(s)?`,onConfirm:async()=>{tp(null);try{for(let i of(e.length&&(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ia,ids:e})})).ok&&await id(),t))await im(i,!1);t.length&&await ig()}catch(e){console.log("Error disabling all models:",e)}}})},ix=async(e=[])=>{try{for(let t of((await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ia)}`,{method:"DELETE"})).ok&&await id(),e))await im(t,!0);e.length&&await ig()}catch(e){console.log("Error enabling all models:",e)}},ih=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ej(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),ig=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ek(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&&td(e.models)}).catch(()=>{})},[j]);let iy=(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(),a=await t.json(),n=await i.json(),r=s.ok?await s.json():{};if(e.ok){let e=(l.connections||[]).filter(e=>e.provider===j);I(e)}i.ok&&K(n.proxyPools||[]);let o=(r.providerStrategies||{})[j]||{};e5(o.fallbackStrategy||null),e4(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1"),e8(!0===o.earliestExpiryFirst),eT(!0===r.codeBuddyOAuthImport);let d=(r.providerThinking||{})[j]||{};e9(d.mode||"auto");let c=et[j],u=c&&r[c]||{};if(tt({enabled:!0===u.enabled,connections:u.connections||{}}),t.ok){let e=(a.nodes||[]).find(e=>e.id===j)||null;if(!e&&ie)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}z(e)}}catch(e){console.log("Error fetching connections:",e)}finally{M(!1)}},[j,ie]),ib=(0,l.useCallback)(async()=>{await iy(),await id()},[iy,id]),iv=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&&(z(i.node),await iy(),eh(!1))}catch(e){console.log("Error updating provider node:",e)}},ij=async(e,t,i=e6)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),l=(s.ok?await s.json():{}).providerStrategies||{},a={...l[j]||{}};e?a.fallbackStrategy=e:delete a.fallbackStrategy,"round-robin"===e&&""!==t?a.stickyRoundRobinLimit=Number(t)||3:delete a.stickyRoundRobinLimit,i?a.earliestExpiryFirst=!0:delete a.earliestExpiryFirst;let n={...l};0===Object.keys(a).length?delete n[j]:n[j]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("Error saving provider strategy:",e)}},iw=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)}},ik=async e=>{let t=et[j];if(t){tt(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)(()=>{iy(),ih(),ig(),id()},[iy,ih,ig,id]),(0,l.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(e=>{eT(!0===e.codeBuddyOAuthImport),"boolean"==typeof e.codeBuddyCheckin&&eS(e.codeBuddyCheckin)}).catch(e=>console.log("Error reading settings:",e))},[]),(0,l.useEffect)(()=>{if("cursor"!==j&&!t5)return void tr([]);let e=O.find(e=>!1!==e.isActive);if(!e?.id)return void tr([]);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&&tr(i.models)}).catch(()=>{}),()=>{t=!0}},[j,O]),(0,l.useEffect)(()=>{let e=(u.zN[j]||u.fg[j]||u.IS[j]||u.nJ[j])?.modelsFetcher;e&&E(e).then(ts)},[j]);let iN=async(e,t,i=t8)=>{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 ih();else{let t=await e.json();T.error(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},iT=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ih()}catch(e){console.log("Error deleting alias:",e)}},iC=async(e,t="llm",i=ia,s={},l)=>{try{let a={providerAlias:i,id:e,type:t};if(void 0!==l&&(a.enabled=l),s&&"object"==typeof s)for(let e of["vision","reasoning","contextWindow","maxOutput","thinkingFormat"])void 0!==s[e]&&(a[e]=s[e]);let n=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(n.ok)await ig(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await n.json();T.error(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},iS=e=>!!(k?.[ia]?.[e]||k?.[j]?.[e]),i$=async(e,t)=>{try{let i=await fetch("/api/models/caps",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:ia||j,modelId:e,...t||{}})});if(!i.ok){let e=await i.json().catch(()=>({}));T.error(e?.error||"Failed to save model settings");return}N()}catch(e){console.log("Error saving model caps:",e),T.error("Failed to save model settings")}},iA=async(e,t="llm",i=ia)=>{try{let s=new URLSearchParams({providerAlias:i,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await ig(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},iO=async(e,t,i="llm")=>{try{(await fetch("/api/models/custom",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ia,id:e,type:i,enabled:t})})).ok&&(await ig(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error toggling custom model:",e)}},iE=(e,t="llm")=>{tp({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()=>{tp(null);try{(await fetch("/api/models/custom/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ia,type:t,enabled:e})})).ok&&(await ig(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error bulk-updating custom models:",e)}}})},iP=async()=>{if(tS)return;let e=O.find(e=>!1!==e.isActive);if(!e)return void T.warning("xiaomi-mimo"===j?(0,p.Tl)("Please add an active MiMo connection first"):(0,p.Tl)("Please add an active Qoder connection first"));t$(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),i=await t.json();if(!t.ok)return void T.error(i.error||(0,p.Tl)("Failed to fetch models"));let s=i.models||[];if(0===s.length)return void T.warning((0,p.Tl)("No models returned"));let l=0,a=0;for(let e of s){let t=e.id||e.name;if(!t)continue;if("llm"!==(e.kind||"llm")){a+=1;continue}let i=t.replace(/^qoder(-cn)?\//,"");!s.some(e=>e.id===i)&&(ew.some(e=>e.providerAlias===ia&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(ev).includes(`${ia}/${i}`)||(await iC(i,"llm",ia,{},!1),l+=1))}0===l?T.warning((0,p.Tl)("All models already exist, no new models added")):T.success((0,p.Tl)("Successfully added")+` ${l} `+(0,p.Tl)("models")),a>0&&T.info((0,p.Tl)("Media models skipped (use Media Providers)")+` (${a})`)}catch(e){console.log("Error importing Qoder models:",e),T.error((0,p.Tl)("Error fetching models")+": "+e.message)}finally{t$(!1)}},iI="opencode-go"===j||"bai"===j||"cline"===j,iD=async()=>{if(tl)return;let e=O.find(e=>!1!==e.isActive);if(!e?.id)return void T.warning((0,p.Tl)("Add a connection to enable importing models."));ta(!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);ts(s),T.success(`${(0,p.Tl)("Models refreshed")} (${s.length})`)}catch(e){T.error((0,p.Tl)("Failed to fetch models")+": "+e.message)}finally{ta(!1)}},iR=async()=>{if(tf||0===O.length)return;let e=Object.fromEntries(O.map(e=>[e.id,{state:"queued",error:null}]));tC.current=!1,tg(!0),tb(!1),tj(null),tk(e),tT({total:O.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,i=0;try{for(let e=0;e<O.length;e+=1){if(tC.current){tT({total:O.length,completed:e,passed:t,failed:i,stopped:!0});break}let s=O[e];tj(s.id),tk(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),l=await e.json(),a=!!l.valid;a?t+=1:i+=1,tk(e=>({...e,[s.id]:{state:a?"success":"failed",error:a?null:l.error||null}}))}catch(e){i+=1,tk(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}tT({total:O.length,completed:e+1,passed:t,failed:i,stopped:!1}),e<O.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tj(null),tg(!1),tb(!1),tC.current=!1,iy()}},iq=async e=>{tp({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{tp(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&I(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},iM=()=>{eW(""),eJ({}),tk({}),tT(null),iy(),W(!1)},i_=async e=>{er("");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){eW(""),eJ({}),await ib(),ea(!1);return}er(i?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),er("Failed to save connection")}},iz=async e=>{try{(await fetch(`/api/providers/${ey.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(eW(""),eJ({}),tk({}),tT(null),await iy(),ep(!1))}catch(e){console.log("Error updating connection:",e)}},iU=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&I(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},iF=async(e,t)=>{let i=[...O];[i[e],i[t]]=[i[t],i[e]],I(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 iy()}},iK=O.filter(e=>eQ.includes(e.id)),iJ=O.length>0&&eQ.length===O.length;(0,l.useEffect)(()=>{eZ(e=>e.filter(e=>O.some(t=>t.id===e)))},[O]),(()=>{if(0===iK.length)return;let e=new Set(iK.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let i=U.find(e=>e.id===t);return i?.name}})();let iL=()=>{e0||eg(!1)},iW=async e=>{e1(!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 iy(),eg(!1)}finally{e1(!1)}},iB=e=>iW(O.map(t=>({connectionId:t.id,proxyPoolId:e}))),iH=(0,s.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:O.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,eQ.includes(i)),onChange:()=>{var t;return t=e.id,void eZ(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)(B,{connection:e,proxyPools:U,isOAuth:tQ,isFirst:0===t,isLast:t===O.length-1,onMoveUp:()=>iF(t,t-1),onMoveDown:()=>iF(t,t+1),onToggleActive:t=>iU(e.id,t),autoPing:et[j]&&"oauth"===e.authType?{on:!0===te.connections[e.id],onToggle:t=>{var i;return i=e.id,void ik({...te,connections:{...te.connections,[i]:t}})},provider:j}: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&&I(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:()=>{eb(e),ep(!0)},onDelete:()=>iq(e.id),oneByOneStatus:tw[e.id]||null})})]},e.id)})}),iV=U.filter(e=>!0===e.isActive),iG=(0,s.jsx)(c.aF,{isOpen:ef,onClose:iL,title:`Apply Proxy (${O.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=U.filter(e=>!0===e.isActive);return 0===e.length?void T.warning("No active proxy pools available."):iW(O.map((t,i)=>({connectionId:t.id,proxyPoolId:e[i%e.length].id})))},disabled:e0||0===iV.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:()=>iB(null),disabled:e0,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)"})]}),U.map(e=>(0,s.jsxs)("button",{onClick:()=>iB(e.id),disabled:e0||!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))]}),e0&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(c.$n,{onClick:iL,variant:"ghost",fullWidth:!0,disabled:e0,children:"Cancel"})]})}),iQ=async e=>{if(!eB.has(e)){eH(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:`${ia}/${e}`})}),i=await t.json();eJ(t=>({...t,[e]:i.ok?"ok":"error"})),eW(i.ok?"":i.error||"Model not reachable")}catch{eJ(t=>({...t,[e]:"error"})),eW("Network error")}finally{setTimeout(()=>{iy()},600),eH(t=>{let i=new Set(t);return i.delete(e),i})}}};if(R)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(c.Qv,{}),(0,s.jsx)(c.Qv,{})]});if(!tV)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 iZ=()=>t7&&tV.apiType?"responses"===tV.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":t9?"/providers/anthropic-m.png":(0,d.HY)(tV.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:`${tV.color}15`},children:eU||!iZ()?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:tV.color},children:tV.textIcon||tV.id.slice(0,2).toUpperCase()}):(0,s.jsx)(o.default,{src:iZ(),alt:tV.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tV.id),eF(!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:tV.name}),(tV.notice?.webUrl||tV.notice?.apiKeyUrl||tV.notice?.signupUrl||tV.website)&&(0,s.jsxs)("a",{href:tV.notice?.webUrl||tV.notice?.apiKeyUrl||tV.notice?.signupUrl||tV.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"}),tV.notice?.webUrl?"Web console":tV.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,s.jsx)(c.N5,{code:tV.notice?.inviteCode})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[O.length," connection",1===O.length?"":"s"]})]})]})]}),tV.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:tV.deprecationNotice})]}),tV.notice?.text&&!tV.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)(tV.notice.text)}),tV.notice.apiKeyUrl&&(0,s.jsx)("a",{href:tV.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 →")}),(0,s.jsx)(c.N5,{code:tV.notice?.inviteCode})]}),ie&&_&&(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:t9?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[t9?"Messages API":"responses"===_.apiType?"Responses API":"Chat Completions"," \xb7 ",(_.baseUrl||"").replace(/\/$/,""),"/",t9?"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:()=>{er(""),ea(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>eh(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{tp({title:"Delete Compatible Node",message:`Delete this ${t9?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{tp(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"})]})]})}),tX?(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:[O.length>0&&U.length>0&&(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eg(!0),children:"Apply Proxy"}),O.length>0&&(0,s.jsxs)(s.Fragment,{children:[eQ.length>0&&(0,s.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eQ.length;0!==e&&tp({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{tp(null);let e=0,t=[...eQ];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}I(e=>e.filter(e=>!t.includes(e.id))),eZ([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eQ.length,")"]}),(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:iR,disabled:tf,children:tf?(0,p.Tl)("Testing Connection One-by-One..."):(0,p.Tl)("Test Connection One-by-One")}),tf&&(0,s.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{tf&&(tC.current=!0,tb(!0))},disabled:ty,children:ty?(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 with quota packages that expire soonest"),children:(0,p.Tl)("Earliest Expiry First")}),(0,s.jsx)(c.lM,{checked:e6,onChange:e=>{e8(e),ij(e2,e3,e)}})]}),(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",children:(0,p.Tl)("Round Robin")}),(0,s.jsx)(c.lM,{checked:"round-robin"===e2,onChange:e=>{let t=e?"round-robin":null,i=e?e3||"1":e3;e&&!e3&&e4("1"),e5(t),ij(t,i,e6)}}),"round-robin"===e2&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:(0,p.Tl)("Sticky:")}),(0,s.jsx)("input",{type:"number",min:1,value:e3,onChange:e=>{var t;e4(t=e.target.value),ij("round-robin",t,e6)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===O.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:tQ?"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"}),it&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ii," or ",is,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:it?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tI,children:ii}),(0,s.jsx)(c.$n,{size:"sm",icon:"key",onClick:tD,children:is}),t0&&!t1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tM("export"),children:(0,p.Tl)("Export")}),(0,s.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>{tF("import"),tz(!0)},children:(0,p.Tl)("Import")})]}),t1&&tW()]}):(0,s.jsxs)(s.Fragment,{children:[!ie&&"iflow"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>es(!0),children:"Cookie"}),("qoder"===j||"qoder-cn"===j)&&tH(),"codex"===j&&(0,s.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ed(!0),children:(0,p.Tl)("Bulk Add")}),(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:tR,children:ie?"Add API Key":"iflow"===j?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[tN&&(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:")," ",tN.total]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Completed:")," ",tN.completed]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Passed:")," ",tN.passed]}),(0,s.jsxs)("span",{children:[(0,p.Tl)("Failed:")," ",tN.failed]}),tN.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:(0,p.Tl)("Stopped")}),tf&&tv&&(0,s.jsxs)("span",{children:[(0,p.Tl)("Running:")," ",O.find(e=>e.id===tv)?.name||tv]})]})}),O.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:iJ,onChange:()=>{iJ?eZ([]):eZ(O.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),iH,!ie&&(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:()=>es(!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:()=>ed(!0),title:(0,p.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,p.Tl)("Bulk Add")}),it?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tI,className:"w-full sm:w-auto",children:ii}),(0,s.jsx)(c.$n,{size:"sm",icon:"key",onClick:tD,className:"w-full sm:w-auto",children:is}),t0&&!t1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tM("export"),className:"w-full sm:w-auto",children:(0,p.Tl)("Export")}),(0,s.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>{tF("import"),tz(!0)},className:"w-full sm:w-auto",children:(0,p.Tl)("Import")})]}),t1&&tW(),("qoder"===j||"qoder-cn"===j)&&tH()]}):(0,s.jsx)(c.$n,{size:"sm",icon:"add",onClick:tR,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(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"}),ir&&(0,s.jsx)("select",{value:e7,onChange:e=>{var t;e9(t=e.target.value),iw(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:ir.map(e=>(0,s.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!ie&&(e=[...t4,...to.filter(e=>!t4.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!tc.includes(e)),i=(t=ew.filter(e=>e?.providerAlias===ia&&"llm"===(e.kind||e.type||"llm"))).filter(e=>!1!==e.enabled).map(e=>e.id),n=t.filter(e=>!1===e.enabled).map(e=>e.id),x=tc.length>0||n.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:()=>ix(n),children:"Active All"}),h&&(0,s.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ip(e,i),children:"Disable All"})]}))]}),!!eL&&(f=D(eL),y=function(e){if(!e)return"";let t=q(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)}(eL),(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:()=>tO(f,"verification"),className:"text-text-muted underline hover:text-primary",children:"verification"===tA?(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(ie)return(0,s.jsx)(J,{providerStorageAlias:ia,providerDisplayAlias:io,modelAliases:ev,customModels:ew,copied:tA,onCopy:tO,onSetAlias:iN,onDeleteAlias:iT,onAddCustomModel:(e,t)=>iC(e,"llm",ia,{},t),onToggleCustomModel:iO,onDeleteCustomModel:e=>iA(e,"llm",ia),onBulkCustomModels:iE,connections:O,isAnthropic:t9});let l=[...t4,...to.filter(e=>!t4.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),a=new Set(tc),n=l.filter(e=>!a.has(e.id)),r=l.filter(e=>a.has(e.id)),o=P({customModels:ew,modelAliases:ev,providerAlias:ia,builtInModels:t4,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:[t6&&(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(g,{promotion:t6})}),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:()=>iE(!0),className:"text-primary hover:underline",children:(0,p.Tl)("Enable all")}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>iE(!1),className:"text-text-muted hover:text-red-500 hover:underline",children:(0,p.Tl)("Disable all")})]}),d.map(e=>(0,s.jsx)(F,{model:{id:e.id,name:e.name},fullModel:`${io}/${e.id}`,alias:e.alias,copied:tA,onCopy:tO,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?iA(e.id,"llm",ia):iT(e.alias)},testStatus:eK[e.id],onTest:O.length>0||tX?()=>iQ(e.id):void 0,isTesting:eB.has(e.id),isCustom:!0,isFree:!1,caps:w(`${j}/${e.id}`),onSaveCaps:t=>i$(e.id,t),capsPinned:iS(e.id),thinkingSuffix:il(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${ia}/${e.id}`,i=`${j}/${e.id}`,l=Object.entries(ev).find(([,e])=>e===t||e===i)?.[0];return(0,s.jsx)(F,{model:e,fullModel:`${io}/${e.id}`,alias:l,copied:tA,onCopy:tO,onSetAlias:t=>iN(e.id,t,ia),onDeleteAlias:()=>iT(l),testStatus:eK[e.id],onTest:O.length>0||tX?()=>iQ(e.id):void 0,isTesting:eB.has(e.id),isFree:e.isFree,onDisable:()=>ic(e.id),caps:w(`${j}/${e.id}`),onSaveCaps:t=>i$(e.id,t),capsPinned:iS(e.id),thinkingSuffix:il(e.id)},e.id)}),(0,s.jsxs)("button",{onClick:()=>eG(!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&&O.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:iD,disabled:tl,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:tl?{animation:"spin 1s linear infinite"}:void 0,children:tl?"progress_activity":"download"}),tl?(0,p.Tl)("Importing..."):(0,p.Tl)("Import from /models")]}),t3&&O.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:iP,disabled:tS,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:tS?{animation:"spin 1s linear infinite"}:void 0,children:tS?"progress_activity":"download"}),tS?(0,p.Tl)("Fetching..."):(0,p.Tl)("xiaomi-mimo"===j?"Fetch MiMo Models":"Fetch Qoder Models")]}),iI&&"cline"!==j&&(0,s.jsxs)("button",{onClick:iD,disabled:tl||!O.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:tl?{animation:"spin 1s linear infinite"}:void 0,children:tl?"progress_activity":"refresh"}),tl?(0,p.Tl)("Refreshing..."):(0,p.Tl)("Refresh Official Models")]}),ti.length>0&&(e=new Set([...Object.values(ev),...o.map(e=>e.fullModel)]),t=new Set(t4.map(e=>e.id)),0===(i=ti.filter(i=>!e.has(`${ia}/${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 iC(e.id,"llm",ia)},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)(F,{model:{id:e.id,name:e.name},fullModel:`${io}/${e.id}`,copied:tA,onCopy:tO,testStatus:eK[e.id],onTest:O.length>0||tX?()=>iQ(e.id):void 0,isTesting:eB.has(e.id),onEnable:()=>iO(e.id,!0),isCustom:!1,isFree:!1,caps:w(`${j}/${e.id}`),onSaveCaps:t=>i$(e.id,t),capsPinned:iS(e.id)},`custom-${e.fullModel}`)),r.map(e=>(0,s.jsx)(F,{model:e,fullModel:`${io}/${e.id}`,copied:tA,onCopy:tO,testStatus:eK[e.id],onTest:O.length>0||tX?()=>iQ(e.id):void 0,isTesting:eB.has(e.id),onEnable:()=>iu(e.id),isFree:e.isFree,caps:w(`${j}/${e.id}`),onSaveCaps:t=>i$(e.id,t),capsPinned:iS(e.id),thinkingSuffix:il(e.id)},e.id))]})]})]})})()]}),iG,"kiro"===j?(0,s.jsx)(c.Mh,{isOpen:L,providerInfo:tV,onSuccess:iM,onClose:()=>W(!1)}):"cursor"===j?(0,s.jsx)(c.G9,{isOpen:L,onSuccess:iM,onClose:()=>W(!1)}):"gitlab"===j?(0,s.jsx)(c.vj,{isOpen:L,providerInfo:tV,onSuccess:iM,onClose:()=>W(!1)}):(0,s.jsx)(c.LF,{isOpen:L,provider:j,providerInfo:tV,onSuccess:iM,onClose:()=>W(!1)}),"xiaomi-mimo"===j&&(0,s.jsx)(c.LH,{isOpen:H,onSuccess:iM,onClose:()=>Z(!1)}),"iflow"===j&&(0,s.jsx)(c.vE,{isOpen:ei,onSuccess:()=>{iy(),es(!1)},onClose:()=>es(!1)}),(0,s.jsx)(V,{isOpen:el,provider:j,providerName:tV.name,isCompatible:ie,isAnthropic:t9,authType:tV?.authType,authHint:tV?.authHint,website:tV?.website,proxyPools:U,error:en,existingNames:O.map(e=>e.name).filter(Boolean),onSave:i_,onBulkDone:ib,onClose:()=>{er(""),ea(!1)}}),(0,s.jsx)(c.wI,{isOpen:em,connection:ey,proxyPools:U,onSave:iz,onClose:()=>ep(!1)}),ie&&(0,s.jsx)(G,{isOpen:ex,node:_,onSave:iv,onClose:()=>eh(!1),isAnthropic:t9}),!ie&&(0,s.jsx)(Q,{isOpen:eV,providerAlias:ia,providerDisplayAlias:io,onSave:async(e,t)=>{await iC(e,"llm",ia,t||{}),eG(!1)},onClose:()=>eG(!1)}),"codex"===j&&(0,s.jsx)(X,{isOpen:eo,onClose:()=>ed(!1),onSuccess:iy}),"codebuddy-cn"===j&&(0,s.jsx)(Y,{isOpen:ec,password:e_,onClose:()=>eu(!1),onSuccess:iy}),(0,s.jsx)(ee,{isOpen:t_,mode:tU,provider:j,providerName:tV?.name,dashboardPassword:tK,onClose:()=>{tz(!1),tJ("")},onSuccess:iy}),(0,s.jsxs)(c.aF,{isOpen:eP.open,onClose:()=>eI({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:()=>eI({open:!1,action:null,value:""}),children:(0,p.Tl)("Cancel")}),(0,s.jsx)(c.$n,{variant:"primary",onClick:tq,disabled:!eP.value||eD,children:eD?(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:eP.value,onChange:e=>eI(t=>({...t,value:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&eP.value&&tq()},placeholder:(0,p.Tl)("Password")}),eq&&(0,s.jsx)("p",{className:"text-xs text-red-500 mt-2",children:eq})]}),(0,s.jsx)(c.uo,{isOpen:tx,onClose:()=>th(!1),onConfirm:()=>{(window.localStorage.setItem(tE,"true"),th(!1),tQ)?tP():tD()},title:"Risk Notice",message:tV?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(c.uo,{isOpen:!!tm,onClose:()=>tp(null),onConfirm:tm?.onConfirm,title:tm?.title||"Confirm",message:tm?.message,variant:"danger"})]})}},70217:(e,t,i)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}i.d(t,{g:()=>s})},93578:(e,t,i)=>{Promise.resolve().then(i.bind(i,33229))}},e=>{e.O(0,[3170,1728,5772,1321,5497,8441,3794,7358],()=>e(e.s=93578)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{67455:(e,r,t)=>{Promise.resolve().then(t.bind(t,97678))},97678:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>T});var s=t(95155),a=t(12115),l=t(14051),i=t.n(l),n=t(35497),o=t(67852),d=t(8247),c=t(90620),p=t(88105),m=t(98500),u=t.n(m),x=t(65921),h=t(38003),f=t(73006);let g={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function y(){let[e,r]=(0,a.useState)(null),[t,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let t=await e.json();r(t)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let h=async(e,r)=>{c(`${e}:${r}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:r})})).ok?(m.success(`Cooldown cleared for ${r}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(t)return null;let f=e?.models||[],y=0===(e?.unavailableCount||f.filter(e=>"available"!==e.status).length),b={};return f.forEach(e=>{if("available"===e.status)return;let r=e.provider||"unknown";b[r]||(b[r]=[]),b[r].push(e)}),(0,s.jsx)("div",{className:"relative",ref:p,children:i&&(0,s.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:y?"#22c55e":"#f59e0b"},children:y?"verified":"warning"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,s.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,s.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:y?(0,s.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(b).map(([e,r])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:r.map(e=>{let r=g[e.status]||g.unknown,t=d===`${e.provider}:${e.model}`;return(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:r.color},children:r.icon}),(0,s.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:t,className:"text-[10px] px-1.5! py-0.5! ml-2",children:t?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let b={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function j({variant:e,isOpen:r,onClose:t,onCreated:l}){let i=b[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[d,c]=(0,a.useState)(o),[p,m]=(0,a.useState)(!1),[u,x]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(""),[N,T]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null);(0,a.useEffect)(()=>{i.hasApiType?c(e=>({...e,baseUrl:i.defaultBaseUrl})):r&&(k(null),f(""),y(""),x(""))},[i.hasApiType?d.apiType:r]);let C=async()=>{if(d.name.trim()&&d.prefix.trim()&&d.baseUrl.trim()){m(!0),x("");try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:i.type})}),r=await e.json();e.ok?(l(r.node),c(o()),f(""),k(null),x("")):x(r?.error||"Failed to create provider")}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e),x("Network error creating provider")}finally{m(!1)}}},A=async()=>{T(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:h,type:i.type,modelId:g.trim()||void 0})}),r=await e.json();k(r)}catch{k({valid:!1,error:"Network error"})}finally{T(!1)}};return(0,s.jsx)(n.aF,{isOpen:r,title:i.title,onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,s.jsx)(n.l6,{label:"API Type",options:v,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>f(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:g,onChange:e=>y(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:A,disabled:!h||N||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:N?"Checking...":"Check"}),(()=>{if(!w)return null;let{valid:e,error:r,method:t}=w;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===t&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),r&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:r})]})})()]}),u&&(0,s.jsx)("div",{className:"rounded border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-500",children:u}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:C,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N(e,r,t){let a=[];if(e>0&&a.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),r>0){let e=t?`${r} Error (${t})`:`${r} Error`;a.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function T(){let e,r,[t,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(!0),[u,g]=(0,a.useState)(!1),[b,v]=(0,a.useState)(!0),[N,T]=(0,a.useState)(!1),[E,O]=(0,a.useState)(!1),[I,S]=(0,a.useState)(null),[D,$]=(0,a.useState)(null),[P,R]=(0,a.useState)({}),[U,_]=(0,a.useState)([]),[z,q]=(0,a.useState)(null),[F,M]=(0,a.useState)(null),H=(0,x.i)(),L=(0,h.C)(e=>e.query),J=(0,h.C)(e=>e.register),K=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>(J("Search providers..."),()=>K()),[J,K]);let B=e=>!L.trim()||!!e&&e.toLowerCase().includes(L.trim().toLowerCase()),W=(e,r,t)=>{if(e.connected>0)return 0;if(r?.noAuth){let e;return+(!1===(e=P?.[t])||!0!==e&&!!r.topologyHiddenByDefault)}return 0===e.total?3:2},V=e=>{let r=U.indexOf(e);return -1===r?Number.MAX_SAFE_INTEGER:r};(0,a.useEffect)(()=>{(async()=>{try{let[e,r,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes"),fetch("/api/settings",{cache:"no-store"})]),s=await e.json(),a=await r.json();if(e.ok&&l(s.connections||[]),r.ok&&o(a.nodes||[]),t.ok){let e=await t.json();R(e.topologyVisibility||{}),v(!1!==e.showCommunityProviders),Array.isArray(e.providerCardOrder)&&_(e.providerCardOrder)}}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let X=(0,a.useCallback)(async(e,r)=>{let t={...P,[e]:r};R(t);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({topologyVisibility:t})})).ok)throw Error("Failed to update topology visibility")}catch(e){console.error("Error updating topology visibility:",e),R(P)}},[P]),Q=(e,r)=>{let s=Array.isArray(r)?r:[r],a=t.filter(r=>r.provider===e&&s.includes(r.authType)),l=e=>{let r=Object.entries(e).some(([e,r])=>e.startsWith("modelLock_")&&r&&new Date(r).getTime()>Date.now());return"unavailable"!==e.testStatus||r?e.testStatus:"active"},i=a.filter(e=>{if(!1===e.isActive)return!1;let r=l(e);return"active"===r||"success"===r}).length,n=a.filter(e=>{let r=l(e);return"error"===r||"expired"===r||"unavailable"===r}),o=n.length,d=a.length,c=d>0&&a.every(e=>!1===e.isActive),p=n.sort((e,r)=>new Date(r.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:p?function(e){if(!e)return null;let r=e.lastErrorType;if("runtime_error"===r)return"RUNTIME";if("upstream_auth_error"===r||"auth_missing"===r||"token_refresh_failed"===r||"token_expired"===r)return"AUTH";if("upstream_rate_limited"===r)return"429";if("upstream_unavailable"===r)return"5XX";if("network_error"===r)return"NET";let t=Number(e.errorCode);if(Number.isFinite(t)&&t>=400)return String(t);let s=function(e){if(!e)return null;let r=e.match(/\b([45]\d{2})\b/);return r?r[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(p):null,errorTime:p?.lastErrorAt?function(e){if(!e)return"";let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;let t=Math.floor(r/60);if(t<24)return`${t}h ago`;let s=Math.floor(t/24);return`${s}d ago`}(p.lastErrorAt):null,allDisabled:c}},Z=async(e,r,s)=>{let a=Array.isArray(r)?r:[r],i=r=>r.provider===e&&a.includes(r.authType),n=t.filter(i);l(e=>e.map(e=>i(e)?{...e,isActive:s}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},G=async(e,r=null)=>{if(!I){S("provider"===e?r:e),$(null);try{let t=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:r})}),s=await t.json();if($(s),s.summary){let{passed:e,failed:r,total:t}=s.summary;0===r?H.success(`${(0,f.Tl)("All")} ${t} ${(0,f.Tl)("tests passed")}`):H.warning(`${e}/${t} ${(0,f.Tl)("passed")}, ${r} ${(0,f.Tl)("failed")}`)}}catch(e){$({error:(0,f.Tl)("Test request failed")}),H.error((0,f.Tl)("Provider test failed"))}finally{S(null)}}},Y=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>B(e.name)),ee=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>B(e.name)),er=(e,r)=>{if("kiro"===r)return["oauth","apikey","api_key"];let t=e?.authModes;return Array.isArray(t)?t.includes("apikey")?["oauth","apikey","api_key"]:"oauth":r in p.nJ||r in c.fg?["oauth","apikey","api_key"]:"oauth"},et=(e=Object.entries(c.zN).filter(([,e])=>!e.hidden&&B(e.name)),r="oauth",[...e].sort(([e,t],[s,a])=>{let l=Q(e,r),i=Q(s,r),n=W(l,t,e),o=W(i,a,s);if(n!==o)return n-o;let d=V(e),c=V(s);if(d!==c)return d-c;let p=t.priority??999,m=a.priority??999;return p!==m?p-m:(t.name||"").localeCompare(a.name||"")})),es=[...Object.entries(p.IS).filter(([,e])=>!e.hidden&&!(e.community&&!b)&&B(e.name)).map(([e,r])=>({key:e,info:r,stats:Q(e,er(r,e)),isFreeTier:!1})),...Object.entries(p.nJ).filter(([,e])=>!e.hidden&&!(e.community&&!b)&&B(e.name)&&(e.serviceKinds??["llm"]).includes("llm")).map(([e,r])=>({key:e,info:r,stats:Q(e,er(r,e)),isFreeTier:!0}))].sort((e,r)=>{let t=W(e.stats,e.info,e.key),s=W(r.stats,r.info,r.key);if(t!==s)return t-s;let a=!!r.info.noAuth-!!e.info.noAuth;if(0!==a)return a;let l=+!!e.info.community,i=+!!r.info.community;if(l!==i)return l-i;let n=V(e.key),o=V(r.key);if(n!==o)return n-o;let d=e.info.priority??999,c=r.info.priority??999;return d!==c?d-c:(e.info.name||"").localeCompare(r.info.name||"")}),ea=Object.entries(c.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&B(e.name)).sort(([e,r],[t,s])=>{let a=Q(e,"apikey"),l=Q(t,"apikey"),i=W(a,r,e),n=W(l,s,t);if(i!==n)return i-n;let o=V(e),d=V(t);if(o!==d)return o-d;let c=r.priority??999,p=s.priority??999;return c!==p?c-p:(r.name||"").localeCompare(s.name||"")}),el=[...Y,...ee].sort((e,r)=>{let t=V(e.id),s=V(r.id);return t!==s?t-s:(e.name||"").localeCompare(r.name||"")}),ei=(0,a.useCallback)(()=>{let e=[];for(let r of[...Y,...ee])e.includes(r.id)||e.push(r.id);for(let[r]of et)e.includes(r)||e.push(r);for(let r of es)e.includes(r.key)||e.push(r.key);for(let[r]of ea)e.includes(r)||e.push(r);return e},[Y,ee,et,es,ea]),en=(0,a.useCallback)(e=>{q(null),M(null),z&&e&&z!==e&&_(r=>{let t=ei(),s=[...r];for(let e of t)s.includes(e)||s.push(e);let a=s.indexOf(z),l=s.indexOf(e);return -1===a||-1===l?r:(s.splice(a,1),s.splice(l,0,z),fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerCardOrder:s})}).catch(e=>console.log("Failed to save provider card order:",e)),s)})},[z,ei]),eo=!!L.trim(),ed=eo||u?ea:ea.slice(0,20),ec=ea.length-20;if(d)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let ep=et.length>0||es.length>0||ea.length>0||Y.length>0||ee.length>0;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!ep&&(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>O(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>T(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===Y.length&&0===ee.length?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,s.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:el.map(e=>(0,s.jsx)(w,{cardId:e.id,isDragging:z===e.id,isOver:F===e.id,onDragStart:q,onDragOver:M,onDrop:en,onDragEnd:()=>{q(null),M(null)},children:(0,s.jsx)(C,{providerId:e.id,provider:e,stats:Q(e.id,"apikey"),authType:"compatible",onToggle:r=>Z(e.id,"apikey",r)})},e.id))})]}),et.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(y,{}),(0,s.jsxs)("button",{onClick:()=>G("oauth"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:(0,f.Tl)("Test all OAuth connections"),"aria-label":(0,f.Tl)("Test all OAuth connections"),children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===I?" animate-spin":""}`,children:"play_arrow"}),"oauth"===I?(0,f.Tl)("Testing..."):(0,f.Tl)("Test All")]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:et.map(([e,r])=>{let t=er(r,e);return(0,s.jsx)(w,{cardId:e,isDragging:z===e,isOver:F===e,onDragStart:q,onDragOver:M,onDrop:en,onDragEnd:()=>{q(null),M(null)},children:(0,s.jsx)(k,{providerId:e,provider:r,stats:Q(e,t),authType:"oauth",onToggle:r=>Z(e,t,r)})},e)})})]}),es.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,s.jsxs)("button",{onClick:()=>G("free"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:(0,f.Tl)("Test all Free connections"),"aria-label":(0,f.Tl)("Test all Free provider connections"),children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===I?" animate-spin":""}`,children:"play_arrow"}),"free"===I?(0,f.Tl)("Testing..."):(0,f.Tl)("Test All")]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:es.map(({key:e,info:r,isFreeTier:t})=>{let a=er(r,e),l=P?.[e],i=!1!==l&&(!0===l||!r.topologyHiddenByDefault);return(0,s.jsx)(w,{cardId:e,isDragging:z===e,isOver:F===e,onDragStart:q,onDragOver:M,onDrop:en,onDragEnd:()=>{q(null),M(null)},children:t?(0,s.jsx)(C,{providerId:e,provider:r,stats:Q(e,a),authType:Array.isArray(a)?a[0]??"apikey":a,onToggle:r=>Z(e,a,r)}):(0,s.jsx)(k,{providerId:e,provider:r,stats:Q(e,a),authType:"free",onToggle:r=>Z(e,a,r),topologyVisible:i,onToggleTopology:r.noAuth?r=>X(e,r):void 0})},e)})})]}),ea.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,s.jsxs)("button",{onClick:()=>G("apikey"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:(0,f.Tl)("Test all API Key connections"),"aria-label":(0,f.Tl)("Test all API Key connections"),children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===I?" animate-spin":""}`,children:"play_arrow"}),"apikey"===I?(0,f.Tl)("Testing..."):(0,f.Tl)("Test All")]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:ed.map(([e,r])=>(0,s.jsx)(w,{cardId:e,isDragging:z===e,isOver:F===e,onDragStart:q,onDragOver:M,onDrop:en,onDragEnd:()=>{q(null),M(null)},children:(0,s.jsx)(C,{providerId:e,provider:r,stats:Q(e,"apikey"),authType:"apikey",onToggle:r=>Z(e,"apikey",r)})},e))}),!eo&&!u&&ec>0&&(0,s.jsxs)("button",{onClick:()=>g(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",ea.length," providers"]})]}),(0,s.jsx)(j,{variant:"openai",isOpen:N,onClose:()=>T(!1),onCreated:e=>{o(r=>[...r,e]),T(!1)}}),(0,s.jsx)(j,{variant:"anthropic",isOpen:E,onClose:()=>O(!1),onCreated:e=>{o(r=>[...r,e]),O(!1)}}),D&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>$(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:(0,f.Tl)("Test Results")}),(0,s.jsx)("button",{onClick:()=>$(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":(0,f.Tl)("Close"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(A,{results:D})})]})]})]})}function w({cardId:e,isDragging:r,isOver:t,onDragStart:a,onDragOver:l,onDrop:i,onDragEnd:n,children:o}){return(0,s.jsx)("div",{draggable:!0,onDragStart:r=>{a(e),r.dataTransfer.effectAllowed="move";try{r.dataTransfer.setData("text/plain",e)}catch{}},onDragOver:r=>{r.preventDefault(),r.dataTransfer.dropEffect="move",l(e)},onDrop:r=>{r.preventDefault(),i(e)},onDragEnd:n,className:`min-w-0 transition-all rounded-xl cursor-grab active:cursor-grabbing ${r?"opacity-30 scale-[0.98]":t?"ring-2 ring-primary/60 scale-[1.01]":""}`,children:o})}function k({providerId:e,provider:r,stats:t,authType:a,onToggle:l,topologyVisible:i,onToggleTopology:d}){let{connected:c,error:p,errorCode:m,errorTime:x,allDisabled:h}=t,g=!!r.noAuth,y=t.total>0,b=g&&"function"==typeof d,v=!1!==i;return(0,s.jsx)(u(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h||b&&!v?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${r.color?.length>7?r.color:r.color+"15"}`},children:(0,s.jsx)(o.A,{src:`/providers/${r.id}.png`,alt:r.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:r.textIcon||r.id.slice(0,2).toUpperCase(),fallbackColor:r.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("h3",{className:"truncate font-semibold flex items-center gap-1.5",children:[r.name,r.community&&(0,s.jsx)(n.Ex,{variant:"warning",size:"sm",className:"shrink-0",children:(0,f.Tl)("Trial")})]}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),(0,f.Tl)("Disabled")]})}):g?v?(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:(0,f.Tl)("Ready")}):(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,f.Tl)("Topology off")}):(0,s.jsxs)(s.Fragment,{children:[N(c,p,m),x&&(0,s.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[y&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?(0,f.Tl)("Enable provider"):(0,f.Tl)("Disable provider")})}),b&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),d(!v)},children:(0,s.jsx)(n.lM,{size:"sm",checked:v,onChange:()=>{},title:v?"Hide from usage topology":"Show on usage topology"})})]})]})})})}function C({providerId:e,provider:r,stats:t,authType:a,onToggle:l}){let{connected:i,error:c,errorCode:m,errorTime:x,allDisabled:h}=t,g=e.startsWith(p.JH),y=e.startsWith(p.DI);return(0,s.jsx)(u(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${r.color?.length>7?r.color:r.color+"15"}`},children:(0,s.jsx)(o.A,{src:g&&r.apiType?"responses"===r.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":y?"/providers/anthropic-m.png":(0,d.HY)(r.id),alt:r.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:r.textIcon||r.id.slice(0,2).toUpperCase(),fallbackColor:r.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("h3",{className:"truncate font-semibold flex items-center gap-1.5",children:[r.name,r.community&&(0,s.jsx)(n.Ex,{variant:"warning",size:"sm",className:"shrink-0",children:(0,f.Tl)("Trial")})]}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),(0,f.Tl)("Disabled")]})}):(0,s.jsxs)(s.Fragment,{children:[N(i,c,m),g&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===r.apiType?"Responses":"Chat"}),y&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,s.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:t.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?(0,f.Tl)("Enable provider"):(0,f.Tl)("Disable provider")})})})]})})})}function A({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:r,mode:t}=e,a=e.results||[],l={oauth:"OAuth",free:(0,f.Tl)("Free"),apikey:(0,f.Tl)("API Key"),provider:(0,f.Tl)("Provider"),all:(0,f.Tl)("All")}[t]||t;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[r&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[l," ",(0,f.Tl)("Test")]}),(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[r.passed," ",(0,f.Tl)("passed")]}),r.failed>0&&(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[r.failed," ",(0,f.Tl)("failed")]}),(0,s.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[r.total," ",(0,f.Tl)("tested")]})]}),a.map((e,r)=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,s.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,s.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?(0,f.Tl)("OK"):e.diagnosis?.type||(0,f.Tl)("ERROR")})]},e.connectionId||r)),0===a.length&&(0,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:(0,f.Tl)("No active connections found for this group.")})]})}j.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},A.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}}},e=>{e.O(0,[3170,1728,1321,5497,8441,3794,7358],()=>e(e.s=67455)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7414],{71470:(e,t,s)=>{"use strict";s.d(t,{default:()=>j});var a=s(95155),l=s(12115),r=s(21742),i=s(63346),d=s(77496),n=s(32539),o=s(59656),x=s(77621),c=s(31310),m=s(35497);let p=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0),h=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"last7d",label:"7 days"},{id:"last30d",label:"30 days"},{id:"all",label:"All time"}],u={applied:"Prompt exceeded threshold",below_threshold:"Below size threshold",not_profitable:"Compression not profitable",below_min_chars:"Below minimum chars",below_min_tokens:"Below minimum tokens",unsupported_model:"Model not in allowlist",unsupported_format:"Non-Claude request format",timeout:"Compression timed out",transform_error:"Transform error",passthrough:"Passthrough",disabled:"Disabled",not_installed:"Not installed"};function g({label:e,value:t,sub:s,tone:l}){return(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted uppercase tracking-wide",children:e}),(0,a.jsx)("p",{className:`text-xl font-semibold mt-1 ${l||""}`,children:t}),s&&(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:s})]})}function j(){let[e,t]=(0,l.useState)(null),[s,j]=(0,l.useState)(null),[b,f]=(0,l.useState)(null),[N,y]=(0,l.useState)(null),[v,w]=(0,l.useState)("last7d"),[k,S]=(0,l.useState)(!0),P=(0,l.useCallback)(async()=>{S(!0);try{let[e,s,a]=await Promise.all([fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),fetch("/api/pxpipe/stats"),fetch("/api/pxpipe/logs?limit=50")]);t(await e.json()),f(await s.json()),y(await a.json());let l=await fetch("/api/pxpipe/health",{method:"POST"});j(await l.json())}catch{}finally{S(!1)}},[]);(0,l.useEffect)(()=>{P()},[P]);let E=b?.windows?.[v],$=e?e.installed?s?.healthy?"Healthy":e.running?"Running":"Stopped":"Not installed":"—";return(0,a.jsxs)("div",{className:"space-y-6 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"image"}),"PXPIPE Dashboard"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("a",{href:"/dashboard/token-saver",className:"text-xs text-primary underline hover:opacity-80",children:"Token Saver settings"}),(0,a.jsx)(m.$n,{size:"sm",variant:"ghost",onClick:P,disabled:k,children:k?"Refreshing…":"Refresh"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[(0,a.jsx)(g,{label:"Status",value:$,tone:s?.healthy?"text-success":e?.installed?"text-warning":"text-text-muted",sub:e?.enabled?"Enabled in pipeline":"Disabled in pipeline"}),(0,a.jsx)(g,{label:"Version",value:e?.version?`v${e.version}`:"—",sub:"pxpipe-proxy"}),(0,a.jsx)(g,{label:"Uptime",value:(e=>{if(!e||e<=0)return"—";let t=Math.floor(e/6e4),s=Math.floor(t/60);return s>0?`${s}h${String(t%60).padStart(2,"0")}m`:`${t}m`})(e?.uptimeMs),sub:"module loaded"}),(0,a.jsx)(g,{label:"Requests",value:E?E.requests.toLocaleString():"—"}),(0,a.jsx)(g,{label:"Compressed",value:E?E.compressed.toLocaleString():"—",tone:"text-success"}),(0,a.jsx)(g,{label:"Bypassed",value:E?E.bypassed.toLocaleString():"—"})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-4",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Token savings (estimated)"}),(0,a.jsx)("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1",children:h.map(e=>(0,a.jsx)("button",{onClick:()=>w(e.id),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${v===e.id?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.id))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Original tokens"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensBeforeEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"After PXPIPE"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensAfterEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Saved"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?p(E.tokensSavedEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Reduction"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?`${E.savedPct}%`:"—"})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3",children:["Estimates from body size before/after imaging; billed usage per request (recorded on the Usage page) remains the ground truth. Images generated:"," ",E?E.imagesGenerated.toLocaleString():"—"," \xb7 avg compression time:"," ",E?`${E.avgCompressionMs}ms`:"—"," \xb7 errors: ",E?E.errors:"—"]})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"Tokens saved — last 30 days"}),b?.timeline?.some(e=>e.tokensSavedEst>0)?(0,a.jsx)(r.u,{width:"100%",height:220,children:(0,a.jsxs)(i.Q,{data:b.timeline,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"gradPxpipe",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.25}),(0,a.jsx)("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]})}),(0,a.jsx)(d.d,{strokeDasharray:"3 3",strokeOpacity:.2}),(0,a.jsx)(n.W,{dataKey:"date",tick:{fontSize:11},tickFormatter:e=>e.slice(5)}),(0,a.jsx)(o.h,{tick:{fontSize:11},tickFormatter:p,width:48}),(0,a.jsx)(x.m,{formatter:e=>[p(e),"Tokens saved"],labelFormatter:e=>e}),(0,a.jsx)(c.Gk,{type:"monotone",dataKey:"tokensSavedEst",stroke:"#10b981",fill:"url(#gradPxpipe)",strokeWidth:2})]})}):(0,a.jsx)("div",{className:"h-32 flex items-center justify-center text-text-muted text-sm",children:"No savings recorded yet — enable PXPIPE in the Token Saver and route a large Claude-format request."})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"History"}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"py-2 pr-3",children:"Time"}),(0,a.jsx)("th",{className:"py-2 pr-3",children:"Model"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Original"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Compressed"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Saved"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"%"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Duration"}),(0,a.jsx)("th",{className:"py-2",children:"Status"})]})}),(0,a.jsxs)("tbody",{children:[(b?.recent||[]).slice(0,50).map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-border/50",children:[(0,a.jsx)("td",{className:"py-1.5 pr-3 whitespace-nowrap text-text-muted",children:new Date(e.ts).toLocaleString()}),(0,a.jsx)("td",{className:"py-1.5 pr-3 font-mono text-xs",children:e.provider?`${e.provider}/${e.model}`:e.model||"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensBeforeEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensAfterEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs text-success",children:e.applied?p(e.tokensSavedEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?`${e.savedPct}%`:"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:null!=e.durationMs?`${e.durationMs}ms`:"—"}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${e.applied?"bg-success/15 text-success":"transform_error"===e.reason||"timeout"===e.reason?"bg-danger/15 text-danger":"bg-warning/15 text-warning"}`,title:e.detail||"",children:e.applied?"Compressed":u[e.reason]||e.reason})})]},`${e.ts}-${t}`)),(!b?.recent||0===b.recent.length)&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:8,className:"py-6 text-center text-text-muted text-sm",children:"No PXPIPE activity yet"})})]})]})})]}),(0,a.jsxs)(m.Zp,{className:"p-4",id:"logs",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"PXPIPE Logs"}),N?.installLog?(0,a.jsx)("pre",{className:"rounded bg-black/5 dark:bg-white/5 p-3 text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:N.installLog}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No install log yet."})]})]})}},93224:(e,t,s)=>{Promise.resolve().then(s.bind(s,71470))}},e=>{e.O(0,[3170,1728,1321,5497,8441,3794,7358],()=>e(e.s=93224)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{26048:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var a=r(95155),i=r(12115),s=r(67852),n=r(45564);let l="quotaCacheData",o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(e){return"qoder"===e.provider||"qoder-cn"===e.provider?e.displayName?.trim()||e.name?.trim()||e.email?.trim()||null:e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function x(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function k(e,t,r,a=[]){let i=null,s=t?.[e]?.hidden;if(Array.isArray(s))i=s.map(String);else if(r&&r!==e){let e=t?.[r]?.hidden;Array.isArray(e)&&(i=e.map(String))}return i?new Set(Array.isArray(a)&&a.length>0?function(e=[],t=[]){if(!Array.isArray(e)||0===e.length)return[];let r=new Set(t.map(v).filter(Boolean));return[...new Set(e.map(e=>String(e).trim()).filter(e=>r.has(e)))]}(i,a):i):new Set}var w=r(73006);function j(e){let t=String(e||"").trim();if(!t)return"";let r=(0,w.Tl)(t);if(r!==t)return r;let a=/^Bonus Pack (\d+)$/.exec(t);if(a)return`${(0,w.Tl)("Bonus Pack")} ${a[1]}`;let i=/^weekly\s+(.+)\s+\(7d\)$/i.exec(t);if(i)return`${(0,w.Tl)("Weekly")} ${i[1]} (7d)`;let s=/^Balance(?:\s*\((.+)\))?$/i.exec(t);return s?s[1]?`${(0,w.Tl)("Balance")} (${s[1]})`:(0,w.Tl)("Balance"):t}function N({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):e?.remaining!==void 0&&(e?.total===100||e?.total===void 0)?Math.max(0,Math.round(e.remaining)):y(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let m=c.slice((l-1)*10,10*l),x=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",v="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"space-y-px",children:m.map(e=>{var r;let i=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},s=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0||t.getFullYear()>2099)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e);if(t.getFullYear()>2099)return null;let r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),o=!1!==e.recurring?`in ${s}`:`expires in ${s}`;return(0,a.jsxs)("div",{className:`flex items-center gap-2 border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${p}`,children:[(0,a.jsxs)("div",{className:"flex w-36 min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:i.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:j(e.name)})]}),(0,a.jsxs)("div",{className:`min-w-0 flex-1 ${t?"space-y-1":"space-y-1.5"}`,children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${i.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${i.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between gap-1 min-w-0 ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted truncate",title:e.percentScale||!0===e.displayRemaining?void 0:`${e.used.toLocaleString()} / ${e.unlimited?"∞":e.total.toLocaleString()}`,children:e.percentScale?"":!0===e.displayRemaining&&e.total>0?`${Number((e.total-e.used).toFixed(2)).toLocaleString()} / ${Number(e.total.toFixed(2)).toLocaleString()}`:`${e.used.toLocaleString()} / ${e.unlimited?"∞":e.total.toLocaleString()}`}),(0,a.jsxs)("span",{className:`font-medium ${i.text} shrink-0`,children:[e.remaining,"%"]})]})]}),(0,a.jsx)("div",{className:"min-w-0 shrink",children:"-"!==s||l?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:l||"",children:"-"!==s?o:l}):(0,a.jsxs)("div",{className:"min-w-0 space-y-0.5",children:["-"!==s&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,children:o}),l&&(0,a.jsx)("div",{className:`${f} text-text-muted truncate`,children:l})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),v&&(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})]},`${e.name}-${e.index}`)})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var C=r(98542),S=r(97677),A=r(84588),$=r(35497),P=r(88105),q=r(11059);let E={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},T={claude:"claudeAutoPing",codex:"codexAutoPing"},M={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota."};function D(e){let t=m(e);if(e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()){let r=e.email.trim();if(r!==t)return r}if(e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()){let r=e.displayName.trim();if(r!==t)return r}return null}function O(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function F(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}let I={"qoder-cn":"Qoder CN",qoder:"Qoder","codebuddy-cn":"CodeBuddy CN","codebuddy-intl":"CodeBuddy Intl","minimax-cn":"MiniMax CN","glm-cn":"GLM CN","kimi-cn":"Kimi CN"};function _(){let{copied:e,copy:t}=(0,q.C)(),[r,_]=(0,i.useState)([]),[L,z]=(0,i.useState)({}),[R,W]=(0,i.useState)({}),[U,B]=(0,i.useState)({}),[K,H]=(0,i.useState)(!0),[J,G]=(0,i.useState)({claude:{},codex:{}}),[Y,V]=(0,i.useState)(null),[Q,X]=(0,i.useState)(!1),[Z,ee]=(0,i.useState)(!1),[et,er]=(0,i.useState)(60),[ea,ei]=(0,i.useState)(!0),[es,en]=(0,i.useState)(null),[el,eo]=(0,i.useState)(null),[ed,ec]=(0,i.useState)(null),[eu,em]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,eb]=(0,i.useState)(!1),[eg,ef]=(0,i.useState)(null),[ey,ev]=(0,i.useState)([]),[ek,ew]=(0,i.useState)(()=>window.localStorage.getItem("quotaProviderFilter")||"all"),[ej,eN]=(0,i.useState)([]),[eC,eS]=(0,i.useState)(()=>window.localStorage.getItem("quotaAccountFilter")||"all");(0,i.useEffect)(()=>{window.localStorage.setItem("quotaProviderFilter",ek)},[ek]),(0,i.useEffect)(()=>{window.localStorage.setItem("quotaAccountFilter",eC)},[eC]);let[eA,e$]=(0,i.useState)("default"),[eP,eq]=(0,i.useState)({}),[eE,eT]=(0,i.useState)(!1),[eM,eD]=(0,i.useState)(!1),[eO,eF]=(0,i.useState)(!1),[eI,e_]=(0,i.useState)(1),[eL,ez]=(0,i.useState)(20),[eR,eW]=(0,i.useState)(String(20)),[eU,eB]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eK,eH]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eJ=(0,i.useRef)(null),eG=(0,i.useRef)(null),eY=(0,i.useRef)(0),eV=(0,i.useCallback)(async(e=eI)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eL),accountStatus:eC,sort:"priority"});"all"!==ek&&a.set("provider",ek);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eL,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return _(n),eN(s.providerOptions||[]),eB(l),eH(o),e_((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),_([]),eN([]),eB({page:1,pageSize:eL,total:0,totalPages:1}),eH({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eC,eE,eI,eL,ek]),eQ=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{W(t=>({...t,[e]:!0})),B(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};z(t=>({...t,[e]:a})),f(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":if(t.quotas){let e=Object.entries(t.quotas),a=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),i=e.filter(([e])=>e.startsWith("claude-")||e.startsWith("gpt-")),s=e.filter(([e])=>e.includes("image")),n=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.startsWith("gpt-")&&!e.includes("image"));if(a.length>0){let e=a.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1];r.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage,percentScale:!0})}if(i.length>0){let e=i.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1];r.push({name:"Claude (Sonnet / Opus / GPT)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage,percentScale:!0})}s.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,percentScale:!0})}),n.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,percentScale:!0})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":case"qoder-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{if("organization"===e&&(!t||0===(Number(t.total)||0))||"addOn"===e&&(!t||0===(Number(t.total)||0)))return;let a=t.resetAt&&2099>=new Date(t.resetAt).getFullYear()?t.resetAt:null;r.push({name:"user"===e?"Plan Credits":"addOn"===e?"Resource Package":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:"addOn"===e?null:a,unlimited:!0===t.unlimited}),"addOn"===e&&Array.isArray(t.packs)&&t.packs.forEach((e,a)=>{r.push({name:`Bonus Pack ${a+1}`,used:e.used||0,total:e.total||0,unit:t.unit,resetAt:e.expiresAt&&2099>=new Date(e.expiresAt).getFullYear()?e.expiresAt:null,unlimited:!1,recurring:!1})})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||100)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:y(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":case"codebuddy-intl":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring,displayRemaining:!0})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"commandcode":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||0)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:y(t.used,t.total),resetAt:t.resetAt||null,recurring:!0===t.recurring,displayRemaining:!0})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}if(e?.toLowerCase()==="commandcode"){let e={"session (5h)":0,"weekly (7d)":1,"Monthly Credits":2,"Purchased Credits":3};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};z(t=>({...t,[e]:l})),f(e,l)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),B(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{W(t=>({...t,[e]:!1}))}},[]),eX=(0,i.useCallback)(async(e,t)=>{await eQ(e,t,{force:!0}),V(new Date)},[eQ]),eZ=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!ed){ec(e),B(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eQ(e,t),V(new Date)}catch(t){B(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{ec(null)}}},[eQ,ed]),e0=(0,i.useCallback)(async e=>{eh({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eh({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eh({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),e1=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){en(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){z(t=>{let r={...t};return delete r[e],r}),W(t=>{let r={...t};return delete r[e],r}),B(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await b(eV,eI)}}catch(e){console.error("Error deleting connection:",e)}finally{en(null)}}},[eV,eI]),e5=(0,i.useCallback)(async(e,t)=>{eo(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(z(e=>({...e})),await b(eV,eI))}catch(e){console.error("Error updating connection status:",e)}finally{eo(null)}},[eV,eI]),e2=(0,i.useCallback)(async e=>{if(!eg?.id)return;let t=eg.id,r=eg.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eV(),eb(!1),ef(null),P.wb.includes(r)&&await eQ(t,r))}catch(e){console.error("Error saving connection:",e)}},[eg,eV,eQ]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ev(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e3=(0,i.useCallback)(async(e=!1)=>{if(Z)return;ee(!0),er(60);let t=eY.current+=1,r=Math.round(10);try{let a=await eV(eI);W(h(a)),B(e=>p(e,a)),z(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eQ(e.id,e.provider))),V(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{ee(!1)}},[Z,eV,eQ,eI]);(0,i.useEffect)(()=>{(async()=>{ei(!0);let e=await eV(eI);ei(!1),W(h(e)),B(t=>p(t,e)),z(t=>p(t,e)),await Promise.all(e.map(e=>eQ(e.id,e.provider))),V(new Date)})()},[eV,eQ,eI]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);H(null===e||"true"===e),X(!0)},[]),(0,i.useEffect)(()=>{Q&&window.localStorage.setItem(o,String(K))},[K,Q]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{G({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),eq(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e4=(0,i.useCallback)(async(e,t,r)=>{let a=T[t];if(!a)return;let i={...J[t]||{},[e]:r};G({...J,[t]:i});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:i};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{G(J)}},[J]),e8=(0,i.useCallback)(async(e,t)=>{eq(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eq(t)}},[]),e6=(0,i.useCallback)((e,t,r)=>{let a=v(t);if(!e||!a)return;let i=eP[e]||{},s=new Set(i.hidden||[]);if(s.add(a),"antigravity"===r){if("gemini"===a)for(let e of s)e.startsWith("gemini-")&&!e.includes("image")&&s.delete(e);else if("claude"===a)for(let e of s)(e.startsWith("claude-")||e.startsWith("gpt-"))&&s.delete(e)}e8({...eP,[e]:{...i,hidden:[...s]}},eP)},[eP,e8]),e9=(0,i.useCallback)((e,t,r)=>{let a=v(t);if(!e||!a)return;let i=eP[e]||{},s=new Set(i.hidden||[]);if(s.delete(a),"antigravity"===r){if("gemini"===a)for(let e of s)e.startsWith("gemini-")&&!e.includes("image")&&s.delete(e);else if("claude"===a)for(let e of s)(e.startsWith("claude-")||e.startsWith("gpt-"))&&s.delete(e)}e8({...eP,[e]:{...i,hidden:[...s]}},eP)},[eP,e8]);(0,i.useEffect)(()=>{if(!Q||!K){eJ.current&&(clearInterval(eJ.current),eJ.current=null),eG.current&&(clearInterval(eG.current),eG.current=null);return}return eJ.current=setInterval(()=>{e3()},6e4),eG.current=setInterval(()=>{er(e=>e<=1?60:e-1)},1e3),()=>{eJ.current&&clearInterval(eJ.current),eG.current&&clearInterval(eG.current)}},[K,e3,Q]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(eJ.current&&(clearInterval(eJ.current),eJ.current=null),eG.current&&(clearInterval(eG.current),eG.current=null)):K&&Q&&(eJ.current=setInterval(()=>e3(),6e4),eG.current=setInterval(()=>{er(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[K,e3,Q]);let e7=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=x(e,t),s=x(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(m(e)||"").localeCompare(m(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,L,eE,ek,eA),[r,L,eE,ek,eA]),te=(0,i.useCallback)(()=>{let e={...eP},t=!1;for(let r of e7){let a=e[r.id]||{},i=[...function(e){let t=new Set;if(!Array.isArray(e))return t;for(let r of e){let e=v(r);if(!e||!0===r.unlimited)continue;let a=r.total||0;(a<=0||(r.used||0)>=a)&&t.add(e)}return t}(L[r.id]?.quotas||[])],s=a.hidden||[];(i.length!==s.length||i.some((e,t)=>e!==s[t]))&&(e[r.id]={...a,hidden:i},t=!0)}t&&e8(e,eP)},[eP,e8,e7,L]),tt=(0,i.useCallback)(()=>{let e={...eP},t=!1;for(let r of e7)e[r.id]?.hidden?.length&&(e[r.id]={...e[r.id],hidden:[]},t=!0);t&&e8(e,eP)},[eP,e8,e7]),tr=e=>{let t=L[e.id]?.quotas;if(!t?.length)return!1;let r=t.filter(e=>!0!==e.unlimited);return 0!==r.length&&r.every(e=>{let t=e.total||0;return t<=0||(e.used||0)>=t})},ta=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eO){eF(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await b(eV,eI)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eF(!1)}}},[eO,eV,eI]),ti="all"===ek?"All providers":ek,ts=eK.eligibleConnections>0,tn=e7.length>0,tl=eK.eligibleConnections?eK.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ek?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eC?"turned off":"active"===eC?"active":"matching"} accounts found for ${ek}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},to=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eU),td=!d.includes(eL),tc=ea||ts?ea||tn?null:(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:tl.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:tl.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:tl.description})]})}):(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})});return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eD(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eM,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ek?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${ek}.png`,alt:ek,size:18,className:"size-[18px] rounded object-contain",fallbackText:ek.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:ti})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eM&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eD(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==ek&&e_(1),ew("all"),eD(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ek?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ek&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ej.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{ek!==e&&e_(1),ew(e),eD(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ek===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),ek===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:eC,onChange:e=>{let t=e.target.value;eC!==t&&e_(1),eS(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ek&&(0,a.jsx)("select",{value:eA,onChange:e=>e$(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eT(e=>!e),"aria-pressed":eE,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eE?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{ta(e7.filter(e=>(e.isActive??!0)&&tr(e)).map(e=>e.id),!1)},disabled:eO,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,w.Tl)("Turn off Empty")})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{ta(e7.filter(e=>!(e.isActive??!0)&&!tr(e)).map(e=>e.id),!0)},disabled:eO,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,w.Tl)("Turn on Available")})]}),(0,a.jsxs)("button",{type:"button",onClick:te,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-blue-500/30 px-2 text-xs text-blue-500 transition-colors hover:bg-blue-500/10",title:"Hide depleted (zero-balance) quota packs across current connections",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"visibility"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,w.Tl)("Only with balance")})]}),(0,a.jsxs)("button",{type:"button",onClick:tt,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:"Show all quota packs across current connections",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,w.Tl)("Show all")})]}),(0,a.jsxs)("button",{onClick:()=>H(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:K?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${K?"text-primary":"text-text-muted"}`,children:K?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),K&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",et,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e3(!0),disabled:Z,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Z?"animate-spin":""}`,children:"refresh"})})]})}),"all"!==eC&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",children:"filter_alt"}),(0,a.jsx)("span",{children:(0,w.Tl)("Account filter is active and persists across visits")})]}),eE&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),tc&&(0,a.jsx)("div",{className:"pt-2",children:tc}),!tc&&(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e7.map(r=>{let i,n,l,o=L[r.id],d=R[r.id],c=U[r.id],u=!1===r.isActive,x="codex"===r.provider,h=Number.isFinite(n="number"==typeof(i=o?.raw?.resetCredits?.availableCount)?i:Number(i))?Math.max(0,n):0,p=ed===r.id,b=es===r.id||el===r.id||p,g=o?.quotas||[],f=function(e,t=[],r={},a){if(!Array.isArray(t)||0===t.length)return[];let i=k(e,r,a,t);return 0===i.size?t:t.filter(e=>!i.has(v(e)))}(r.id,g,eP,r.provider),y=function(e,t=[],r={},a){if(!Array.isArray(t)||0===t.length)return[];let i=k(e,r,a,t);return 0===i.size?[]:t.filter(e=>i.has(v(e)))}(r.id,g,eP,r.provider);return(0,a.jsxs)(A.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:I[r.provider]||(0,a.jsx)("span",{className:"capitalize",children:r.provider})}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(l=r.providerSpecificData?.authMethod)&&E[l]?E[l]:"api_key"===r.authType?"API Key":"OAuth"}),O(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:O(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.default,{text:h>0?`Use one Codex reset credit. Available: ${h}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>em({connection:r,resetCreditCount:h}),disabled:h<=0||d||b,"aria-label":h>0?`Use one Codex reset credit. ${h} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${h>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:h})]})}),(0,a.jsx)(S.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>e0(r),disabled:d||b,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),T[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(S.default,{text:M[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e4(r.id,r.provider,J[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${J[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(S.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eX(r.id,r.provider),disabled:d||b,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(S.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ef(r),eb(!0)},disabled:b,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(S.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r.id),disabled:b,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${es===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(C.default,{size:"sm",checked:r.isActive??!0,disabled:b,onChange:e=>e5(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):c?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(N,{quotas:f,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eA,onHideQuota:e=>e6(r.id,e,r.provider)}),y.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:y.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>e9(r.id,e,r.provider),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:j(e.name)},v(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:to}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:td?"custom":String(eL),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(e_(1),ez(r),eW(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eR,onChange:e=>eW(e.target.value),onBlur:()=>{let e=Number.parseInt(eR,10);if(!Number.isFinite(e))return void eW(String(eL));let t=Math.min(500,Math.max(1,e));e_(1),ez(t),eW(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eR,10);if(!Number.isFinite(t))return void eW(String(eL));let r=Math.min(500,Math.max(1,t));e_(1),ez(r),eW(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eU.page," / ",eU.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>e_(1),disabled:eU.page<=1||ea||Z,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>e_(e=>Math.max(1,e-1)),disabled:eU.page<=1||ea||Z,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>e_(e=>Math.min(eU.totalPages,e+1)),disabled:eU.page>=eU.totalPages||ea||Z,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>e_(eU.totalPages),disabled:eU.page>=eU.totalPages||ea||Z,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)($.uo,{isOpen:!!eu,onClose:()=>{ed||em(null)},onConfirm:async()=>{let e=eu?.connection;e&&(await eZ(e.id,e.provider),em(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(eu?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eu?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!ed}),ex&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:m(ex.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eh(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ex.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ex.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ex.error}):ex.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ex.data.credits.length," reset credit",1===ex.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ex.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ex.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:F(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:F(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)($.wI,{isOpen:ep,connection:eg,proxyPools:ey,onSave:e2,onClose:()=>{eb(!1),ef(null)}})]})}}},e=>{e.O(0,[3170,1728,1321,5497,8441,3794,7358],()=>e(e.s=26048)),_N_E=e.O()}]);