@rabbi696/ezrouter 0.6.22 → 0.6.23

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 (928) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +5 -5
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  5. package/app/.next-cli-build/required-server-files.json +3 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +26 -6
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/page.js +1 -1
  94. package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  107. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  109. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  110. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  111. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  112. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  114. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  115. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  116. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  117. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js +1 -1
  141. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/combos/export/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/combos/export/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/combos/import/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/combos/import/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/combos/test/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/combos/test/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/convoy/rules/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js +2 -2
  241. package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/mcp-gateway/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/mcp-gateway/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/models/enabled/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/models/enabled/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/callback/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/oauth/callback/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  304. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/routing-health/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/routing-health/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/token-saver/stats/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/token-saver/stats/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/token-saver/stream/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/token-saver/stream/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  384. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/usage/error-logs/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  415. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  435. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  436. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  437. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  439. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  440. package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js +1 -1
  441. package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js.nft.json +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js.nft.json +1 -1
  444. package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js +1 -1
  445. package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js.nft.json +1 -1
  446. package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/codex/models/route.js +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/codex/models/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js.nft.json +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  457. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  460. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  465. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  466. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  467. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  468. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  469. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  472. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  473. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  474. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  475. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  476. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  478. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  479. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  480. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  481. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  482. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  484. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  485. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  486. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  487. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  488. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  489. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  490. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  491. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  492. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  493. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  494. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  496. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  497. package/app/.next-cli-build/server/app/api/wakeup/route.js +1 -1
  498. package/app/.next-cli-build/server/app/api/wakeup/route.js.nft.json +1 -1
  499. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  500. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  501. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  502. package/app/.next-cli-build/server/app/callback.html +1 -1
  503. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  504. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  505. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  507. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  508. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  512. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  516. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  517. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  519. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  522. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  523. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  524. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  526. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  527. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  529. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  530. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  532. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  536. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  537. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  539. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +6 -6
  542. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  546. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +6 -6
  547. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  548. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +4 -4
  549. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +2 -2
  550. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  551. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  552. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  553. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  554. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  556. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  557. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  559. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +6 -6
  562. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
  563. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
  564. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +6 -6
  568. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +4 -4
  570. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +2 -2
  571. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +6 -6
  573. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  578. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +6 -6
  579. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
  580. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +4 -4
  581. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +2 -2
  582. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
  583. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +6 -6
  584. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
  585. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  588. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +6 -6
  589. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
  590. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +4 -4
  591. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +2 -2
  592. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  593. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  594. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  595. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  596. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  597. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  598. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  599. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  600. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  601. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  602. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  603. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  604. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  605. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  606. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  607. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  608. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  609. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  610. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  611. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  612. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  613. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  614. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  615. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  616. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  617. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  618. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  619. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  620. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  621. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  622. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  623. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  624. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  625. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  626. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  627. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  628. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  629. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  630. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  631. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  632. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  633. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  634. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  635. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  636. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  637. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  638. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  639. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  640. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  641. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  642. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  643. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  644. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  645. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  646. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  647. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  648. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  649. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  650. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  651. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  652. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  653. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  654. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  655. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  656. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  657. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  658. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  659. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  660. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  661. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  662. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  663. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  664. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  665. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  666. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  667. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  668. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  669. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  670. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  671. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  672. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  673. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  674. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  675. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +6 -6
  676. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  677. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  678. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  679. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  680. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +6 -6
  681. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  682. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +4 -4
  683. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +2 -2
  684. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  685. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  686. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  687. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  688. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  689. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  690. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  691. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  692. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  693. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  694. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  695. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  696. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  697. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  698. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  699. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  700. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  701. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  702. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  703. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  704. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  705. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  706. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  707. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  708. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  709. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  710. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  711. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  712. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  713. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  714. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  715. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  716. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  717. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  718. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  719. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  720. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  721. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  722. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  723. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  724. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  725. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  726. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  727. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  728. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  729. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  730. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  731. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  732. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  733. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  734. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  735. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  736. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  737. package/app/.next-cli-build/server/app/dashboard/wakeup.html +1 -1
  738. package/app/.next-cli-build/server/app/dashboard/wakeup.rsc +6 -6
  739. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup/__PAGE__.segment.rsc +2 -2
  740. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup.segment.rsc +1 -1
  741. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  742. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  743. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_full.segment.rsc +6 -6
  744. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_head.segment.rsc +1 -1
  745. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_index.segment.rsc +4 -4
  746. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_tree.segment.rsc +2 -2
  747. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  748. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  749. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  750. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  751. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  752. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  753. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  754. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  755. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  756. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  757. package/app/.next-cli-build/server/app/index.html +1 -1
  758. package/app/.next-cli-build/server/app/index.rsc +4 -4
  759. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  760. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  761. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  762. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  763. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  764. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  765. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  766. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  767. package/app/.next-cli-build/server/app/landing.html +1 -1
  768. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  769. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  770. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  771. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  772. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  773. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  774. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  775. package/app/.next-cli-build/server/app/login/page.js +1 -1
  776. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  777. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  778. package/app/.next-cli-build/server/app/login.html +1 -1
  779. package/app/.next-cli-build/server/app/login.rsc +5 -5
  780. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  781. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  782. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  783. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  784. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  785. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  786. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  787. package/app/.next-cli-build/server/app/page.js +1 -1
  788. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  789. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  790. package/app/.next-cli-build/server/app-paths-manifest.json +5 -5
  791. package/app/.next-cli-build/server/chunks/1446.js +1 -1
  792. package/app/.next-cli-build/server/chunks/1482.js +2 -2
  793. package/app/.next-cli-build/server/chunks/1522.js +1 -1
  794. package/app/.next-cli-build/server/chunks/1530.js +1 -0
  795. package/app/.next-cli-build/server/chunks/1561.js +9 -0
  796. package/app/.next-cli-build/server/chunks/1641.js +1 -1
  797. package/app/.next-cli-build/server/chunks/1733.js +5 -1
  798. package/app/.next-cli-build/server/chunks/1847.js +1 -1
  799. package/app/.next-cli-build/server/chunks/1923.js +1 -0
  800. package/app/.next-cli-build/server/chunks/2072.js +255 -0
  801. package/app/.next-cli-build/server/chunks/2180.js +1 -1
  802. package/app/.next-cli-build/server/chunks/2348.js +1 -1
  803. package/app/.next-cli-build/server/chunks/2414.js +1 -0
  804. package/app/.next-cli-build/server/chunks/2687.js +1 -1
  805. package/app/.next-cli-build/server/chunks/2898.js +1 -1
  806. package/app/.next-cli-build/server/chunks/290.js +1 -1
  807. package/app/.next-cli-build/server/chunks/2937.js +1 -0
  808. package/app/.next-cli-build/server/chunks/3092.js +1 -1
  809. package/app/.next-cli-build/server/chunks/3159.js +9 -0
  810. package/app/.next-cli-build/server/chunks/321.js +2 -2
  811. package/app/.next-cli-build/server/chunks/3245.js +1 -1
  812. package/app/.next-cli-build/server/chunks/3433.js +4 -4
  813. package/app/.next-cli-build/server/chunks/3449.js +1 -1
  814. package/app/.next-cli-build/server/chunks/3547.js +1 -1
  815. package/app/.next-cli-build/server/chunks/3548.js +9 -0
  816. package/app/.next-cli-build/server/chunks/369.js +9 -9
  817. package/app/.next-cli-build/server/chunks/3759.js +5 -0
  818. package/app/.next-cli-build/server/chunks/3794.js +1 -1
  819. package/app/.next-cli-build/server/chunks/3966.js +1 -1
  820. package/app/.next-cli-build/server/chunks/3977.js +1 -1
  821. package/app/.next-cli-build/server/chunks/4017.js +1 -0
  822. package/app/.next-cli-build/server/chunks/412.js +5 -5
  823. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  824. package/app/.next-cli-build/server/chunks/4190.js +1 -1
  825. package/app/.next-cli-build/server/chunks/4370.js +2 -0
  826. package/app/.next-cli-build/server/chunks/4642.js +1 -0
  827. package/app/.next-cli-build/server/chunks/4807.js +1 -1
  828. package/app/.next-cli-build/server/chunks/4811.js +1 -1
  829. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  830. package/app/.next-cli-build/server/chunks/4878.js +1 -1
  831. package/app/.next-cli-build/server/chunks/4882.js +1 -1
  832. package/app/.next-cli-build/server/chunks/5005.js +1 -0
  833. package/app/.next-cli-build/server/chunks/5251.js +1 -1
  834. package/app/.next-cli-build/server/chunks/5292.js +1 -1
  835. package/app/.next-cli-build/server/chunks/5434.js +1 -1
  836. package/app/.next-cli-build/server/chunks/5460.js +4 -4
  837. package/app/.next-cli-build/server/chunks/5749.js +1 -1
  838. package/app/.next-cli-build/server/chunks/5872.js +1 -1
  839. package/app/.next-cli-build/server/chunks/6038.js +1 -1
  840. package/app/.next-cli-build/server/chunks/6103.js +1 -1
  841. package/app/.next-cli-build/server/chunks/615.js +1 -1
  842. package/app/.next-cli-build/server/chunks/6569.js +1 -1
  843. package/app/.next-cli-build/server/chunks/6646.js +1 -0
  844. package/app/.next-cli-build/server/chunks/6708.js +1 -1
  845. package/app/.next-cli-build/server/chunks/6889.js +3 -0
  846. package/app/.next-cli-build/server/chunks/6988.js +1 -1
  847. package/app/.next-cli-build/server/chunks/7144.js +1 -0
  848. package/app/.next-cli-build/server/chunks/722.js +1 -0
  849. package/app/.next-cli-build/server/chunks/7511.js +9 -0
  850. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  851. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  852. package/app/.next-cli-build/server/chunks/7811.js +1 -1
  853. package/app/.next-cli-build/server/chunks/7828.js +1 -1
  854. package/app/.next-cli-build/server/chunks/7982.js +9 -0
  855. package/app/.next-cli-build/server/chunks/7995.js +2 -2
  856. package/app/.next-cli-build/server/chunks/8129.js +1 -1
  857. package/app/.next-cli-build/server/chunks/823.js +1 -1
  858. package/app/.next-cli-build/server/chunks/8243.js +1 -1
  859. package/app/.next-cli-build/server/chunks/8306.js +1 -1
  860. package/app/.next-cli-build/server/chunks/8327.js +24 -15
  861. package/app/.next-cli-build/server/chunks/8459.js +1 -1
  862. package/app/.next-cli-build/server/chunks/8670.js +1 -0
  863. package/app/.next-cli-build/server/chunks/8950.js +1 -1
  864. package/app/.next-cli-build/server/chunks/8976.js +1 -1
  865. package/app/.next-cli-build/server/chunks/9303.js +1 -1
  866. package/app/.next-cli-build/server/chunks/9485.js +1 -1
  867. package/app/.next-cli-build/server/chunks/9616.js +1 -1
  868. package/app/.next-cli-build/server/chunks/9761.js +2 -2
  869. package/app/.next-cli-build/server/chunks/9843.js +1 -1
  870. package/app/.next-cli-build/server/chunks/9865.js +1 -1
  871. package/app/.next-cli-build/server/chunks/9898.js +2 -2
  872. package/app/.next-cli-build/server/instrumentation.js +1 -1
  873. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  874. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  875. package/app/.next-cli-build/server/middleware.js +5 -5
  876. package/app/.next-cli-build/server/next-font-manifest.js +1 -1
  877. package/app/.next-cli-build/server/next-font-manifest.json +1 -1
  878. package/app/.next-cli-build/server/pages/404.html +1 -1
  879. package/app/.next-cli-build/server/pages/500.html +1 -1
  880. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  881. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  882. package/app/.next-cli-build/static/chunks/1321-374cf8300fa9283a.js +1 -0
  883. package/app/.next-cli-build/static/chunks/5497-552ad04ae3380014.js +17 -0
  884. package/app/.next-cli-build/static/chunks/{6252-0f14a5b69160c9da.js → 6252-361b1d5b9d98e0f6.js} +1 -1
  885. package/app/.next-cli-build/static/chunks/6509-8408cfa51bab02b8.js +1 -0
  886. package/app/.next-cli-build/static/chunks/8105-2341cae0a3b70fc9.js +1 -0
  887. package/app/.next-cli-build/static/chunks/9227-08a1ad2fd60f90a1.js +5 -0
  888. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-2ac64e666515ee53.js +1 -0
  889. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/error-log/page-1f6447383234195f.js +1 -0
  890. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-948cbe61db1d6e26.js → page-94eb5202d9b42b30.js} +1 -1
  891. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-886fa42ab104c02b.js → page-5b823a675c71106d.js} +2 -2
  892. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9e25e5d249d9c772.js +27 -0
  893. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-61cabb346811532e.js +1 -0
  894. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-ed31b8fb16ed1c2c.js +1 -0
  895. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/wakeup/{page-cc38ba001d74e072.js → page-97d58b76627b2b45.js} +1 -1
  896. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-0441382e88eeda7c.js → layout-afb8830458a68375.js} +1 -1
  897. package/app/.next-cli-build/static/chunks/{webpack-63e69ceb57f8fc86.js → webpack-d3b25b624caf2b22.js} +1 -1
  898. package/app/.next-cli-build/static/css/09d93ff4fa82a09d.css +1 -0
  899. package/app/CHANGELOG.md +32 -0
  900. package/app/package.json +1 -1
  901. package/app/public/CHANGELOG.md +32 -0
  902. package/app/server.js +1 -1
  903. package/package.json +1 -1
  904. package/src/cli/api/client.js +28 -9
  905. package/src/cli/utils/modelSelector.js +4 -2
  906. package/app/.next-cli-build/server/chunks/1133.js +0 -1
  907. package/app/.next-cli-build/server/chunks/1837.js +0 -3
  908. package/app/.next-cli-build/server/chunks/3275.js +0 -1
  909. package/app/.next-cli-build/server/chunks/5743.js +0 -254
  910. package/app/.next-cli-build/server/chunks/6464.js +0 -1
  911. package/app/.next-cli-build/server/chunks/6765.js +0 -1
  912. package/app/.next-cli-build/server/chunks/7358.js +0 -1
  913. package/app/.next-cli-build/server/chunks/7362.js +0 -2
  914. package/app/.next-cli-build/server/chunks/8540.js +0 -1
  915. package/app/.next-cli-build/server/chunks/9352.js +0 -1
  916. package/app/.next-cli-build/static/chunks/1321-8a4ed98cd27f3c72.js +0 -1
  917. package/app/.next-cli-build/static/chunks/5497-b45e1c7b332ddf12.js +0 -17
  918. package/app/.next-cli-build/static/chunks/6509-3113291463d9844c.js +0 -1
  919. package/app/.next-cli-build/static/chunks/8105-09b5824ceb7fd21b.js +0 -1
  920. package/app/.next-cli-build/static/chunks/9227-96f7384b30545e0d.js +0 -5
  921. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-b29a8b9ee4742767.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/error-log/page-862a88526522df85.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-5cddf336494d65c2.js +0 -27
  924. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-bb32b01b204c30e6.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-c804bcf327d3ef5a.js +0 -1
  926. package/app/.next-cli-build/static/css/99e24003a7301d8b.css +0 -1
  927. /package/app/.next-cli-build/static/{Y99WYOLLyt5Zmp6hx75Z1 → qhov0HpMB8g5P8LJxjypq}/_buildManifest.js +0 -0
  928. /package/app/.next-cli-build/static/{Y99WYOLLyt5Zmp6hx75Z1 → qhov0HpMB8g5P8LJxjypq}/_ssgManifest.js +0 -0
@@ -1,27 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{14558:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(95155),i=s(12115),r=s(97677);function l({connectionId:e,disabled:t=!1,onComplete:s}){let[n,o]=(0,i.useState)(!1),[d,c]=(0,i.useState)(null);async function m(){if(!n){if(d)return void c(null);o(!0);try{let t=await fetch("/api/wakeup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ping",connectionId:e})}),a=await t.json();if(!t.ok)throw Error(a.error||"Ping failed.");c(a),s&&Promise.resolve(s()).catch(()=>{})}catch(e){c({status:"failed",message:e.message})}finally{o(!1)}}}let p=n?"Pinging…":d?`${d.message} Click to reset.`:"Ping now — sends a small request. Consumes quota; does not change Auto-Ping.",u=d?"succeeded"===d.status?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400":"text-text-muted hover:text-primary";return(0,a.jsx)(r.default,{text:p,children:(0,a.jsx)("button",{type:"button",onClick:m,disabled:n||t&&!d,"aria-label":p,"aria-busy":n,className:`flex h-8 w-8 items-center justify-center rounded-lg ${u} hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50`,children:(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:n?20:32},className:`material-symbols-outlined ${n?"animate-spin":""}`,children:n?"progress_activity":"play_arrow"})})})}},59736:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eu});var a=s(95155),i=s(12115),r=s(73321),l=s(98500),n=s.n(l),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(57151),x=s(47224),h=s(40228),f=s(89523);let g=["none","low","medium","high"],y=["none","thinking"],b=["none","low","medium","high","max"],v=["none","low","medium","high","xhigh","max"],j={qoder:v,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":v,"claude-budget":v,"gemini-level":["minimal","low","medium","high"],"gemini-budget":g,zai:y,qwen:g,kimi:b,opencode:b,deepseek:["none","high","max"],minimax:y,hunyuan:g,step:g,nous:g,meta:["minimal","low","medium","high","xhigh"],ollama:b},w=["none","minimal","low","medium","high","xhigh","max"],k=["none","low","medium","high","max"],N=[{pattern:"*claude*4.6*",levels:k},{pattern:"*claude*4-6*",levels:k},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"qoder",pattern:"*",levels:v},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]},{pattern:"*glm-5.3",levels:["low","high","max"]}];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 s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:a,minor:i}=s;return a<4||4===a&&(null===i||i<=5||null!==i&&i>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let a=String(t||"").replace(/\([^()]+\)\s*$/,""),i="codex"===e?(0,f.SM)("cx").find(e=>e.id===a)?.thinkingLevels:null,r=N.find(s=>(!s.providers||!e||s.providers.includes(e))&&(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),l=(e?h.xq[e]?.thinkingFormat:null)||s.thinkingFormat,n=i||s.thinkingLevels||r?.levels||j[l]||g;return!1===s.thinkingCanDisable&&(n=n.filter(e=>"none"!==e)),n}var S=s(11059),A=s(929),T=s(73006);let $=new Map;async function O(e){if(e?.type==="static")return e.models||[];if(!e?.url||!e?.type)return[];let t=$.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return $.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function P({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:r=!0}){let l=new Set(a.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||l.has(t.id))continue;let a=`${s}/${t.id}`;n.has(a)||(n.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!r)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||l.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}var I=s(14051),E=s.n(I);function R({model:e,fullModel:t,alias:s,copied:i,onCopy:r,testStatus:l,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===l?"#22c55e":"error"===l?"#ef4444":"slow"===l||"rate_limited"===l?"#f59e0b":void 0;return(0,a.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"slow"===l||"rate_limited"===l?"border-amber-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:g?{color:g}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"slow"===l||"rate_limited"===l?"warning":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:f}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:r,onTest:l,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:l,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function _({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:r,copied:l,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u,onTestModel:x,externalTestResults:h,externalTestingModelIds:f,disabledModelIds:g=[]}){let y,b,[v,j]=(0,i.useState)(""),[w,k]=(0,i.useState)(!1),[N,C]=(0,i.useState)(!1),[S,A]=(0,i.useState)([]),[T,$]=(0,i.useState)(()=>new Set),[O,I]=(0,i.useState)({});(0,i.useEffect)(()=>{let e=p.find(e=>!1!==e.isActive);if(!e)return;let t=!1;return(async()=>{try{let s=await fetch(`/api/providers/${e.id}/models`);if(!s.ok)return;let a=await s.json();if(t)return;let i=(a.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(i)])}catch{}})(),()=>{t=!0}},[p]);let E=async t=>{if(x)return void await x(t);if(!T.has(t)){$(e=>new Set(e).add(t));try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();I(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{I(e=>({...e,[t]:"error"}))}finally{$(e=>{let s=new Set(e);return s.delete(t),s})}}},R=P({customModels:r,modelAliases:s,providerAlias:e,type:"llm"}),M=R.filter(e=>!g.includes(e.id)),z=async()=>{if(!v.trim()||w)return;let e=v.trim();if(R.some(t=>t.id===e))return void alert("Model already exists for this provider.");k(!0);try{await d(e),j("")}catch(e){console.log("Error adding model:",e)}finally{k(!1)}},q=async()=>{if(N)return;let e=p.find(e=>!1!==e.isActive);if(e){C(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to fetch models");let a=(s.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(a)])}catch(e){console.log("Error fetching models:",e)}finally{C(!1)}}},U=async e=>{R.some(t=>t.id===e)||(await d(e),A(t=>t.filter(t=>t!==e)))},F=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or discover them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:v,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&z(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:z,disabled:!v.trim()||w,children:w?"Adding...":"Add"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"search",onClick:q,disabled:!F||N,children:N?"Fetching...":"Fetch /models"})]}),!F&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to discover models from /models."}),M.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:M.map(({id:s,alias:i,source:r})=>(0,a.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:l,onCopy:n,onDeleteAlias:()=>"custom"===r?m(s):o(i),onTest:p.length>0?()=>E(s):void 0,testStatus:h?.[s]||O[s],isTesting:f?.has(s)||T.has(s)},`${r}-${e}/${s}`))}),S.length>0&&(y=new Set(R.map(e=>e.id)),0===(b=S.filter(e=>!y.has(e))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Suggested models from /models (",b.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,a.jsxs)("button",{onClick:()=>U(e),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,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e]},e))})]}))]})}function M({isOpen:e,onClose:t,providerId:s,providerAlias:r,connections:l,customModels:n,disabledModelIds:o,onSaved:d}){let[m,u]=(0,i.useState)([]),[x,h]=(0,i.useState)(()=>new Set),[f,g]=(0,i.useState)(""),[y,b]=(0,i.useState)(!0),[v,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(""),N=(0,i.useMemo)(()=>(l||[]).filter(e=>!1!==e.isActive&&e.id).map(e=>e.id),[l]);(0,i.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{let e=[];try{let t=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(r)}`,{cache:"no-store"});t.ok&&(e=(await t.json()).ids||[])}catch{}let a=await Promise.all(N.map(async e=>{try{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let s=await t.json();return Array.isArray(s?.models)?s.models:[]}catch{return[]}}));if(t)return;let i=new Set,l=[],n=(e,t,s={})=>{let a=String(e??"").trim();!a||i.has(a)||(i.add(a),l.push({id:a,name:t||a,...s}))};for(let e of a)for(let t of e)n("string"==typeof t?t:t?.id,"string"==typeof t?t:t?.name||t?.id,{live:!0});for(let e of(0,p.KC)(s)||[]){let t=(0,p.CP)(e,"llm");t&&"llm"!==t||n(e.id,e.name)}for(let t of e)n(t,t,{stale:!0});let d=new Set(o||[]),c=e.length>0?e:l.filter(e=>!e.isCustom&&!d.has(e.id)).map(e=>e.id);u(l),h(new Set(c)),b(!1)})(),()=>{t=!0}},[e,s,r,N,o]);let C=(0,i.useMemo)(()=>(n||[]).filter(e=>e.providerAlias===r&&"llm"===(e.kind||e.type||"llm")).map(e=>({id:String(e.id).trim(),name:e.name||e.id})).filter(e=>e.id),[n,r]),S=(0,i.useMemo)(()=>{let e=f.trim().toLowerCase();return e?m.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)):m},[m,f]),A=async()=>{j(!0),k("");try{let e=Array.from(x),s=await fetch("/api/models/enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:r,ids:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`Failed to save (${s.status})`)}d?.(e),t()}catch(e){k(e?.message||"Failed to save visible models")}finally{j(!1)}};return(0,a.jsx)(c.aF,{isOpen:e,onClose:t,title:"Visible models",size:"lg",footer:null,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/8 px-2.5 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-primary",style:{fontSize:"14px"},children:"info"}),(0,a.jsxs)("span",{children:["Only the checked models are exposed on ",(0,a.jsx)("code",{className:"font-mono",children:"/v1/models"}),". Leave everything unchecked to expose all of them. Custom models are always exposed."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,a.jsx)("input",{type:"text",placeholder:"Search...",value:f,onChange:e=>g(e.target.value),className:"w-full rounded border border-border bg-surface py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set(m.map(e=>e.id))),disabled:y||v,children:"Select all"}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set),disabled:y||v,children:"Clear"})]}),w&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:w}),y?(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"Loading models…"}):(0,a.jsxs)("div",{className:"max-h-[360px] overflow-y-auto rounded-lg border border-border",children:[S.map(e=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 border-b border-border/50 px-3 py-2 last:border-b-0 hover:bg-sidebar/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:x.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"size-3.5 accent-primary cursor-pointer"}),(0,a.jsx)("span",{className:"truncate text-xs text-text-main",children:e.name}),(0,a.jsx)("code",{className:"truncate font-mono text-[11px] text-text-muted",children:e.id}),e.live&&!e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"live"}),e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:"not in catalog"})]},e.id)),0===S.length&&(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"No models found"})]}),C.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-border px-3 py-2",children:[(0,a.jsx)("p",{className:"mb-1 text-[11px] text-text-muted",children:"Always exposed (custom models)"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:C.map(e=>(0,a.jsx)("span",{className:"rounded bg-sidebar px-1.5 py-0.5 font-mono text-[11px] text-text-muted",children:e.id},e.id))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:0===x.size?"Nothing selected — all models stay visible.":`${x.size} of ${m.length} selected`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:t,disabled:v,children:"Cancel"}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:A,loading:v,disabled:y,children:"Save"})]})]})]})})}R.propTypes={model:E().shape({id:E().string.isRequired}).isRequired,fullModel:E().string.isRequired,alias:E().string,copied:E().string,onCopy:E().func.isRequired,testStatus:E().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:E().bool,isFree:E().bool,onDeleteAlias:E().func,onTest:E().func,isTesting:E().bool,onDisable:E().func,caps:E().object,thinkingSuffix:E().string},E().string.isRequired,E().string.isRequired,E().string,E().func.isRequired,E().func.isRequired,E().func,E().oneOf(["ok","error"]),E().bool,E().string.isRequired,E().object.isRequired,E().arrayOf(E().object),E().string,E().func.isRequired,E().func.isRequired,E().func.isRequired,E().func.isRequired,_.propTypes={providerStorageAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,modelAliases:E().object.isRequired,customModels:E().arrayOf(E().object),copied:E().string,onCopy:E().func.isRequired,onDeleteAlias:E().func.isRequired,onAddCustomModel:E().func.isRequired,onDeleteCustomModel:E().func.isRequired,connections:E().arrayOf(E().shape({id:E().string,isActive:E().bool})).isRequired,isAnthropic:E().bool,onTestModel:E().func,externalTestResults:E().object,externalTestingModelIds:E().instanceOf(Set),disabledModelIds:E().arrayOf(E().string)},M.propTypes={isOpen:E().bool.isRequired,onClose:E().func.isRequired,providerId:E().string.isRequired,providerAlias:E().string.isRequired,connections:E().arrayOf(E().object),customModels:E().arrayOf(E().object),disabledModelIds:E().arrayOf(E().string),onSaved:E().func};var z=s(70217);function q({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}q.propTypes={until:E().string.isRequired};var U=s(64827),F=s(14558);let J=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function K(e){if(!e||"string"!=typeof e)return!1;let t=e.toLowerCase();return J.some(e=>t.includes(e))}function L({connection:e,plan:t=null,proxyPools:s,isOAuth:r,isFirst:l,isLast:n,onMoveUp:o,onMoveDown:d,onToggleActive:m,onUpdateProxy:p,onEdit:u,onDelete:x,onReconnect:h=null,oneByOneStatus:f=null,autoPing:g=null,fastMode:y=null}){let[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,N]=(0,i.useState)(!1),C=(0,i.useRef)(null),{copied:A,copy:T}=(0,S.C)(),$=`conn-id-${e.id}`,O=async()=>{if(y?.onToggle&&!k){N(!0);try{await y.onToggle(!y.on)}catch(e){console.error("Failed to toggle fast mode:",e)}finally{N(!1)}}},P=new Map((s||[]).map(e=>[e.id,e])),I=e.providerSpecificData?.proxyPoolId||null,E=I?P.get(I):null,R=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,D=!!I||R,_=E?`Pool: ${E.name}`:I?`Pool: ${I} (inactive/missing)`:R?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",M=g?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. 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.",J="";if(E?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=E?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);J=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{J=t}}let H=E?.noProxy||e.providerSpecificData?.connectionNoProxy||"",B="default";E?.isActive===!0?B="success":(I||R)&&(B="error"),(0,i.useEffect)(()=>{if(!b)return;let e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]);let W=async e=>{w(!0);try{await p("__none__"===e?null:e)}finally{w(!1),v(!1)}},G=e.authType||(r?"oauth":"apikey"),V="oauth"===G,Q="cookie"===G,Z=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(V?"OAuth Account":Q?"Cookie Account":"API Key"),X=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,Y=t?.trim(),ee=e.providerSpecificData?.chatgptPlanType?.trim(),et="codex"===e.provider?Y&&"unknown"!==Y.toLowerCase()?Y:ee:null,[es,ea]=(0,i.useState)(!1),ei=(0,U.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{ea(!!(0,U.kJ)(e))};t();let s=ei?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[ei]);let er="unavailable"!==e.testStatus||es?e.testStatus:"active",el=(V||Q)&&"unavailable"===e.testStatus&&function(e,t){if(401===e||403===e)return!0;if(!t||"string"!=typeof t)return!1;let s=t.toLowerCase();return s.includes("unauthorized")||s.includes("token")||s.includes("invalid api key")||s.includes("revoked")||s.includes("auth")||K(t)}(e.errorCode,e.lastError),en=K(e.lastError)?"Auth expired — reconnect required":e.lastError,eo=()=>f?"queued"===f.state?"queued":"testing"===f.state?"testing":"success"===f.state?"success":"failed"===f.state?f.error?`failed: ${f.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:Q?"cookie":V?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:Z}),X&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:X}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(c.Ex,{variant:(0,z.g)(e.isActive,er),size:"sm",dot:!0,children:!1===e.isActive?"disabled":er||"Unknown"}),(0,a.jsx)(c.Ex,{variant:"default",size:"sm",children:V?"OAuth":Q?"Cookie":"API Key"}),et&&"unknown"!==et.toLowerCase()&&(0,a.jsx)(c.Ex,{variant:"primary",size:"sm",children:et}),D&&(0,a.jsx)(c.Ex,{variant:B,size:"sm",children:"Proxy"}),es&&!1!==e.isActive&&(0,a.jsx)(q,{until:ei}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:en}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),(0,a.jsxs)("button",{type:"button",onClick:()=>T(e.id||"",$),title:"Copy connection ID — send it as the x-connection-id request header to pin requests to this account (falls back to other accounts when it is unavailable)",className:"flex items-center gap-0.5 rounded font-mono text-[11px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xs",children:A===$?"check":"content_copy"}),A===$?"copied":`${(e.id||"").slice(0,8)}…`]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),eo()&&(0,a.jsx)(c.Ex,{variant:f?"success"===f.state?"success":"failed"===f.state?"error":"testing"===f.state?"primary":"default":"default",size:"sm",children:eo()})]}),D&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:_,children:_}),J&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:J}),H&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:H,children:["no_proxy: ",H]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(s||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:C,children:[(0,a.jsxs)("button",{onClick:()=>v(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 ${D?"text-primary":"text-text-muted hover:text-primary"}`,disabled:j,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),b&&(0,a.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,a.jsx)("button",{onClick:()=>W("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!I?"text-primary font-medium":"text-text-main"}`,children:"None"}),(s||[]).map(e=>(0,a.jsx)("button",{onClick:()=>W(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${I===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),y&&(0,a.jsx)(c.m_,{text:"Uses the provider's faster processing mode for this account at a higher token cost. Off by default.",children:(0,a.jsxs)("button",{type:"button",role:"switch","aria-label":"Fast mode","aria-checked":y.on,disabled:k,onClick:O,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 disabled:opacity-50 ${y.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:k?"progress_activity":y.on?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast mode"})]})}),g&&(0,a.jsx)(c.m_,{text:M,children:(0,a.jsxs)("button",{onClick:()=>g.onToggle(!g.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 ${g.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),el&&h&&(0,a.jsxs)("button",{onClick:()=>h(e),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),y&&(0,a.jsx)(c.m_,{text:y.on?"Fast mode ON — Codex requests on this account use the priority tier. Click to disable.":"Force fast mode — Codex requests on this account use the priority tier.",children:(0,a.jsxs)("button",{onClick:()=>y.onToggle(!y.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 ${y.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"speed"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast"})]})}),g&&(0,a.jsx)(F.A,{connectionId:e.id,disabled:!1===e.isActive}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}L.propTypes={connection:E().shape({id:E().string,name:E().string,email:E().string,displayName:E().string,modelLockUntil:E().string,testStatus:E().string,isActive:E().bool,lastError:E().string,priority:E().number,globalPriority:E().number}).isRequired,plan:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string,proxyUrl:E().string,noProxy:E().string,isActive:E().bool})),isOAuth:E().bool.isRequired,isFirst:E().bool.isRequired,isLast:E().bool.isRequired,onMoveUp:E().func.isRequired,onMoveDown:E().func.isRequired,onToggleActive:E().func.isRequired,onUpdateProxy:E().func,onEdit:E().func.isRequired,onDelete:E().func.isRequired,onReconnect:E().func,oneByOneStatus:E().shape({state:E().string,error:E().string}),autoPing:E().shape({on:E().bool,onToggle:E().func,provider:E().string}),fastMode:E().shape({on:E().bool,onToggle:E().func})};let H=`name1|sk-key1
2
- name2|sk-key2
3
- sk-key-only-auto-named`,B="__none__",W=()=>({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:B,baseUrl:"",ollamaHostUrl:""}),G=()=>({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""});function V({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,providerNode:n,authType:o,authHint:d,website:p,proxyPools:u,error:x,existingNames:h,onSave:f,onBulkDone:g,onClose:y}){let b="ollama-local"===t,v="cookie"===o,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k=m.Q2?.[t]?.baseUrlField||null,N="azure"===t,C="cloudflare-ai"===t,S="vertex"===t||"vertex-partner"===t,A="bedrock"===t,T=m.Q2?.[t]?.apiKeyOptionalWith||null,$=m.Q2?.[t]?.regions||null,O=m.Q2?.[t]?.defaultRegion||$?.[0]?.id||"",[P,I]=(0,i.useState)(W),[E,R]=(0,i.useState)(G),[D,_]=(0,i.useState)({accountId:""}),[M,z]=(0,i.useState)({location:"global",reasoningEffort:"high"}),[q,U]=(0,i.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[F,J]=(0,i.useState)(O),[K,L]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(null),[X,Y]=(0,i.useState)(!1),ee=C?`name1|sk-key1|acc123456
4
- name2|sk-key2|def789012
5
- sk-key-only-auto-named`:"qoder"===t||"qoder-cn"===t?`name1|pt-xxxxx
6
- name2|pt-yyyyy
7
- pt-only-auto-named`:H,[et,es]=(0,i.useState)("single"),[ea,ei]=(0,i.useState)(""),[er,el]=(0,i.useState)(null),en=()=>{I(W()),R(G()),_({accountId:""}),z({location:"global",reasoningEffort:"high"}),J(O),Z(null),es("single"),ei(""),el(null),y()},eo=()=>{if(r&&n)return{prefix:n.prefix,...n.apiType?{apiType:n.apiType}:{},baseUrl:n.baseUrl,nodeName:n.name,clientIdentityProfile:n.clientIdentityProfile||"default",clientIdentityHeaders:n.clientIdentityHeaders||{}};if(S)return{location:M.location||"global",reasoningEffort:M.reasoningEffort||"high"};if(A){let e={};return q.profile.trim()&&(e.profile=q.profile.trim()),q.region.trim()&&(e.region=q.region.trim()),q.accessKeyId.trim()&&(e.accessKeyId=q.accessKeyId.trim()),q.sessionToken.trim()&&(e.sessionToken=q.sessionToken.trim()),Object.keys(e).length?e:void 0}return function({hasBaseUrlField:e=!1,baseUrl:t="",isAzure:s=!1,azureData:a=null,isCloudflareAi:i=!1,cloudflareData:r=null,region:l="",hasRegions:n=!1}={}){if(e){let e=String(t||"").trim();return e?{baseUrl:e}:void 0}return s?{azureEndpoint:a?.azureEndpoint,apiVersion:a?.apiVersion,deployment:a?.deployment,organization:a?.organization}:i?{accountId:r?.accountId}:n&&l?{region:l}:void 0}({hasBaseUrlField:!!k,baseUrl:P.baseUrl,isAzure:N,azureData:E,isCloudflareAi:C,cloudflareData:D,region:F,hasRegions:!!$})},ed=()=>!!P.apiKey||!!(T&&eo()?.[T]),ec=async()=>{if(r&&!P.defaultModel.trim())return void Z("failed");L(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:P.apiKey,defaultModel:r?P.defaultModel.trim():void 0,providerSpecificData:eo()})}),s=await e.json();Z(s.valid?"success":"failed")}catch{Z("failed")}finally{L(!1)}},em=async()=>{if(t&&(b||ed())&&(b||P.name)&&(!r||P.defaultModel.trim())){Y(!0);try{let e=!1;try{L(!0),Z(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:P.apiKey,defaultModel:r?P.defaultModel.trim():void 0,providerSpecificData:eo()})});e=!!(await s.json()).valid,Z(e?"success":"failed")}catch{Z("failed")}finally{L(!1)}await f({name:P.name||(b?"Ollama Local":""),apiKey:P.apiKey,defaultModel:r?P.defaultModel.trim():void 0,priority:P.priority,proxyPoolId:P.proxyPoolId===B?null:P.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:eo()})&&en()}finally{Y(!1)}}},ep=async()=>{let e=ea.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:a=!1}=s,i=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),r=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let l=function(e,t={}){let{isCloudflareAi:s=!1}=t,a=e.split("|");if(s&&a.length>=3){let e=a[0].trim();return{baseName:e||"Key",apiKey:a.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:a[a.length-1].trim()}}}return a.length>=2?{baseName:a[0].trim()||"Key",apiKey:a.slice(1).join("|").trim()}:{baseName:"Key",apiKey:a[0].trim()}}(s,{isCloudflareAi:a});if(!l||!l.apiKey)continue;let n=l.baseName,o=1;for(;e=`${n} ${o}`,i.has(e.toLowerCase());)o+=1;i.add(e.toLowerCase());let d={name:e,apiKey:l.apiKey,skipped:!1};l.providerSpecificData&&(d.providerSpecificData=l.providerSpecificData),r.push(d)}return r}(e,h,{isCloudflareAi:C});if(!s.length)return;Y(!0),el(null);let a=0,i=0;for(let e of s)try{let s=!1;try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await a.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?a++:i++}catch{i++}Y(!1),el({success:a,failed:i}),a>0&&g&&g()};return t?(0,a.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${w}`,onClose:en,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"single"===et?"primary":"ghost",onClick:()=>{es("single"),el(null)},children:"Single"}),(0,a.jsx)(c.$n,{size:"sm",variant:"bulk"===et?"primary":"ghost",onClick:()=>{es("bulk"),el(null)},children:"Bulk Add"})]}),"bulk"===et&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:C?(0,a.jsxs)(a.Fragment,{children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t||"qoder-cn"===t?(0,a.jsxs)(a.Fragment,{children:["One PAT per line. Format: ",(0,a.jsx)("code",{children:"name|pt-..."})," or just ",(0,a.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,a.jsxs)(a.Fragment,{children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:ee,value:ea,onChange:e=>ei(e.target.value)}),er&&(0,a.jsxs)("div",{className:`text-sm font-medium ${er.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",er.success," added",er.failed>0?`, ✗ ${er.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:ep,fullWidth:!0,disabled:X||!ea.trim(),children:X?"Adding...":"Add All Keys"}),(0,a.jsx)(c.$n,{onClick:en,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===et&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pd,{label:"Name",value:P.name,onChange:e=>I({...P,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),k&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.pd,{label:k.label,value:P.baseUrl,onChange:e=>I({...P,baseUrl:e.target.value}),placeholder:k.placeholder,hint:k.help,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(c.$n,{onClick:ec,disabled:K||X,variant:"secondary",children:K?"Checking...":"Check"})})]}),!b&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.pd,{label:w,type:v?"text":"password",value:P.apiKey,onChange:e=>I({...P,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t||"qoder-cn"===t?"pt-...":"",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(c.$n,{onClick:ec,disabled:!P.apiKey||K||X,variant:"secondary",children:K?"Checking...":"Check"})})]}),j&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),v&&d&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[d,p&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",p.replace(/^https?:\/\//,"")]})]})]}),$&&(0,a.jsx)(c.l6,{label:"Region",value:F,onChange:e=>J(e.target.value),options:$.map(e=>({value:e.id,label:e.label}))}),r&&(0,a.jsx)(c.pd,{label:"Default Model",value:P.defaultModel,onChange:e=>I({...P,defaultModel:e.target.value}),placeholder:l?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),Q&&(0,a.jsx)(c.Ex,{variant:"success"===Q?"success":"error",children:"success"===Q?"Valid":"Invalid"}),x&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),r&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),C&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(c.pd,{label:"Account ID",value:D.accountId,onChange:e=>_({...D,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),S&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Vertex AI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(c.l6,{label:"Location",value:M.location,onChange:e=>z({...M,location:e.target.value}),options:[{value:"global",label:"global (recommended for Gemini 3.x)"},{value:"us-central1",label:"us-central1"},{value:"us-east4",label:"us-east4"},{value:"europe-west1",label:"europe-west1"},{value:"europe-west4",label:"europe-west4"},{value:"asia-east1",label:"asia-east1"},{value:"asia-northeast1",label:"asia-northeast1"}]}),(0,a.jsx)(c.l6,{label:"Reasoning Effort (default)",value:M.reasoningEffort,onChange:e=>z({...M,reasoningEffort:e.target.value}),options:[{value:"high",label:"high (32k tokens — default for Pro)"},{value:"medium",label:"medium (8k tokens)"},{value:"low",label:"low (1k tokens)"},{value:"",label:"none (let model decide)"}]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,a.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview. Reasoning effort sets the default ",(0,a.jsx)("code",{children:"thinkingBudget"}),"; clients can override per-request via ",(0,a.jsx)("code",{children:"reasoning_effort"}),"."]})]})]}),A&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(c.pd,{label:"AWS Profile (SSO — recommended)",value:q.profile,onChange:e=>U({...q,profile:e.target.value}),placeholder:"my-sso-profile"}),(0,a.jsx)(c.pd,{label:"Region",value:q.region,onChange:e=>U({...q,region:e.target.value}),placeholder:"us-east-1"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,a.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,a.jsxs)("code",{children:["aws sso login --profile ",q.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,a.jsx)(c.pd,{label:"Access Key ID (only for static keys)",value:q.accessKeyId,onChange:e=>U({...q,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,a.jsx)(c.pd,{label:"Session Token (only for temporary ASIA… keys)",value:q.sessionToken,onChange:e=>U({...q,sessionToken:e.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,a.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),N&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(c.pd,{label:"Azure Endpoint",value:E.azureEndpoint,onChange:e=>R({...E,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(c.pd,{label:"Deployment Name",value:E.deployment,onChange:e=>R({...E,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(c.pd,{label:"API Version",value:E.apiVersion,onChange:e=>R({...E,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(c.pd,{label:"Organization",value:E.organization,onChange:e=>R({...E,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(c.pd,{label:"Priority",type:"number",value:P.priority,onChange:e=>I({...P,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(c.l6,{label:"Proxy Pool",value:P.proxyPoolId,onChange:e=>I({...P,proxyPoolId:e.target.value}),options:[{value:B,label:"None"},...(u||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(u||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:em,fullWidth:!0,disabled:X||!b&&(!P.name||!ed())||r&&!P.defaultModel.trim()||N&&(!E.azureEndpoint||!E.deployment||!E.organization)||C&&!D.accountId,children:X?"Saving...":"Save"}),(0,a.jsx)(c.$n,{onClick:en,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}V.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,providerNode:E().shape({name:E().string,prefix:E().string,apiType:E().string,baseUrl:E().string,clientIdentityProfile:E().string,clientIdentityHeaders:E().object}),authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired};let Q=[{value:"default",label:"Default"},{value:"claude-cli",label:"Claude CLI"},{value:"codex-cli",label:"Codex CLI"},{value:"openclaw",label:"OpenClaw"},{value:"custom",label:"Custom Headers"}],Z=new Set(["authorization","x-api-key","api-key","cookie"]);function X(e){let t=String(e||"").trim();if(!t)return{headers:{}};try{let e;if(t.startsWith("{")){let s=JSON.parse(t);if(!s||"object"!=typeof s||Array.isArray(s))return{error:"Use a JSON object or Header: value lines."};e=Object.entries(s)}else for(let s of(e=[],t.split(/\r?\n/))){let t=s.trim();if(!t||t.startsWith("#"))continue;let a=t.indexOf(":");if(a<=0)return{error:"Each custom header line must use Header: value."};e.push([t.slice(0,a),t.slice(a+1)])}let s={};for(let[t,a]of e){let e=String(t||"").trim(),i=String(a||"").trim();!e||!i||Z.has(e.toLowerCase())||(s[e]=i)}return{headers:s}}catch{return{error:"Use valid JSON or Header: value lines."}}}function Y({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[n,o]=(0,i.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1",clientIdentityProfile:"default",clientIdentityHeadersText:""}),[d,m]=(0,i.useState)(!1),[p,u]=(0,i.useState)(""),[x,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1"),clientIdentityProfile:t.clientIdentityProfile||"default",clientIdentityHeadersText:t.clientIdentityHeaders?JSON.stringify(t.clientIdentityHeaders,null,2):""})},[t,l]);let v=async()=>{if(!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim())return;let e="custom"===n.clientIdentityProfile?X(n.clientIdentityHeadersText):{headers:{}};if(e.error)return void b("failed");m(!0);try{let t={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl,clientIdentityProfile:n.clientIdentityProfile,clientIdentityHeaders:e.headers};l||(t.apiType=n.apiType),await s(t)}finally{m(!1)}},j=async()=>{let e="custom"===n.clientIdentityProfile?X(n.clientIdentityHeadersText):{headers:{}};if(e.error)return void b("failed");g(!0);try{let t=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:l?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0,clientIdentityProfile:n.clientIdentityProfile,clientIdentityHeaders:e.headers})}),s=await t.json();b(s.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,a.jsx)(c.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,a.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,a.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsx)(c.l6,{label:"Client Identity",options:Q,value:n.clientIdentityProfile,onChange:e=>o({...n,clientIdentityProfile:e.target.value}),hint:"Optional. Adds client fingerprint headers for compatible gateways."}),"custom"===n.clientIdentityProfile&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Custom Headers"}),(0,a.jsx)("textarea",{value:n.clientIdentityHeadersText,onChange:e=>o({...n,clientIdentityHeadersText:e.target.value}),placeholder:'{\n "User-Agent": "custom/1.0"\n}',rows:5,className:"w-full resize-y rounded-[10px] border border-transparent bg-surface-2 px-3 py-2.5 text-[16px] text-text-main placeholder-text-muted/70 transition-all duration-150 focus:border-brand-500/40 focus:outline-none focus:ring-2 focus:ring-brand-500/30 sm:text-sm"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"JSON object or Header: value lines. Auth headers are ignored."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.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,a.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,a.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}Y.propTypes={isOpen:E().bool.isRequired,node:E().shape({id:E().string,name:E().string,prefix:E().string,apiType:E().string,baseUrl:E().string,clientIdentityProfile:E().string,clientIdentityHeaders:E().object}),onSave:E().func.isRequired,onClose:E().func.isRequired,isAnthropic:E().bool};let ee=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function et({isOpen:e,providerAlias:t,providerDisplayAlias:s,notice:r,onSave:l,onClose:n}){let[o,d]=(0,i.useState)(""),[m,u]=(0,i.useState)(ee),[x,h]=(0,i.useState)(null),[f,g]=(0,i.useState)(""),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)("");(0,i.useEffect)(()=>{e&&(d(""),u(ee()),j(""),h(null),g(""))},[e]);let w=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},k=async()=>{let e=w(o.trim());if(e){h("testing"),g("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();h(a.ok?"ok":"error"),g(a.error||"")}catch(e){h("error"),g(e.message)}}},N=async()=>{let e=w(o.trim());if(e&&!y){b(!0);try{await l(e,m,m.stt?v:null)}finally{b(!1)}}};return(0,a.jsx)(c.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[r&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs text-text-muted bg-sidebar rounded-lg p-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"info"}),(0,a.jsx)("span",{children:r})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:o,onChange:e=>{d(e.target.value),h(null),g("")},onKeyDown:e=>{"Enter"===e.key&&k()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===x,onClick:k,disabled:!o.trim()||"testing"===x,children:"testing"===x?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:w(o.trim())||"model-id"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,a.jsx)(c.lM,{checked:!!m[e],onChange:t=>u(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.lM,{checked:!!m.stt,onChange:e=>{u(t=>({...t,stt:e})),e||j("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),m.stt&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(c.l6,{label:"Transport",value:v,onChange:e=>j(e.target.value),placeholder:"Provider default (REST)",options:p.vp.map(e=>({value:e,label:p.qw[e].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===x&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===x&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:f||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(c.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(c.$n,{onClick:N,fullWidth:!0,size:"sm",disabled:!o.trim()||y,children:y?"Adding...":"Add Model"})]})]})})}et.propTypes={isOpen:E().bool.isRequired,providerAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,notice:E().string,onSave:E().func.isRequired,onClose:E().func.isRequired};let es=`[
8
- {
9
- "accessToken": "eyJhbGc...",
10
- "refreshToken": "rt_...",
11
- "idToken": "eyJhbGc...",
12
- "email": "user@example.com"
13
- }
14
- ]`;function ea({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),x=()=>{n||(l(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let a=r.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:es,value:r,onChange:e=>l(e.target.value),disabled:n}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,T.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,T.Tl)("failed")}`:""]}),f.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!r.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}ea.propTypes={isOpen:E().bool.isRequired,onClose:E().func.isRequired,onSuccess:E().func};let ei=`[
15
- {
16
- "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
17
- "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
18
- "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
19
- "email": "account1@example.com"
20
- },
21
- {
22
- "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
23
- "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
24
- "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
- "email": "account2@example.com"
26
- }
27
- ]`;function er(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function el({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(null),y=(0,i.useRef)(null),b=()=>{n||(l(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,T.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),a=er(t);Array.isArray(a)?e.push(...a):a&&e.push(a)}if(0===e.length)return void m((0,T.Tl)("No accounts found in selected files"));l(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,T.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=er(r)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),a=await t.json();if(!t.ok)return void m(a?.error||`Request failed: ${t.status}`);u(a),a.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,a.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,a.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,T.Tl)("Upload JSON Files")})]}),(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,a.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:ei,value:r,onChange:e=>{l(e.target.value),g(null)},disabled:n}),x&&(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,a.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,T.Tl)("Drop .json files here")})]})]}),f&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,a.jsxs)("span",{children:[(0,T.Tl)("Loaded")," ",f.accountsCount," ",(0,T.Tl)("account(s) from")," ",f.filesCount," ",(0,T.Tl)("file(s)")]})]}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,T.Tl)("failed")]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!r.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}var en=s(65921);let eo=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],ed=/^[A-Za-z0-9-]+$/;function ec({providerId:e}){let t=(0,en.i)(),[s,r]=(0,i.useState)(!1),[l,n]=(0,i.useState)([{name:"",value:""}]),[o,d]=(0,i.useState)({}),[m,p]=(0,i.useState)(!1),[u,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(a.length?a:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(a=>a.map((a,i)=>i===e?{...a,[t]:s}:a))},f=(0,i.useCallback)(async()=>{let s={};for(let e of l.filter(e=>e.name.trim())){let a=e.name.trim();if(!ed.test(a))return void t.error(`Invalid header name: ${a}`);if(eo.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}x(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[l,o,e,t]);return 0!==Object.keys(o).length||m?(0,a.jsxs)(c.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:l.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,a.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}ec.propTypes={providerId:E().string.isRequired};let em={claude:"claudeAutoPing",codex:"codexAutoPing"},ep=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function eu(){let e,t,s,l,u,x=(0,r.useParams)(),h=(0,r.useRouter)(),f=x.id,{getCaps:g}=(0,A.y)(),[y,b]=(0,i.useState)([]),[v,j]=(0,i.useState)(1),[w,k]=(0,i.useState)(10),[N,$]=(0,i.useState)(!0),[I,E]=(0,i.useState)(null),[D,z]=(0,i.useState)([]),[q,U]=(0,i.useState)(!1),[F,J]=(0,i.useState)(!1),[K,H]=(0,i.useState)(!1),[B,W]=(0,i.useState)(!1),[G,Q]=(0,i.useState)(""),[Z,X]=(0,i.useState)(!1),[ee,es]=(0,i.useState)(!1),[ei,er]=(0,i.useState)(!1),[en,eo]=(0,i.useState)(!1),[ed,eu]=(0,i.useState)(!1),[ex,eh]=(0,i.useState)(null),[ef,eg]=(0,i.useState)({}),[ey,eb]=(0,i.useState)([]),[ev,ej]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)({}),[eN,eC]=(0,i.useState)(""),[eS,eA]=(0,i.useState)(()=>new Set),[eT,e$]=(0,i.useState)(!1),[eO,eP]=(0,i.useState)([]),[eI,eE]=(0,i.useState)("__none__"),[eR,eD]=(0,i.useState)(!1),[e_,eM]=(0,i.useState)(null),[ez,eq]=(0,i.useState)(""),[eU,eF]=(0,i.useState)("auto"),[eJ,eK]=(0,i.useState)("auto"),[eL,eH]=(0,i.useState)(""),[eB,eW]=(0,i.useState)({enabled:!1,connections:{}}),[eG,eV]=(0,i.useState)([]),[eQ,eZ]=(0,i.useState)([]),[eX,eY]=(0,i.useState)(null),[e0,e1]=(0,i.useState)([]),[e5,e2]=(0,i.useState)([]),[e3,e4]=(0,i.useState)([]),[e6,e8]=(0,i.useState)(!1),[e7,e9]=(0,i.useState)(null),[te,tt]=(0,i.useState)(!1),[ts,ta]=(0,i.useState)(!1),[ti,tr]=(0,i.useState)(!1),[tl,tn]=(0,i.useState)(null),[to,td]=(0,i.useState)({}),[tc,tm]=(0,i.useState)(null),tp=(0,i.useRef)(!1),[tu,tx]=(0,i.useState)(!1),[th,tf]=(0,i.useState)(!1),{copied:tg,copy:ty}=(0,S.C)(),tb="ag_risk_confirmed",tv=()=>{U(!0)},tj=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tb)?tt(!0):"xiaomi-mimo"===f?J(!0):tS?tv():(Q(""),W(!0))},tw=()=>{Q(""),W(!0)},tk=()=>{tS?tj():tw()},tN=I?{id:I.id,name:I.name||("anthropic-compatible"===I.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===I.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===I.type?"AC":"OC",apiType:I.apiType,baseUrl:I.baseUrl,type:I.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tC=tN?.authModes||[],tS=!!m.zN[f]||!!m.IS[f]||tC.includes("oauth"),tA=!!m.fg[f]||tC.includes("apikey"),tT=!!m.IS[f]?.noAuth,t$=(0,p.KC)(f),tO=("cursor"===f||"zed"===f)&&eQ.length>0?eQ:t$,tP=(0,m.wG)(f),tI=(0,m.mq)(f),tE=(0,m.gb)(f),tR=tI||tE,tD=!tR&&tS&&tA,t_="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tM="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tz=e=>{if(!eU||"auto"===eU)return null;let t=C(f,e);return t&&t.includes(eU)?eU:null},tq=tR?f:tP,tU=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=C(f,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tO)s(e.id);for(let e of e0)s(e.id);for(let e of ey)e.providerAlias===tq&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tF=tR?I?.prefix||f:tP,tJ=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tq)}`,{cache:"no-store"}),t=await e.json();e.ok&&e2(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tq]),tK=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(tq)}`,{cache:"no-store"}),t=await e.json();e.ok&&e4(t.ids||[])}catch(e){console.log("Error fetching enabled models:",e)}},[tq]),tL=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tq,ids:[e]})})).ok&&await tJ()}catch(e){console.log("Error disabling model:",e)}},tH=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tq)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tJ()}catch(e){console.log("Error enabling model:",e)}},tB=async e=>{e.length&&e9({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e9(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tq,ids:e})})).ok&&await tJ()}catch(e){console.log("Error disabling all models:",e)}}})},tW=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tq)}`,{method:"DELETE"})).ok&&await tJ()}catch(e){console.log("Error enabling all models:",e)}},tG=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&eg(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tV=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eb(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e1(e.models)}).catch(()=>{})},[f]);let tQ=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(f)}`,{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),r=await t.json(),l=await s.json(),n=a.ok?await a.json():{};e.ok&&b(i.connections||[]),s.ok&&z(l.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};eM(o.fallbackStrategy||null),eq(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eF(d.mode||"auto");let c=(n.retryDelayByProvider||{})[f];eK(null!=c&&"auto"!==c?String(c):"auto");let m=(n.rpmByProvider||{})[f];eH(null!=m?String(m):"");let p=em[f],u=p&&n[p]||{};if(eW({enabled:!0===u.enabled,connections:u.connections||{}}),t.ok){let e=(r.nodes||[]).find(e=>e.id===f)||null;if(!e&&tR)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===f)||null))break}E(e)}}catch(e){console.log("Error fetching connections:",e)}finally{$(!1)}},[f,tR]),tZ=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(E(s.node),await tQ(),eo(!1))}catch(e){console.log("Error updating provider node:",e)}},tX=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let r={...a};0===Object.keys(i).length?delete r[f]:r[f]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}},tY=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t0=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?s[f]=Number(e):delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:s})})}catch(e){console.log("Error saving retry delay:",e)}},t1=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).rpmByProvider||{}},a=String(e??"").trim();""===a?delete s[f]:s[f]=Math.max(0,Number(a)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:s})})}catch(e){console.log("Error saving RPM limit:",e)}},t5=async e=>{let t=em[f];if(t){eW(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,i.useEffect)(()=>{tQ(),tG(),tV(),tJ(),tK()},[tQ,tG,tV,tJ,tK]),(0,i.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eZ([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eZ([]),"zed"===f&&eY(null);return}let t=!1;return"zed"===f&&eY(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eZ(s.models),"zed"===f&&s?.warning&&eY(s.warning);return}"zed"===f&&(eZ([]),eY(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eZ([]),eY("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,i.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&O(e).then(eV)},[f]);let t2=async(e,t,s=tP)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tG();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t3=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tG()}catch(e){console.log("Error deleting alias:",e)}},t4=async(e,t="llm",s=tq,a,i)=>{try{let r=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...a?{caps:a}:{},...i?{transport:i}:{}})}),l=await r.json().catch(()=>({}));r.ok?(!1===l.added&&alert("Model already exists (duplicate). Check built-in or custom list."),await tV(),window.dispatchEvent(new CustomEvent("customModelChanged"))):alert(l.error||"Failed to add custom model")}catch(e){console.log("Error adding custom model:",e),alert(e.message||"Failed to add custom model")}},t6=async(e,t="llm",s=tq)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t8=async()=>{if(tu)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Qoder connection first"));tx(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");ey.some(e=>e.providerAlias===tq&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tq}/${s}`)||(await t4(s,"llm",tq),i+=1)}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tx(!1)}},t7=async()=>{if(th)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Cline connection first"));tf(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;t&&(ey.some(e=>e.providerAlias===tq&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tq}/${t}`)||(await t4(t,"llm",tq),i+=1))}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tf(!1)}},t9=async()=>{if(ts||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));tp.current=!1,ta(!0),tr(!1),tn(null),td(e),tm({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(tp.current){tm({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=y[e];tn(a.id),td(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),r=!!i.valid;r?t+=1:s+=1,td(e=>({...e,[a.id]:{state:r?"success":"failed",error:r?null:i.error||null}}))}catch(e){s+=1,td(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tm({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tn(null),ta(!1),tr(!1),tp.current=!1}},se=async e=>{e9({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e9(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},st=()=>{tQ(),U(!1)},ss=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok)return await tQ(),!0;Q(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Q("Failed to save connection")}return!1},sa=async e=>{try{(await fetch(`/api/providers/${ex.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tQ(),er(!1))}catch(e){console.log("Error updating connection:",e)}},si=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sr=async(e,t)=>{let s=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to save fast mode");b(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,fastMode:t}}:s))},sl=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tQ()}},sn=y.filter(e=>eO.includes(e.id));(0,i.useEffect)(()=>{eP(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===sn.length)return;let e=new Set(sn.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=D.find(e=>e.id===t);return s?.name}})();let so=()=>{eR||eu(!1)},sd=async e=>{eD(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tQ(),eu(!1)}finally{eD(!1)}},sc=e=>sd(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:sm,items:sp,start:su}=function(e=[],t=1,s=10){let a=Array.isArray(e)?e:[],i=Number.isFinite(s)&&s>=1?Math.floor(s):10,r=a.length,l=Math.max(1,Math.ceil(r/i)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,l),d=(o-1)*i,c=a.slice(d,d+i);return{currentPage:o,totalPages:l,totalItems:r,start:d,items:c,pageSize:i}}(y,v,w),sx=new Set(sp.map(e=>e.id)),sh=sp.length>0&&sp.every(e=>eO.includes(e.id)),sf=(0,a.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[sp.map((e,t)=>{let s,i=su+t;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eO.includes(s)),onChange:()=>{var t;return t=e.id,void eP(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,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(L,{connection:e,proxyPools:D,isOAuth:tS,isFirst:0===i,isLast:i===y.length-1,onMoveUp:()=>sl(i,i-1),onMoveDown:()=>sl(i,i+1),onToggleActive:t=>si(e.id,t),fastMode:tN?.fastMode?{on:e.providerSpecificData?.fastMode===!0,onToggle:t=>sr(e.id,t)}:null,autoPing:em[f]&&"oauth"===e.authType?{on:!0===eB.connections[e.id],onToggle:t=>{var s;return s=e.id,void t5({...eB,connections:{...eB.connections,[s]:t}})},provider:f}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{eh(e),er(!0)},onReconnect:()=>{"iflow"===f?H(!0):U(!0)},onDelete:()=>se(e.id),oneByOneStatus:to[e.id]||null})})]},e.id)}),y.length>10&&(0,a.jsx)(c.dK,{currentPage:sm,pageSize:w,totalItems:y.length,onPageChange:j,onPageSizeChange:e=>{k(e),j(1)},allowCustomPageSize:!0,maxPageSize:200})]}),sg=D.filter(e=>!0===e.isActive),sy=(0,a.jsx)(c.aF,{isOpen:ed,onClose:so,title:`Apply Proxy (${y.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=D.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):sd(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eR||0===sg.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sc(null),disabled:eR,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(e=>(0,a.jsxs)("button",{onClick:()=>sc(e.id),disabled:eR||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eR&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(c.$n,{onClick:so,variant:"ghost",fullWidth:!0,disabled:eR,children:"Cancel"})]})}),sb=async e=>{if(!eS.has(e)){eA(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:`${tq}/${e}`})}),s=await t.json();ek(t=>({...t,[e]:s.ok?"ok":"error"})),eC(s.ok?"":s.error||"Model not reachable")}catch{ek(t=>({...t,[e]:"error"})),eC("Network error")}finally{eA(t=>{let s=new Set(t);return s.delete(e),s})}}};if(N)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]});if(!tN)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sv=()=>tI&&tN.apiType?"responses"===tN.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tE?"/providers/anthropic-m.png":(0,d.HY)(tN.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tN.color}15`},children:ev||!sv()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tN.color},children:tN.textIcon||tN.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:sv(),alt:tN.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tN.id),ej(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tN.name}),(tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website)&&(0,a.jsxs)("a",{href:tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tN.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]}),(0,a.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,a.jsx)("input",{type:"number",min:"0",value:eL,placeholder:String(m.W[f]||0),onChange:e=>eH(e.target.value),onBlur:e=>t1(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,a.jsx)("select",{value:eJ,onChange:e=>{var t;eK(t=e.target.value),t0(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:ep.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tN.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tN.deprecationNotice})]}),tN.notice?.text&&!tN.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tN.notice.text}),tN.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tN.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),tR&&I&&(0,a.jsx)(c.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tE?"Messages API":"responses"===I.apiType?"Responses API":"Chat Completions"," \xb7 ",(I.baseUrl||"").replace(/\/$/,""),"/",tE?"messages":"responses"===I.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),W(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>eo(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e9({title:"Delete Compatible Node",message:`Delete this ${tE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e9(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tT?(0,a.jsx)(c.gw,{providerId:f}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&D.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eu(!0),children:"Apply Proxy"}),y.length>0&&(0,a.jsxs)(a.Fragment,{children:[eO.length>0&&(0,a.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eO.length;0!==e&&e9({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e9(null);let e=0,t=[...eO];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eP([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eO.length,")"]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:t9,disabled:ts,children:ts?"Testing Connection One-by-One...":"Test Connection One-by-One"}),ts&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{ts&&(tp.current=!0,tr(!0))},disabled:ti,children:ti?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(c.lM,{checked:"round-robin"===e_,onChange:e=>{let t=e?"round-robin":null,s=e?ez||"1":ez;e&&!ez&&eq("1"),eM(t),tX(t,s)}}),(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium ml-2",children:"Cache Affinity"}),(0,a.jsx)(c.lM,{checked:"cache-affinity"===e_,onChange:e=>{let t=e?"cache-affinity":null;eM(t),tX(t,ez)}}),"round-robin"===e_&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:ez,onChange:e=>{var t;eq(t=e.target.value),tX("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]}),"codex"===f&&(0,a.jsx)(c.lM,{checked:codexFastMode,onChange:handleCodexFastModeChange,disabled:savingCodexFastMode,label:"Fast inference",description:"Use the priority tier for Codex models (all accounts). Per-account override lives on each connection row and quota card."}),"codex"===f&&codexFastModeError&&(0,a.jsx)("span",{className:"text-xs text-red-500",role:"alert",children:codexFastModeError})]})]}),(0,a.jsxs)("p",{className:"mb-4 -mt-1 text-xs text-text-muted",children:["Tip: pin requests to a specific account by sending the ",(0,a.jsx)("code",{children:"x-connection-id"})," request header with a connection ID — click the ID chip on a connection to copy it. When the pinned account is unavailable, EzRouter falls back to the other accounts automatically."]}),0===y.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tS?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tD&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",t_," or ",tM,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,children:tM})]}):(0,a.jsxs)(a.Fragment,{children:[!tR&&"iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),children:(0,T.Tl)("Bulk Add")}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,children:tR?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tc&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",tc.total]}),(0,a.jsxs)("span",{children:["Completed: ",tc.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tc.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tc.failed]}),tc.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),ts&&tl&&(0,a.jsxs)("span",{children:["Running: ",y.find(e=>e.id===tl)?.name||tl]})]})}),y.length>0&&(0,a.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,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:sh,onChange:()=>{sh?eP(e=>e.filter(e=>!sx.has(e))):eP(e=>{let t=new Set(e);for(let e of sx)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sf,!tR&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,T.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),title:(0,T.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,className:"w-full sm:w-auto",children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,className:"w-full sm:w-auto",children:tM})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsx)(ec,{providerId:f}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tU&&(0,a.jsx)("select",{value:eU,onChange:e=>{var t;eF(t=e.target.value),tY(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:tU.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tR&&(e=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e5.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[e5.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tW,children:"Active All"}),e.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tB(e),children:"Disable All"})]}))]}),!!eN&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:eN}),/RegionError|hosted in China|regionNotAllowed/i.test(eN)&&(s=(t="string"==typeof eN?eN:JSON.stringify(eN)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),l=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:l?`https://opencode.ai/workspace/${l[0]}/go`:"https://opencode.ai",(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,a.jsx)("span",{children:"Allow China-hosted models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eX&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eX}),(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>e8(!0),className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-main transition-colors hover:border-primary/40 hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"visibility"}),"Visible models",e3.length>0?` (${e3.length})`:""]}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:e3.length>0?`Only these ${e3.length} models are exposed on /v1/models`:"All models are exposed on /v1/models"})]}),(()=>{let e,t,s;if(tR)return(0,a.jsx)(_,{providerStorageAlias:tq,providerDisplayAlias:tF,modelAliases:ef,customModels:ey,copied:tg,onCopy:ty,onSetAlias:t2,onDeleteAlias:t3,onAddCustomModel:e=>t4(e,"llm",tq),onDeleteCustomModel:e=>t6(e,"llm",tq),connections:y,isAnthropic:tE});let i=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),r=new Set(e5),l=i.filter(e=>!r.has(e.id)),n=i.filter(e=>r.has(e.id)),o=P({customModels:ey,modelAliases:ef,providerAlias:tq,builtInModels:tO,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,a.jsx)(R,{model:{id:e.id,name:e.name},fullModel:`${tF}/${e.id}`,alias:e.alias,copied:tg,onCopy:ty,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t6(e.id,"llm",tq):t3(e.alias)},testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tz(e.id)},`${e.source}-${e.fullModel}`)),l.map(e=>{let t=`${tq}/${e.id}`,s=`${f}/${e.id}`,i=Object.entries(ef).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(R,{model:e,fullModel:`${tF}/${e.id}`,alias:i,copied:tg,onCopy:ty,onSetAlias:t=>t2(e.id,t,tq),onDeleteAlias:()=>t3(i),testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isFree:e.isFree,onDisable:()=>tL(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tz(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>e$(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===f||"qoder-cn"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t8,disabled:tu,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tu?{animation:"spin 1s linear infinite"}:void 0,children:tu?"progress_activity":"download"}),tu?(0,T.Tl)("Fetching..."):(0,T.Tl)("Fetch Qoder Models")]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t7,disabled:th,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:th?{animation:"spin 1s linear infinite"}:void 0,children:th?"progress_activity":"download"}),th?(0,T.Tl)("Fetching..."):(0,T.Tl)("Import from /models")]}),eG.length>0&&(e=new Set([...Object.values(ef),...o.map(e=>e.fullModel)]),t=new Set(tO.map(e=>e.id)),0===(s=eG.filter(s=>!e.has(`${tq}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t4(e.id,"llm",tq)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>tH(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),sy,"kiro"===f?(0,a.jsx)(c.Mh,{isOpen:q,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"cursor"===f?(0,a.jsx)(c.G9,{isOpen:q,onSuccess:st,onClose:()=>U(!1)}):"zed"===f?(0,a.jsx)(c.TE,{isOpen:q,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"gitlab"===f?(0,a.jsx)(c.vj,{isOpen:q,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):(0,a.jsx)(c.LF,{isOpen:q,provider:f,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}),(0,a.jsx)(c.LH,{isOpen:F,onSuccess:st,onClose:()=>J(!1)}),"iflow"===f&&(0,a.jsx)(c.vE,{isOpen:K,onSuccess:()=>{tQ(),H(!1)},onClose:()=>H(!1)}),B&&(0,a.jsx)(V,{isOpen:B,provider:f,providerName:tN.name,isCompatible:tR,isAnthropic:tE,authType:tN?.authType,authHint:tN?.authHint,website:tN?.website,proxyPools:D,error:G,existingNames:y.map(e=>e.name).filter(Boolean),onSave:ss,onBulkDone:tQ,onClose:()=>{Q(""),W(!1)}}),(0,a.jsx)(c.wI,{isOpen:ei,connection:ex,proxyPools:D,onSave:sa,onClose:()=>er(!1)}),tR&&(0,a.jsx)(Y,{isOpen:en,node:I,onSave:tZ,onClose:()=>eo(!1),isAnthropic:tE}),!tR&&(0,a.jsx)(et,{isOpen:eT,providerAlias:tq,providerDisplayAlias:tF,onSave:async(e,t,s)=>{await t4(e,t?.stt?"stt":"llm",tq,t,s),e$(!1)},onClose:()=>e$(!1)}),e6&&(0,a.jsx)(M,{isOpen:!0,onClose:()=>e8(!1),providerId:f,providerAlias:tq,connections:y,customModels:ey,disabledModelIds:e5,onSaved:e=>{e4(e),tJ()}}),"codex"===f&&(0,a.jsx)(ea,{isOpen:Z,onClose:()=>X(!1),onSuccess:tQ}),"grok-cli"===f&&(0,a.jsx)(el,{isOpen:ee,onClose:()=>es(!1),onSuccess:tQ}),(0,a.jsx)(c.uo,{isOpen:te,onClose:()=>tt(!1),onConfirm:()=>{(window.localStorage.setItem(tb,"true"),tt(!1),tS)?tv():tw()},title:"Risk Notice",message:tN?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(c.uo,{isOpen:!!e7,onClose:()=>e9(null),onConfirm:e7?.onConfirm,title:e7?.title||"Confirm",message:e7?.message,variant:"danger"})]})}},64827:(e,t,s)=>{"use strict";function a(e){if(!e)return null;let t=null,s=Date.now();for(let[a,i]of Object.entries(e)){if(!a.startsWith("modelLock_")||!i)continue;let e=new Date(i).getTime();e<=s||(!t||e<t)&&(t=e)}return t?new Date(t).toISOString():null}s.d(t,{kJ:()=>a}),s(10904)},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},85295:(e,t,s)=>{Promise.resolve().then(s.bind(s,59736))}},e=>{e.O(0,[763,5772,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{14558:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var r=a(95155),s=a(12115),i=a(97677);function n({connectionId:e,disabled:t=!1,onComplete:a}){let[l,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null);async function u(){if(!l){if(d)return void c(null);o(!0);try{let t=await fetch("/api/wakeup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ping",connectionId:e})}),r=await t.json();if(!t.ok)throw Error(r.error||"Ping failed.");c(r),a&&Promise.resolve(a()).catch(()=>{})}catch(e){c({status:"failed",message:e.message})}finally{o(!1)}}}let m=l?"Pinging…":d?`${d.message} Click to reset.`:"Ping now — sends a small request. Consumes quota; does not change Auto-Ping.",x=d?"succeeded"===d.status?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400":"text-text-muted hover:text-primary";return(0,r.jsx)(i.default,{text:m,children:(0,r.jsx)("button",{type:"button",onClick:u,disabled:l||t&&!d,"aria-label":m,"aria-busy":l,className:`flex h-8 w-8 items-center justify-center rounded-lg ${x} hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50`,children:(0,r.jsx)("span",{"aria-hidden":"true",style:{fontSize:l?20:32},className:`material-symbols-outlined ${l?"animate-spin":""}`,children:l?"progress_activity":"play_arrow"})})})}},62022:(e,t,a)=>{Promise.resolve().then(a.bind(a,76436)),Promise.resolve().then(a.bind(a,25086))},76436:(e,t,a)=>{"use strict";a.d(t,{default:()=>W});var r=a(95155),s=a(12115),i=a(73321),n=a(57250),l=a(14558),o=a(89523);let d="quotaCacheData",c="quotaAutoRefresh",u="quotaTrackerPreferences",m=[10,20,50,100],x=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],p=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function h(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function b(e,t){let a=t[e.id]?.quotas?.[0];return a&&"number"==typeof a.remaining?a.remaining:1/0}function g(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function f(e,t){let a=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>a.has(e)))}async function y(e,t){return await e(t)}function v(){try{let e=window.localStorage.getItem(d);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function w(e,t){try{let a=v();a[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(d,JSON.stringify(a))}catch(e){console.error("Error writing quota cache:",e)}}function k(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function j(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function N(e,t,a){let r=a?.[e]||{};return r.connections?.[t]||r}function S(e,t,a,r={},s=!0){let i=j(a);if(!e||!t||!i)return r;let n=r[e]||{},l=N(e,t,r),o=new Set(Array.isArray(l.hidden)?l.hidden.map(e=>String(e).trim()).filter(Boolean):[]);if(s?o.add(i):o.delete(i),"antigravity"===e)for(let e of o)("gemini"===i&&e.startsWith("gemini-")&&!e.includes("image")||"claude"===i&&e.startsWith("claude-"))&&o.delete(e);return{...r,[e]:{...n,connections:{...n.connections,[t]:{...n.connections?.[t],hidden:[...o]}}}}}function C(e,t,a=[],r){let s=N(e,r,t).hidden;return Array.isArray(s)&&0!==s.length?new Set((a.length>0?function(e=[],t=[]){if(!Array.isArray(e)||0===e.length)return[];let a=new Set(t.map(j).filter(Boolean));return[...new Set(e.map(e=>String(e).trim()).filter(e=>a.has(e)))]}(s,a):s).map(String)):new Set}let A={green:{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"},yellow:{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"},red:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"}};function P({quotas:e=[],compact:t=!1,sortMode:a="default",showSortLabel:i=!1,onHideQuota:n=null}){let[l,o]=(0,s.useState)(1),d=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):k(e?.used,e?.total)})),[e]),c=(0,s.useMemo)(()=>"remaining-asc"===a?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===a?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,a]),u=Math.max(1,Math.ceil(c.length/10));if((0,s.useEffect)(()=>{o(1)},[a,e]),(0,s.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,p=Math.min(10*l,c.length),h=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",y="function"==typeof n;return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),i&&(0,r.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,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsx)("table",{className:"w-full table-fixed text-left",children:(0,r.jsx)("tbody",{children:m.map(e=>{var a;let s=!0===e.unlimited,i=!0===e.isCreditBalance,l=i?{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500",bgLight:"bg-blue-500/10",emoji:"\uD83D\uDCB0"}:A[(a=e.remaining)>70?"green":a>=30?"yellow":"red"],o=e.neverExpires?"-":function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,a=new Date,r=t-a;if(r<=0)return"-";let s=Math.ceil(r/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),n=s%60;if(i<24)return`${i}h ${n}m`;let l=Math.floor(i/24);return`${l}d ${i%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),d=!e.neverExpires&&!e.resetAt&&!!e.detailUrl,c=e.neverExpires?"Never expires":d?"See details":function(e){if(!e)return null;try{let t=new Date(e),a=new Date,r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(r);s.setDate(s.getDate()+1);let i="";i=t>=r&&t<s?"Today":t>=s&&t<new Date(s.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`${i}, ${n}`}catch{return null}}(e.resetAt),u=d&&e.detailUrl?e.detailUrl:c,m=!1!==e.recurring?`in ${o}`:`expires in ${o}`,x=t=>d?(0,r.jsxs)("a",{href:e.detailUrl,target:"_blank",rel:"noopener noreferrer",className:`${t} inline-flex items-center gap-0.5 hover:text-text-primary hover:underline`,title:`Open usage details: ${u}`,"aria-label":`Open usage details for ${e.name}`,children:[c,(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]}):c;return(0,r.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,r.jsx)("td",{className:`${h} w-[30%]`,children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"text-[10px] shrink-0",children:l.emoji}),(0,r.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name}),e.runtimeLimited&&(e.runtimeActionUrl?(0,r.jsx)("a",{href:e.runtimeActionUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 underline decoration-dotted underline-offset-2 dark:text-amber-400",title:e.runtimeLimitReason||"Verify this Google account, then retry the model.",children:e.runtimeLimitLabel||"account blocked"}):(0,r.jsx)("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400",title:e.runtimeLimitReason||"The provider runtime rejected this model even though the quota endpoint still reports capacity.",children:e.runtimeLimitLabel||"runtime limit"}))]})}),(0,r.jsx)("td",{className:`${h} w-[45%]`,children:(0,r.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[!s&&!i&&(0,r.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${l.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,r.jsx)("div",{className:`h-full transition-all duration-300 ${l.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,r.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,r.jsx)("span",{className:"text-text-muted",children:s?`${e.used.toLocaleString()} used \xb7 Unlimited`:i?`Credit: ${e.total.toFixed(2)} ${e.name.split(" ")[2]||""}`:e.percentageOnly?(0,r.jsx)("span",{title:e.quotaNote||"The provider does not expose an absolute request count.",children:"count unavailable"}):(0,r.jsxs)(r.Fragment,{children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞",e.unit?` ${e.unit}`:""]})}),(0,r.jsx)("span",{className:`font-medium ${s?"text-green-600 dark:text-green-400":i?"text-blue-600 dark:text-blue-400":l.text}`,children:s?"Unlimited":i?"":`${e.remaining}%`})]})]})}),(0,r.jsx)("td",{className:`${h} ${y?"w-[20%]":"w-[25%]"}`,children:"-"!==o||c?t?(0,r.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:u||"",children:"-"!==o?m:x(g)}):(0,r.jsxs)("div",{className:"space-y-0.5",children:["-"!==o&&(0,r.jsx)("div",{className:`${g} text-text-primary font-medium`,children:m}),c&&(0,r.jsx)("div",{className:`${f} text-text-muted`,children:x(f)})]}):(0,r.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),y&&(0,r.jsx)("td",{className:`${h} w-[5%] text-right`,children:(0,r.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 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,r.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})})]},`${e.name}-${e.index}`)})})})}),u>1&&(0,r.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,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,r.jsxs)("span",{children:["Showing ",x,"-",p," of ",c.length]}),(0,r.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,r.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,r.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 $=a(98542),q=a(97677),E=a(84588),_=a(35497),T=a(88105),M=a(11059),D=a(78177);let O={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},F={claude:"claudeAutoPing",codex:"codexAutoPing"},L={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 request to an available model. Consumes a small amount of quota."};function I(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function R(e){let t=e.providerSpecificData?.region;if(t)return t;let a=e.providerSpecificData?.profileArn;return("string"==typeof a?a.split(":")[3]:"")||""}let U={five_hour:"session",seven_day:"weekly",seven_day_overage_included:"weekly",seven_day_opus:"Opus weekly",seven_day_sonnet:"Sonnet weekly"};function z(e){let t=[...new Set((e||[]).map(e=>U[e]).filter(Boolean))];return t.length?`${t.join(" + ")} limits`:"limits"}function J(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"}function B(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 a=Math.ceil(t/36e5),r=Math.floor(a/24),s=a%24;return r>0?`${r}d ${s}h`:`${s}h`}function W(){let{copied:e,copy:t}=(0,M.C)(),a=(0,i.useSearchParams)(),N=(0,i.useRouter)(),A=(0,i.usePathname)(),[U,W]=(0,s.useState)([]),[K,H]=(0,s.useState)({}),[G,V]=(0,s.useState)({}),[Q,X]=(0,s.useState)({}),[Y,Z]=(0,s.useState)(!0),[ee,et]=(0,s.useState)({claude:{},codex:{}}),[ea,er]=(0,s.useState)(null),[es,ei]=(0,s.useState)(!1),[en,el]=(0,s.useState)(!1),[eo,ed]=(0,s.useState)(!1),[ec,eu]=(0,s.useState)(60),[em,ex]=(0,s.useState)(!0),[ep,eh]=(0,s.useState)(null),[eb,eg]=(0,s.useState)(null),[ef,ey]=(0,s.useState)(null),[ev,ew]=(0,s.useState)(null),[ek,ej]=(0,s.useState)(null),[eN,eS]=(0,s.useState)(null),[eC,eA]=(0,s.useState)(!1),[eP,e$]=(0,s.useState)(null),[eq,eE]=(0,s.useState)([]),[e_,eT]=(0,s.useState)(()=>a?.get("provider")||"all"),eM=(0,s.useCallback)(e=>{eT(e);try{let t=new URLSearchParams(a?.toString()||"");"all"===e?t.delete("provider"):t.set("provider",e);let r=t.toString()?`${A}?${t.toString()}`:A;N.replace(r,{scroll:!1})}catch{}},[A,N,a]),[eD,eO]=(0,s.useState)([]),[eF,eL]=(0,s.useState)("all"),[eI,eR]=(0,s.useState)("default"),[eU,ez]=(0,s.useState)({}),[eJ,eB]=(0,s.useState)(!1),[eW,eK]=(0,s.useState)(!1),[eH,eG]=(0,s.useState)(!1),[eV,eQ]=(0,s.useState)(1),[eX,eY]=(0,s.useState)(20),[eZ,e0]=(0,s.useState)(String(20)),[e1,e5]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[e2,e3]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),e4=(0,s.useRef)(0),e8=(0,s.useCallback)(async(e=eV)=>{try{var t,a;let r=new URLSearchParams({page:String(e),pageSize:String(eX),accountStatus:eF,sort:"priority"});"all"!==e_&&r.set("provider",e_);let s=await fetch(`/api/providers/client?${r.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),n=i.connections||[],l=(t=i.pagination,t||{page:1,pageSize:eX,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,n.length);return W(n),eO(i.providerOptions||[]),e5(l),e3(o),eQ((a=i.pagination,a?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),W([]),eO([]),e5({page:1,pageSize:eX,total:0,totalPages:1}),e3({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eF,eJ,eV,eX,e_]),e6=(0,s.useCallback)(async(e,t,{force:a=!1}={})=>{V(t=>({...t,[e]:!0})),X(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=`/api/usage/${e}${a?"?force=1":""}`,s=await fetch(r);if(!s.ok){let a=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===s.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};H(t=>({...t,[e]:r})),w(e,r);return}throw Error(`HTTP ${s.status}: ${a}`)}let i=await s.json();console.log(`[ProviderLimits] Got quota for ${t}:`,i);let n={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let a=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.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),r=new Set(["gemini_weekly","claude_gpt_weekly"]),s=new Set(["gemini_session","claude_gpt_session"]),i=new Set([...r,...s]),n=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),l=e.filter(([e])=>e.startsWith("claude-")),o=e.filter(([e])=>e.includes("image")),d=e.filter(([e])=>i.has(e)),c=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.includes("image")&&!i.has(e)),u=!!t.quotas.gemini_weekly,m=!!t.quotas.gemini_session,x=!!t.quotas.claude_gpt_weekly,p=!!t.quotas.claude_gpt_session;if(m)d.filter(([e])=>"gemini_session"===e).forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(n.length>0){let e=n.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],r=t.quotas.gemini_weekly?.resetAt;u&&e.resetAt===r&&(e.remainingPercentage??0)===0||a.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}if(u&&d.filter(([e])=>"gemini_weekly"===e).forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),p)d.filter(([e])=>"claude_gpt_session"===e).forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(l.length>0){let e=l.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],r=t.quotas.claude_gpt_weekly?.resetAt;x&&e.resetAt===r&&(e.remainingPercentage??0)===0||a.push({name:"Claude (Sonnet / Opus)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}x&&d.filter(([e])=>"claude_gpt_weekly"===e).forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),o.forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),x||p||c.forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let r=e;"spark_session"===e?r="Spark (5h)":"spark_weekly"===e?r="Spark (Weekly)":"session"===e?r="5h":"weekly"===e?r="Weekly":"review_session"===e?r="Review (5h)":"review_weekly"===e&&(r="Review (Weekly)"),a.push({name:r,quotaType: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])=>{a.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])=>{t&&0!==(Number(t.total)||0)&&a.push({name:"user"===e?"Personal":"organization"===e?"Organization":"addOn"===e?"Add-on":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null,neverExpires:!0===t.neverExpires,detailUrl:t.detailUrl||null})});break;case"claude":t.message?a.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.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:k(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.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])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.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])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"groq":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"clinepass":case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,isCreditBalance:t.isCreditBalance,currency:t.currency})});break;case"zed":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:t.unlimited})});break;case"minimax-code":case"minimax-code-global":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,remainingPercentage:t.remainingPercentage,resetAt:t.resetAt||null,message:t.message,isCreditBalance:t.isCreditBalance,currency:t.currency})})}}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 a.sort((t,a)=>(e[t.name]??99)-(e[a.name]??99)),a}let r=(0,o.KC)(e);if(r.length>0){let e=new Map(r.map((e,t)=>[e.id,t]));a.sort((t,a)=>{let r=t.modelKey||t.name,s=a.modelKey||a.name;return("gemini"===r||"gemini_session"===r)&&(r="gemini-3.8-flash-high"),("claude"===r||"claude_gpt_session"===r)&&(r="claude-sonnet-4-6"),("gemini"===s||"gemini_session"===s)&&(s="gemini-3.8-flash-high"),("claude"===s||"claude_gpt_session"===s)&&(s="claude-sonnet-4-6"),(e.get(r)??999)-(e.get(s)??999)})}return a}(t,i),plan:i.plan||null,message:i.message||null,raw:i};H(t=>({...t,[e]:n})),w(e,n)}catch(a){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,a),X(t=>({...t,[e]:a.message||"Failed to fetch quota"}))}finally{V(t=>({...t,[e]:!1}))}},[]),e7=(0,s.useCallback)(async(e,t)=>{await e6(e,t,{force:!0}),er(new Date)},[e6]),e9=(0,s.useCallback)(async(e,t)=>{if(("codex"===t||"claude"===t)&&!ev){ew(e),X(t=>({...t,[e]:null}));try{let a="claude"===t?await fetch(`/api/usage/${e}/claude-reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grantId:K[e]?.raw?.resetCredits?.nextGrantId})}):await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.message||r.error||r.code||"Failed to reset limit");await e6(e,t,{force:!0}),er(new Date)}catch(t){X(a=>({...a,[e]:t.message||"Failed to reset limit"}))}finally{ew(null)}}},[e6,ev,K]),te=(0,s.useCallback)((e,t)=>{eS({connection:e,loading:!1,error:null,data:{kind:"claude",...t}})},[]),tt=(0,s.useCallback)(async e=>{eS({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||a.message||"Failed to load Codex reset credits");let r=Array.isArray(a.credits)?[...a.credits]:[];r.sort((e,t)=>{let a=e.expiresAt?new Date(e.expiresAt).getTime():1/0,r=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return a-r}),eS({connection:e,loading:!1,error:null,data:{...a,credits:r}})}catch(t){eS({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),ta=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){eh(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){H(t=>{let a={...t};return delete a[e],a}),V(t=>{let a={...t};return delete a[e],a}),X(t=>{let a={...t};return delete a[e],a});try{let t=v();t[e]&&(delete t[e],window.localStorage.setItem(d,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await y(e8,eV)}}catch(e){console.error("Error deleting connection:",e)}finally{eh(null)}}},[e8,eV]),tr=(0,s.useCallback)(async(e,t)=>{eg(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(H(e=>({...e})),await y(e8,eV))}catch(e){console.error("Error updating connection status:",e)}finally{eg(null)}},[e8,eV]),ts=(0,s.useCallback)(async(e,t)=>{if(!ef){ey(e.id);try{let a=await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to save fast mode");W(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,fastMode:t}}:a))}catch(e){alert(e.message||"Failed to save fast mode")}finally{ey(null)}}},[ef]),ti=(0,s.useCallback)(async e=>{if(!eP?.id)return;let t=eP.id,a=eP.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await e8(),eA(!1),e$(null),T.wb.includes(a)&&await e6(t,a))}catch(e){console.error("Error saving connection:",e)}},[eP,e8,e6]),tn=(0,s.useCallback)(async(e,t,a)=>{let r=U.find(t=>t.id===e);if(!r)return;let s={...r.quotaPauseThresholds&&"object"==typeof r.quotaPauseThresholds?r.quotaPauseThresholds:{}},i=Number(a);Number.isFinite(i)&&i>0&&i<=100?s[t]=i:delete s[t];try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaPauseThresholds:s})})).ok&&W(t=>t.map(t=>t.id===e?{...t,quotaPauseThresholds:s}:t))}catch(e){console.error("Error updating quota threshold:",e)}},[U]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&eE(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let tl=(0,s.useCallback)(async(e=!1)=>{if(eo)return;ed(!0),eu(60);let t=e4.current+=1,a=Math.round(10);try{let r=await e8(eV),s=r.filter(r=>e||"claude"!==r.provider||t%a==0);V(g(s)),X(e=>f(e,r)),H(e=>f(e,r)),await Promise.all(s.map(e=>e6(e.id,e.provider))),er(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{ed(!1)}},[eo,e8,e6,eV]);(0,s.useEffect)(()=>{(async()=>{ex(!0);let e=await e8(eV);ex(!1),V(g(e)),X(t=>f(t,e)),H(t=>f(t,e)),await Promise.all(e.map(e=>e6(e.id,e.provider))),er(new Date)})()},[e8,e6,eV]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(c);Z(null===e||"true"===e),ei(!0)},[]),(0,s.useEffect)(()=>{es&&window.localStorage.setItem(c,String(Y))},[Y,es]),(0,s.useEffect)(()=>{try{let e=window.localStorage.getItem(u);if(e){let t=JSON.parse(e);if(t?.accountFilter&&["all","active","inactive"].includes(t.accountFilter)&&eL(t.accountFilter),t?.pageSize){let e=Number(t.pageSize);Number.isFinite(e)&&e>0&&(eY(e),e0(String(e)))}}}catch{}el(!0)},[]),(0,s.useEffect)(()=>{if(en)try{window.localStorage.setItem(u,JSON.stringify({accountFilter:eF,pageSize:eX}))}catch{}},[eF,eX,en]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{et({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),ez(e?.quotaVisibility||{})}).catch(()=>{})},[]);let to=(0,s.useCallback)(async(e,t,a)=>{let r=F[t];if(!r)return;let s={...ee[t]||{},[e]:a};et({...ee,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[r]||{},connections:s};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:t})})}catch{et(ee)}},[ee]),td=(0,s.useCallback)(async(e,t)=>{ez(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),ez(t)}},[]),tc=(0,s.useCallback)((e,t,a)=>{td(S(e,t,a,eU,!0),eU)},[eU,td]),tu=(0,s.useCallback)((e,t,a)=>{td(S(e,t,a,eU,!1),eU)},[eU,td]),tm=(0,s.useRef)(tl);(0,s.useEffect)(()=>{tm.current=tl},[tl]);let tx=(0,s.useMemo)(()=>(function({onRefresh:e,onTick:t,refreshIntervalMs:a,tickMs:r=1e3}){let s=null,i=null,n=()=>{null!==s&&(clearInterval(s),s=null),null!==i&&(clearInterval(i),i=null)};return{start:()=>{n(),s=setInterval(()=>e(),a),i=setInterval(()=>t(),r)},stop:n,isRunning:()=>null!==s||null!==i}})({onRefresh:()=>tm.current(),onTick:()=>eu(e=>e<=1?60:e-1),refreshIntervalMs:6e4}),[]);(0,s.useEffect)(()=>!es||!Y||"u">typeof document&&document.hidden?void tx.stop():(tx.start(),()=>tx.stop()),[Y,es,tx]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?tx.stop():Y&&es&&tx.start()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e),tx.stop()}},[Y,es,tx]);let tp=(0,s.useMemo)(()=>(function(e,t,a,r,s){if("codex"===r&&"default"!==s)return[...e].sort((e,a)=>{let r=b(e,t),i=b(a,t),n="remaining-asc"===s?r-i:i-r;return 0!==n?n:(h(e)||"").localeCompare(h(a)||"")});if(!a){let t=new Map;for(let a of e){let e=a.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(a)}return Array.from(t.values()).flat()}let i=e=>{let a=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return a.length>0?Math.min(...a):1/0};return[...e].sort((e,t)=>{let a=i(e)-i(t);return 0!==a?a:(e.provider||"").localeCompare(t.provider||"")||(h(e)||"").localeCompare(h(t)||"")})})(U,K,eJ,e_,eI),[U,K,eJ,e_,eI]),th=e=>{let t=K[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=k(e.used,e.total))},tb=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eH){eG(!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 y(e8,eV)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eG(!1)}}},[eH,e8,eV]),tg="all"===e_?"All providers":e_,tf=e2.eligibleConnections>0,ty=tp.length>0,tv=e2.eligibleConnections?e2.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"===e_?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eF?"turned off":"active"===eF?"active":"matching"} accounts found for ${e_}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},tw=function(e){var t;let{start:a,end:r}=(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 ${a}-${r} of ${e.total}`}(e1),tk=!m.includes(eX);return em||tf?em||ty?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>eK(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":eW,title:"Filter quota providers",children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===e_?(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,r.jsx)(n.A,{src:`/providers/${e_}.png`,alt:e_,size:18,className:"size-[18px] rounded object-contain",fallbackText:e_.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:tg})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eW&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eK(!1)}),(0,r.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,r.jsxs)("button",{type:"button",onClick:()=>{"all"!==e_&&eQ(1),eM("all"),eK(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===e_?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,r.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===e_&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,r.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,r.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:eD.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{e_!==e&&eQ(1),eM(e),eK(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${e_===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)(n.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"font-medium capitalize",children:e}),e_===e&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,r.jsx)("select",{value:eF,onChange:e=>{let t=e.target.value;eF!==t&&eQ(1),eL(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:x.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===e_&&(0,r.jsx)("select",{value:eI,onChange:e=>eR(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:p.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,r.jsxs)("button",{type:"button",onClick:()=>eB(e=>!e),"aria-pressed":eJ,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eJ?"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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{tb(tp.filter(e=>(e.isActive??!0)&&th(e)).map(e=>e.id),!1)},disabled:eH,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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{tb(tp.filter(e=>!(e.isActive??!0)&&!th(e)).map(e=>e.id),!0)},disabled:eH,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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,r.jsxs)("button",{onClick:()=>Z(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:Y?"Disable auto-refresh":"Enable auto-refresh",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Y?"text-primary":"text-text-muted"}`,children:Y?"toggle_on":"toggle_off"}),(0,r.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),Y&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",ec,"s)"]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>tl(!0),disabled:eo,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,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${eo?"animate-spin":""}`,children:"refresh"})})]})}),eJ&&(0,r.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."}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:tp.map(a=>{let s,i,o,d,c=K[a.id],u=G[a.id],m=Q[a.id],x=!1===a.isActive,p="codex"===a.provider,b=p?(s=c?.plan?.trim())&&"unknown"!==s.toLowerCase()?s:a?.providerSpecificData?.chatgptPlanType?.trim()||null:null,g="claude"===a.provider?c?.raw?.resetCredits:null,f=p?"Codex reset credit":"Claude limit reset",y=Number.isFinite(o="number"==typeof(i=c?.raw?.resetCredits?.availableCount)?i:Number(i))?Math.max(0,o):0,v=ev===a.id,w=ef===a.id,k=ep===a.id||eb===a.id||v||w,N=c?.quotas||[],S=function(e,t=[],a={},r){if(!Array.isArray(t)||0===t.length)return[];let s=C(e,a,t,r);return 0===s.size?t:t.filter(e=>!s.has(j(e)))}(a.provider,N,eU,a.id),A=function(e,t=[],a={},r){if(!Array.isArray(t)||0===t.length)return[];let s=C(e,a,t,r);return 0===s.size?[]:t.filter(e=>s.has(j(e)))}(a.provider,N,eU,a.id),M=(0,D.XD)(a);return(0,r.jsxs)(E.default,{padding:"none",className:`min-w-0 ${x?"opacity-60":""}`,children:[(0,r.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,r.jsx)(n.A,{src:`/providers/${a.provider}.png`,alt:a.provider,size:32,className:"object-contain",fallbackText:a.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:a.provider}),h(a)?(0,r.jsx)("p",{className:"text-xs text-text-muted truncate",children:h(a)}):null,I(a)?(0,r.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:I(a)}):null,b?(0,r.jsx)("span",{className:"mt-1 inline-flex rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:b}):null,M.enabled&&(0,r.jsx)("p",{className:"mt-0.5",children:(0,r.jsx)(_.Ex,{variant:M.paused?"warning":"default",size:"sm",children:M.paused?`Paused (quota${M.triggered?`: ${M.triggered.key}`:""})`:"Buffers set"})}),"kiro"===a.provider&&(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,r.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:(d=a.providerSpecificData?.authMethod)&&O[d]?O[d]:"api_key"===a.authType?"API Key":"OAuth"}),R(a)&&(0,r.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:R(a)}),(0,r.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${x?"bg-surface-2 text-text-muted":"active"===a.testStatus||"success"===a.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===a.testStatus||"expired"===a.testStatus||"unavailable"===a.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:x?"disabled":a.testStatus||"unknown"}),a.providerSpecificData?.profileArn&&(0,r.jsxs)("button",{type:"button",onClick:()=>t(a.providerSpecificData.profileArn,a.id),title:a.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,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===a.id?"check":"content_copy"}),(0,r.jsx)("code",{className:"truncate font-mono",children:a.providerSpecificData.profileArn})]})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(p||g)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q.default,{text:y>0?g?`Use your reset now (${y} left, use by ${J(g.expiresAt)}) \xb7 refills ${z(g.clears)}`:`Use one ${f}. Available: ${y}`:`No ${f}s available`,children:(0,r.jsxs)("button",{type:"button",onClick:()=>ej({connection:a,resetCreditCount:y}),disabled:y<=0||u||k,"aria-label":y>0?`Use one ${f}. ${y} available.`:`No ${f}s 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 ${y>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,r.jsx)("span",{className:`material-symbols-outlined text-[15px] ${v?"animate-spin":""}`,children:v?"progress_activity":"restart_alt"}),(0,r.jsx)("span",{children:y})]})}),(0,r.jsx)(q.default,{text:p?"View Codex reset credit expiry":"View Claude Code reset expiry",children:(0,r.jsx)("button",{type:"button",onClick:()=>p?tt(a):te(a,g),disabled:u||k,"aria-label":p?"View Codex reset credit expiry":"View Claude Code reset 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,r.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})}),T.Q2[a.provider]?.fastMode&&(0,r.jsx)(q.default,{text:`Fast mode is ${a.providerSpecificData?.fastMode===!0?"on":"off"}. Uses the provider's faster processing mode at a higher token cost.`,children:(0,r.jsxs)("button",{type:"button",onClick:()=>ts(a,a.providerSpecificData?.fastMode!==!0),disabled:u||k,role:"switch","aria-label":"Toggle fast mode","aria-checked":a.providerSpecificData?.fastMode===!0,className:`flex h-8 min-w-14 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${a.providerSpecificData?.fastMode===!0?"border-primary/30 bg-primary/10 text-primary":"border-black/10 text-text-muted hover:bg-black/5 hover:text-primary dark:border-white/10 dark:hover:bg-white/5"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${w?"animate-spin":""}`,children:w?"progress_activity":"speed"}),(0,r.jsx)("span",{children:"Fast"})]})})]}),F[a.provider]&&"oauth"===a.authType&&(0,r.jsx)(q.default,{text:L[a.provider],children:(0,r.jsx)("button",{type:"button",onClick:()=>to(a.id,a.provider,ee[a.provider]?.[a.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 ${ee[a.provider]?.[a.id]===!0?"text-primary":"text-text-muted"}`,children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),p&&(0,r.jsx)(q.default,{text:a.providerSpecificData?.codexFastMode===!0?"Fast mode ON — Codex requests on this account use the priority tier. Click to disable.":"Force fast mode — Codex requests on this account use the priority tier.",children:(0,r.jsx)("button",{type:"button",onClick:()=>ts(a),disabled:k,"aria-label":"Toggle fast mode",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${a.providerSpecificData?.codexFastMode===!0?"text-primary":"text-text-muted"}`,children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] ${fastModeId===a.id?"animate-spin":""}`,children:fastModeId===a.id?"progress_activity":"speed"})})}),F[a.provider]&&"oauth"===a.authType&&(0,r.jsx)(l.A,{connectionId:a.id,disabled:!1===a.isActive,onComplete:()=>e7(a.id,a.provider)}),(0,r.jsx)(q.default,{text:"Refresh quota",children:(0,r.jsx)("button",{type:"button",onClick:()=>e7(a.id,a.provider),disabled:u||k,"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,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${u?"animate-spin":""}`,children:"refresh"})})}),(0,r.jsx)(q.default,{text:"Edit connection",children:(0,r.jsx)("button",{type:"button",onClick:()=>{e$(a),eA(!0)},disabled:k,"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,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,r.jsx)(q.default,{text:"Delete connection",children:(0,r.jsx)("button",{type:"button",onClick:()=>ta(a.id),disabled:k,"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,r.jsx)("span",{className:`material-symbols-outlined text-[18px] ${ep===a.id?"animate-pulse":""}`,children:"delete"})})}),(0,r.jsx)("div",{className:"inline-flex items-center pl-0.5",title:a.isActive??!0?"Disable connection":"Enable connection",children:(0,r.jsx)($.default,{size:"sm",checked:a.isActive??!0,disabled:k,onChange:e=>tr(a.id,e)})})]})]})}),(0,r.jsxs)("div",{className:"px-2 py-1.5",children:[u?(0,r.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):m?(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:m})]}):c?.message?(0,r.jsx)("div",{className:"text-center py-5",children:(0,r.jsx)("p",{className:"text-xs text-text-muted",children:c.message})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P,{quotas:S,compact:!0,sortMode:"default",showSortLabel:"codex"===a.provider&&"default"!==eI,onHideQuota:e=>tc(a.provider,a.id,e)}),a.lastQuotaSnapshot?.windows?.length>0&&(0,r.jsxs)("div",{className:"mt-2 border-t border-black/5 pt-2 dark:border-white/5",children:[(0,r.jsx)("p",{className:"mb-1 text-[10px] text-text-muted",children:"Pause buffer — pause this account when a window's remaining % ≤"}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:a.lastQuotaSnapshot.windows.map(e=>{let t=Number(a.quotaPauseThresholds?.[e.key])||0;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11px] text-text-muted",title:e.key,children:e.key}),(0,r.jsx)("span",{className:"w-10 text-right text-[10px] tabular-nums text-text-muted",children:"number"==typeof e.remainingPercentage?`${e.remainingPercentage}%`:"—"}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"≤"}),(0,r.jsx)("input",{type:"number",min:0,max:100,value:t,onChange:t=>tn(a.id,e.key,Number.parseInt(t.target.value,10)||0),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px] focus:border-primary focus:outline-none","aria-label":`Pause buffer for ${e.key}`}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]},e.key)})})]})]}),c?.message&&!m&&!u&&(0,r.jsx)("p",{className:"mt-2 px-1 text-[10px] leading-relaxed text-text-muted",children:c.message}),c?.raw?.speed&&(0,r.jsx)("div",{className:"mt-1 px-1 text-[10px] leading-relaxed text-text-muted tabular-nums",children:(c.raw.speed.byModel?.length?c.raw.speed.byModel:[{model:"Speed",...c.raw.speed}]).slice(0,3).map(e=>(0,r.jsxs)("p",{children:[e.model,": ",Math.round(e.avgTps).toLocaleString()," tok/s avg \xb7 last ",Math.round(e.lastTps).toLocaleString()," \xb7 TTFT ",(e.avgTtftMs/1e3).toFixed(1),"s (n=",e.samples,")"]},e.model))}),A.length>0&&(0,r.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,r.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,r.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:A.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>tu(a.provider,a.id,e),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:e.name},j(e)))})]})]})]},a.id)})}),(0,r.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,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted",children:tw}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)("select",{value:tk?"custom":String(eX),onChange:e=>{let t=e.target.value;if("custom"===t)return;let a=Number.parseInt(t,10);Number.isFinite(a)&&(eQ(1),eY(a),e0(String(a)))},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:[m.map(e=>(0,r.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,r.jsx)("option",{value:"custom",children:"Custom"})]}),(0,r.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eZ,onChange:e=>e0(e.target.value),onBlur:()=>{let e=Number.parseInt(eZ,10);if(!Number.isFinite(e))return void e0(String(eX));let t=Math.min(500,Math.max(1,e));eQ(1),eY(t),e0(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eZ,10);if(!Number.isFinite(t))return void e0(String(eX));let a=Math.min(500,Math.max(1,t));eQ(1),eY(a),e0(String(a))},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,r.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",e1.page," / ",e1.totalPages]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>eQ(1),disabled:e1.page<=1||em||eo,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,r.jsx)("button",{type:"button",onClick:()=>eQ(e=>Math.max(1,e-1)),disabled:e1.page<=1||em||eo,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,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,r.jsx)("button",{type:"button",onClick:()=>eQ(e=>Math.min(e1.totalPages,e+1)),disabled:e1.page>=e1.totalPages||em||eo,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,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,r.jsx)("button",{type:"button",onClick:()=>eQ(e1.totalPages),disabled:e1.page>=e1.totalPages||em||eo,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,r.jsx)(_.uo,{isOpen:!!ek,onClose:()=>{ev||ej(null)},onConfirm:async()=>{let e=ek?.connection;e&&(await e9(e.id,e.provider),ej(null))},title:ek?.connection?.provider==="claude"?"Reset Claude limits?":"Reset Codex limit?",message:ek?.connection?.provider==="claude"?`Refills your ${z(K[ek.connection.id]?.raw?.resetCredits?.clears)} now for ${h(ek.connection)||"this account"} \xb7 your weekly reset day stays ${J(K[ek.connection.id]?.raw?.resetCredits?.weeklyResetsAt)}. This cannot be undone. Resets left: ${ek.resetCreditCount??0}.`:`Use 1 Codex reset credit for ${h(ek?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${ek?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!ev}),eN&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,r.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,r.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,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:eN.data?.kind==="claude"?"Claude Code Limit Resets":"Codex Reset Credit Expiry"}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:h(eN.connection)||(eN.data?.kind==="claude"?"Claude account":"Codex account")})]}),(0,r.jsx)("button",{type:"button",onClick:()=>eS(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,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,r.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:eN.loading?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):eN.error?(0,r.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:eN.error}):eN.data?.kind==="claude"&&eN.data.grants?.length?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.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,r.jsxs)("span",{children:[eN.data.availableCount??0," reset",1===eN.data.availableCount?"":"s"," left"]}),(0,r.jsxs)("span",{children:["Weekly reset day: ",J(eN.data.weeklyResetsAt)]})]}),(0,r.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,r.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,r.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Reset"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Left"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Refills"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Use By"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,r.jsx)("tbody",{children:(eN.data.grants||[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,r.jsxs)("td",{className:"px-3 py-2",children:[(0,r.jsx)("div",{className:"text-text-primary",children:e.label||e.id}),(0,r.jsx)("span",{className:"mt-1 inline-block rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.resetsLeft<=0?"used":e.paused?"paused":e.endsAt&&new Date(e.endsAt).getTime()<=Date.now()?"expired":e.usableNow?"usable now":e.startsAt&&new Date(e.startsAt).getTime()>Date.now()?"not started":e.useRequiresLimit?"at limit only":"unavailable"})]}),(0,r.jsxs)("td",{className:"whitespace-nowrap px-3 py-2 font-medium tabular-nums text-text-primary",children:[e.resetsLeft," / ",e.resetsTotal]}),(0,r.jsx)("td",{className:"px-3 py-2 text-text-muted",children:z(e.clears)}),(0,r.jsx)("td",{className:"px-3 py-2 text-text-primary",children:J(e.endsAt)}),(0,r.jsx)("td",{className:"whitespace-nowrap px-3 py-2 font-medium text-text-primary",children:B(e.endsAt)})]},e.id))})]})})]}):eN.data?.credits?.length?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.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,r.jsxs)("span",{children:[eN.data.credits.length," reset credit",1===eN.data.credits.length?"":"s"]}),(0,r.jsxs)("span",{children:[eN.data.availableCount??0," available"]})]}),(0,r.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,r.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,r.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,r.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,r.jsx)("tbody",{children:eN.data.credits.map((e,t)=>(0,r.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,r.jsx)("td",{className:"px-3 py-2 text-text-muted",children:J(e.grantedAt)}),(0,r.jsx)("td",{className:"px-3 py-2 text-text-primary",children:J(e.expiresAt)}),(0,r.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:B(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,r.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:eN.data?.kind==="claude"?"No limit resets available for this account.":"No reset credit details returned for this account."})})]})}),(0,r.jsx)(_.wI,{isOpen:eC,connection:eP,proxyPools:eq,onSave:ti,onClose:()=>{eA(!1),e$(null)}})]}):(0,r.jsx)(E.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:tv.icon}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:tv.title}),(0,r.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:tv.description})]})}):(0,r.jsx)(E.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,r.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."})]})})}}},e=>{e.O(0,[763,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=62022)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{29499:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(95155),n=s(12115),l=s(31474);function r({isOpen:e,onClose:t,title:s,children:i,width:d="md",className:o}){let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,l.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",c[d]||c.md,o),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:i})]})]}):null}},32554:(e,t,s)=>{Promise.resolve().then(s.bind(s,66989))},66989:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(95155),n=s(12115),l=s(73321),r=s(35497),i=s(36509),d=s(26186),o=s(84588),c=s(92542),x=s(29499),m=s(50378),p=s(31474),h=s(88105);let u=null,f=null;async function b(){if(u&&f)return{providerNameCache:u,providerNodesCache:f};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(f={},t))f[e.id]=e.name;return{providerNameCache:u={...h.Q2,...f},providerNodesCache:f}}function j(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,h.zt)(e)||h.Q2[e];return a?.name||e}function g({title:e,children:t,defaultOpen:s=!1,icon:l=null}){let[r,i]=(0,n.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:l}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,p.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function v(e){return e?.cached_tokens||e?.cache_read_input_tokens||0}function N(e){return e?.cache_creation_input_tokens||0}function k(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=v(e);return t<s?s:t}function w(){let[e,t]=(0,n.useState)([]),[s,l]=(0,n.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,i]=(0,n.useState)(!1),[d,h]=(0,n.useState)(null),[u,f]=(0,n.useState)(!1),[w,y]=(0,n.useState)([]),[S,C]=(0,n.useState)(null),[D,_]=(0,n.useState)({provider:"",startDate:"",endDate:""}),P=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();y(t.providers||[]);let s=await b();C(s.providerNameCache)}catch(e){console.error("Failed to fetch providers:",e)}},[]),L=(0,n.useCallback)(async()=>{i(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});D.provider&&e.append("provider",D.provider),D.startDate&&e.append("startDate",D.startDate),D.endDate&&e.append("endDate",D.endDate);let a=await fetch(`/api/usage/request-details?${e}`),n=await a.json();t(n.details||[]),l(e=>({...e,...n.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{i(!1)}},[s.page,s.pageSize,D]);return(0,n.useEffect)(()=>{P()},[P]),(0,n.useEffect)(()=>{L()},[L]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(o.default,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:D.provider,onChange:e=>_({...D,provider:e.target.value}),className:(0,p.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),w.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:D.startDate,onChange:e=>_({...D,startDate:e.target.value}),className:(0,p.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:D.endDate,onChange:e=>_({...D,endDate:e.target.value}),className:(0,p.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(c.default,{variant:"ghost",onClick:()=>{_({provider:"",startDate:"",endDate:""})},disabled:!D.provider&&!D.startDate&&!D.endDate,className:"w-full",children:"Clear Filters"})]})]})}),(0,a.jsxs)(o.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Input Guard"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cached"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cache Creation"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"10",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"10",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:j(e.provider,S)})}),(0,a.jsx)("td",{className:"p-4 text-center",children:e.convoy?.applied?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-500/15 px-2 py-1 text-xs text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"filter_alt"}),e.convoy.hits?.length||0," applied"]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Not applied"})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:k(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:v(e.tokens)>0?v(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:N(e.tokens)>0?N(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(c.default,{variant:"outline",size:"sm",onClick:()=>{h(e),f(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(m.default,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{l(t=>({...t,page:e}))},onPageSizeChange:e=>{l(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(x.A,{isOpen:u,onClose:()=>f(!1),title:"Request Details",width:"lg",children:d&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:d.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(d.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:j(d.provider,S)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:d.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,p.cn)("font-medium","success"===d.status?"text-green-600":"text-red-600"),children:d.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",d.latency?.ttft||0,"ms / Total ",d.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:k(d.tokens).toLocaleString()})]}),v(d.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cached Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:v(d.tokens).toLocaleString()})]}),N(d.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cache Creation:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:N(d.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:d.tokens?.completion_tokens?.toLocaleString()||0})]})]}),d.pxpipe&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"image"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"PXPIPE"}),(0,a.jsx)("span",{className:(0,p.cn)("text-xs px-2 py-0.5 rounded",d.pxpipe.applied?"bg-green-500/15 text-green-600":"bg-amber-500/15 text-amber-600"),children:d.pxpipe.applied?"Activated":"Skipped"})]}),d.pxpipe.applied?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm sm:grid-cols-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Original (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(d.pxpipe.tokensBeforeEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Compressed (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(d.pxpipe.tokensAfterEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Saved"}),(0,a.jsxs)("span",{className:"font-mono text-green-600",children:[d.pxpipe.savedPct||0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Images"}),(0,a.jsxs)("span",{className:"font-mono",children:[d.pxpipe.imageCount||0," (",d.pxpipe.durationMs||0,"ms)"]})]})]}):(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Reason: ",(0,a.jsx)("span",{className:"font-mono",children:d.pxpipe.reason}),d.pxpipe.detail?` — ${d.pxpipe.detail}`:""]})]}),d.convoy&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 p-4 dark:border-white/5",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"filter_alt"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Input Guard"}),(0,a.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${d.convoy.applied?"bg-green-500/15 text-green-600":"bg-black/5 text-text-muted dark:bg-white/5"}`,children:d.convoy.applied?"Applied":"No match"})]}),d.convoy.applied&&(0,a.jsx)("div",{className:"space-y-1 text-sm",children:(d.convoy.hits||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded bg-black/[0.02] px-3 py-2 dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-text-main",children:e.ruleName}),(0,a.jsxs)("span",{className:"font-mono text-xs text-text-muted",children:[e.count," match(es)"]})]},e.ruleId))})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(g,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(d.request,null,2)})}),d.providerRequest&&(0,a.jsx)(g,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(d.providerRequest,null,2)})}),d.providerResponse&&(0,a.jsx)(g,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof d.providerResponse?JSON.stringify(d.providerResponse,null,2):d.providerResponse})}),(0,a.jsxs)(g,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[d.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:d.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:d.response?.content||"[No content]"})]})]})]})})]})}let y=d.T1;function S(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(C,{})})}function C(){let e=(0,l.useSearchParams)(),t=(0,l.useRouter)(),[s,d]=(0,n.useState)("today"),o=e.get("tab"),c=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"relative z-20 shrink-0",children:(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:c,onChange:s=>{if(s===c)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-auto shrink-0"})}),"overview"===c&&(0,a.jsx)("div",{className:"flex min-w-0 flex-1 justify-end overflow-hidden",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)(r.Iz,{options:y,value:s,onChange:d,size:"sm",className:"min-w-max"})})})]}),"overview"===c&&(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(i.default,{period:s,setPeriod:d,hidePeriodSelector:!0})}),"logs"===c&&(0,a.jsx)(r.gM,{}),"details"===c&&(0,a.jsx)(w,{})]})}}},e=>{e.O(0,[763,8105,801,1321,5497,6509,8441,3794,7358],()=>e(e.s=32554)),_N_E=e.O()}]);