polyrouter 1.0.7 → 1.0.8

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 (1048) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +14 -11
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +27 -3
  5. package/app/.next-cli-build/required-server-files.json +3 -1
  6. package/app/.next-cli-build/routes-manifest.json +18 -0
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +2 -2
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/realtime/page.js +2 -2
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/realtime/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/realtime/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  80. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  91. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.rsc +20 -19
  95. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +20 -19
  96. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +9 -8
  98. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  101. package/app/.next-cli-build/server/app/api/analytics/installation/route.js +1 -0
  102. package/app/.next-cli-build/server/app/api/analytics/installation/route.js.nft.json +1 -0
  103. package/app/.next-cli-build/server/app/api/analytics/installation/route_client-reference-manifest.js +1 -0
  104. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/setup-password/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/setup-password/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  121. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  123. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  133. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  141. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  155. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  185. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  215. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  267. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  269. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  273. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  275. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  277. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  279. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  281. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  283. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  285. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  289. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/realtime/authorize/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/realtime/authorize/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/settings/public-telemetry/route.js +1 -0
  297. package/app/.next-cli-build/server/app/api/settings/public-telemetry/route.js.nft.json +1 -0
  298. package/app/.next-cli-build/server/app/api/settings/public-telemetry/route_client-reference-manifest.js +1 -0
  299. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  310. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  352. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  406. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  408. package/app/.next-cli-build/server/app/callback.html +1 -1
  409. package/app/.next-cli-build/server/app/callback.rsc +24 -23
  410. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +24 -23
  411. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +9 -8
  413. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +22 -21
  418. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  419. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +22 -21
  423. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +9 -8
  425. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +23 -22
  428. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +23 -22
  433. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +9 -8
  435. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/combos.rsc +25 -24
  438. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +25 -24
  443. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +9 -8
  445. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +23 -22
  448. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  452. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +23 -22
  453. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +9 -8
  455. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +25 -24
  458. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +25 -24
  464. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +9 -8
  466. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  467. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +22 -21
  469. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +22 -21
  474. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +9 -8
  476. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/profile.rsc +25 -24
  479. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +25 -24
  484. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +9 -8
  486. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  487. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +25 -24
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  491. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +25 -24
  495. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +9 -8
  497. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/providers.rsc +25 -24
  500. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  501. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  504. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +25 -24
  505. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +9 -8
  507. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  508. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +25 -24
  510. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  511. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  514. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +25 -24
  515. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +9 -8
  517. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +22 -21
  520. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +22 -21
  525. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +9 -8
  527. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  529. package/app/.next-cli-build/server/app/dashboard/quota.rsc +23 -22
  530. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  531. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  532. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  534. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +23 -22
  535. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +9 -8
  537. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  538. package/app/.next-cli-build/server/app/dashboard/realtime.html +1 -1
  539. package/app/.next-cli-build/server/app/dashboard/realtime.rsc +22 -21
  540. package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard/realtime/__PAGE__.segment.rsc +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard/realtime.segment.rsc +1 -1
  542. package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  543. package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  544. package/app/.next-cli-build/server/app/dashboard/realtime.segments/_full.segment.rsc +22 -21
  545. package/app/.next-cli-build/server/app/dashboard/realtime.segments/_head.segment.rsc +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/realtime.segments/_index.segment.rsc +9 -8
  547. package/app/.next-cli-build/server/app/dashboard/realtime.segments/_tree.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  549. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  550. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  551. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  552. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +24 -23
  553. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +24 -23
  554. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +9 -8
  556. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  557. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  559. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  560. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/skills.rsc +25 -24
  563. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  564. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +25 -24
  568. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +9 -8
  570. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  571. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +22 -21
  573. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  577. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +22 -21
  578. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +9 -8
  580. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  581. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  582. package/app/.next-cli-build/server/app/dashboard/translator.rsc +25 -24
  583. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  584. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  585. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  587. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +25 -24
  588. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  589. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +9 -8
  590. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  591. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  592. package/app/.next-cli-build/server/app/dashboard/usage.rsc +25 -24
  593. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  594. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  595. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  596. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  597. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +25 -24
  598. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  599. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +9 -8
  600. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  601. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  602. package/app/.next-cli-build/server/app/dashboard.rsc +23 -22
  603. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  604. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  605. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  606. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +23 -22
  607. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  608. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +9 -8
  609. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  610. package/app/.next-cli-build/server/app/index.html +1 -1
  611. package/app/.next-cli-build/server/app/index.rsc +19 -18
  612. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  613. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +19 -18
  614. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  615. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +9 -8
  616. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  617. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  618. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  619. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  620. package/app/.next-cli-build/server/app/landing.html +1 -1
  621. package/app/.next-cli-build/server/app/landing.rsc +24 -23
  622. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +24 -23
  623. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  624. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +9 -8
  625. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  626. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  627. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  628. package/app/.next-cli-build/server/app/login/page.js +2 -2
  629. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  630. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  631. package/app/.next-cli-build/server/app/login.html +1 -1
  632. package/app/.next-cli-build/server/app/login.rsc +24 -23
  633. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +24 -23
  634. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  635. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +9 -8
  636. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  637. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  638. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  639. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  640. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  641. package/app/.next-cli-build/server/app/page.js +2 -2
  642. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  643. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  644. package/app/.next-cli-build/server/app/privacy/page.js +2 -0
  645. package/app/.next-cli-build/server/app/privacy/page.js.nft.json +1 -0
  646. package/app/.next-cli-build/server/app/privacy/page_client-reference-manifest.js +1 -0
  647. package/app/.next-cli-build/server/app/privacy.html +1 -0
  648. package/app/.next-cli-build/server/app/privacy.meta +15 -0
  649. package/app/.next-cli-build/server/app/privacy.rsc +29 -0
  650. package/app/.next-cli-build/server/app/privacy.segments/_full.segment.rsc +29 -0
  651. package/app/.next-cli-build/server/app/privacy.segments/_head.segment.rsc +6 -0
  652. package/app/.next-cli-build/server/app/privacy.segments/_index.segment.rsc +11 -0
  653. package/app/.next-cli-build/server/app/privacy.segments/_tree.segment.rsc +4 -0
  654. package/app/.next-cli-build/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +8 -0
  655. package/app/.next-cli-build/server/app/privacy.segments/privacy.segment.rsc +5 -0
  656. package/app/.next-cli-build/server/app-paths-manifest.json +14 -11
  657. package/app/.next-cli-build/server/chunks/2116.js +1 -0
  658. package/app/.next-cli-build/server/chunks/2194.js +1 -1
  659. package/app/.next-cli-build/server/chunks/{9336.js → 2268.js} +1 -1
  660. package/app/.next-cli-build/server/chunks/2620.js +1 -1
  661. package/app/.next-cli-build/server/chunks/3259.js +9 -0
  662. package/app/.next-cli-build/server/chunks/3593.js +2 -2
  663. package/app/.next-cli-build/server/chunks/412.js +2 -2
  664. package/app/.next-cli-build/server/chunks/4491.js +5 -5
  665. package/app/.next-cli-build/server/chunks/4739.js +2 -2
  666. package/app/.next-cli-build/server/chunks/4780.js +2 -2
  667. package/app/.next-cli-build/server/chunks/5033.js +1 -1
  668. package/app/.next-cli-build/server/chunks/507.js +2 -2
  669. package/app/.next-cli-build/server/chunks/5258.js +2 -2
  670. package/app/.next-cli-build/server/chunks/5852.js +2 -2
  671. package/app/.next-cli-build/server/chunks/698.js +2 -2
  672. package/app/.next-cli-build/server/chunks/7965.js +2 -2
  673. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  674. package/app/.next-cli-build/server/chunks/8230.js +64 -0
  675. package/app/.next-cli-build/server/chunks/827.js +1 -1
  676. package/app/.next-cli-build/server/chunks/8520.js +2 -2
  677. package/app/.next-cli-build/server/chunks/869.js +1 -1
  678. package/app/.next-cli-build/server/chunks/9521.js +9 -0
  679. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  680. package/app/.next-cli-build/server/middleware.js +5 -5
  681. package/app/.next-cli-build/server/pages/404.html +1 -1
  682. package/app/.next-cli-build/server/pages/500.html +1 -1
  683. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  684. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  685. package/app/.next-cli-build/static/chunks/{1321-ee3f98a273573f07.js → 1321-b1e8e6c14a708408.js} +1 -1
  686. package/app/.next-cli-build/static/chunks/5497-37858806e4469f43.js +7 -0
  687. package/app/.next-cli-build/static/chunks/8500-f62a38ff68ab7f42.js +1 -0
  688. package/app/.next-cli-build/static/chunks/8591-1348966c1e442012.js +64 -0
  689. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-3c234678a806c268.js → page-03b2626d2312e74f.js} +1 -1
  690. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-263d8d95901d1f88.js → page-670266ac42d639dc.js} +1 -1
  691. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-3b24dec9f1a5c678.js → page-9d03ebc6b8993eb5.js} +1 -1
  692. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-7acfcc509629e32c.js → page-d159d9238efcc362.js} +1 -1
  693. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-4c392ebe647ab4dd.js → page-b47aed52431835b6.js} +1 -1
  694. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-2ab5b8a56273130e.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-c737bc25a827d251.js → page-e66ce23f65d9f152.js} +1 -1
  696. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-1a2ddf2207ca4693.js → page-640540825e168b50.js} +1 -1
  697. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-a5a465a0b9e8b60c.js → page-dc497ba0da1df139.js} +1 -1
  698. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-a46d3c46713ae921.js → page-e78f0c4c8720237c.js} +1 -1
  699. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-c58d1c164e3e7e8e.js → page-91cb73b1f2cba3eb.js} +1 -1
  700. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-1fdda6a6a711f69c.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-c4050748d6821b55.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-007b9091a7d4cefb.js → page-6022aa84d8a2143d.js} +1 -1
  703. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-94cf7841d26d6036.js → page-c31fbdfb86eea0b4.js} +1 -1
  704. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-50e98307a56eface.js → page-d0bb692dac18758c.js} +1 -1
  705. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-33d07479d233cefd.js → page-10691c9a6d96791c.js} +1 -1
  706. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-12068a8c1f8503dc.js → page-6f8353c36a244ae6.js} +1 -1
  707. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-8cd918900c3ec411.js → page-c7b5e776132111f8.js} +1 -1
  708. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-07a0044d9e135cb8.js → page-d30ed92db19690a1.js} +1 -1
  709. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-d488121dc0c130ad.js → page-9040b4357c33f048.js} +1 -1
  710. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-8753b06c82821119.js → page-66a435207cb92313.js} +1 -1
  711. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-e48be759eab5d2c0.js → page-4bc13394ac695b8c.js} +1 -1
  712. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-fcae85d7e5a157f1.js → layout-4a8ae0d8807210fe.js} +1 -1
  713. package/app/.next-cli-build/static/chunks/app/_global-error/page-fff2043928ca629e.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/analytics/installation/route-fff2043928ca629e.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-fff2043928ca629e.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-fff2043928ca629e.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-fff2043928ca629e.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-fff2043928ca629e.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-fff2043928ca629e.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-fff2043928ca629e.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/auth/setup-password/route-fff2043928ca629e.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-fff2043928ca629e.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-fff2043928ca629e.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-fff2043928ca629e.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-fff2043928ca629e.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-fff2043928ca629e.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-fff2043928ca629e.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-fff2043928ca629e.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-fff2043928ca629e.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-fff2043928ca629e.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-fff2043928ca629e.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-fff2043928ca629e.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-fff2043928ca629e.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-fff2043928ca629e.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-fff2043928ca629e.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-fff2043928ca629e.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-fff2043928ca629e.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-fff2043928ca629e.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-fff2043928ca629e.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-fff2043928ca629e.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-fff2043928ca629e.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/combos/route-fff2043928ca629e.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-fff2043928ca629e.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-fff2043928ca629e.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-fff2043928ca629e.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-fff2043928ca629e.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-fff2043928ca629e.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-fff2043928ca629e.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/health/route-fff2043928ca629e.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/init/route-fff2043928ca629e.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-fff2043928ca629e.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/keys/route-fff2043928ca629e.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/locale/route-fff2043928ca629e.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-fff2043928ca629e.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-fff2043928ca629e.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-fff2043928ca629e.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-fff2043928ca629e.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-fff2043928ca629e.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-fff2043928ca629e.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-fff2043928ca629e.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-fff2043928ca629e.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-fff2043928ca629e.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-fff2043928ca629e.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-fff2043928ca629e.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/models/route-fff2043928ca629e.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/models/test/route-fff2043928ca629e.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-fff2043928ca629e.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-fff2043928ca629e.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-fff2043928ca629e.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-fff2043928ca629e.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-fff2043928ca629e.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-fff2043928ca629e.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-fff2043928ca629e.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-fff2043928ca629e.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-fff2043928ca629e.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-fff2043928ca629e.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-fff2043928ca629e.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-fff2043928ca629e.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-fff2043928ca629e.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/pricing/route-fff2043928ca629e.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-fff2043928ca629e.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-fff2043928ca629e.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-fff2043928ca629e.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-fff2043928ca629e.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-fff2043928ca629e.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-fff2043928ca629e.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-fff2043928ca629e.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-fff2043928ca629e.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-fff2043928ca629e.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/providers/route-fff2043928ca629e.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-fff2043928ca629e.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-fff2043928ca629e.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-fff2043928ca629e.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-fff2043928ca629e.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-fff2043928ca629e.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-fff2043928ca629e.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-fff2043928ca629e.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-fff2043928ca629e.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-fff2043928ca629e.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-fff2043928ca629e.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-fff2043928ca629e.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-fff2043928ca629e.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-fff2043928ca629e.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-fff2043928ca629e.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-fff2043928ca629e.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-fff2043928ca629e.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-fff2043928ca629e.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/realtime/authorize/route-fff2043928ca629e.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-fff2043928ca629e.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-fff2043928ca629e.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/settings/public-telemetry/route-fff2043928ca629e.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-fff2043928ca629e.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/settings/route-fff2043928ca629e.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-fff2043928ca629e.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/tags/route-fff2043928ca629e.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-fff2043928ca629e.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-fff2043928ca629e.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-fff2043928ca629e.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-fff2043928ca629e.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-fff2043928ca629e.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-fff2043928ca629e.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-fff2043928ca629e.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-fff2043928ca629e.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-fff2043928ca629e.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-fff2043928ca629e.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-fff2043928ca629e.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-fff2043928ca629e.js +1 -0
  828. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-fff2043928ca629e.js +1 -0
  829. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-fff2043928ca629e.js +1 -0
  830. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-fff2043928ca629e.js +1 -0
  831. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-fff2043928ca629e.js +1 -0
  832. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-fff2043928ca629e.js +1 -0
  833. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-fff2043928ca629e.js +1 -0
  834. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-fff2043928ca629e.js +1 -0
  835. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-fff2043928ca629e.js +1 -0
  836. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-fff2043928ca629e.js +1 -0
  837. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-fff2043928ca629e.js +1 -0
  838. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-fff2043928ca629e.js +1 -0
  839. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-fff2043928ca629e.js +1 -0
  840. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-fff2043928ca629e.js +1 -0
  841. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-fff2043928ca629e.js +1 -0
  842. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-fff2043928ca629e.js +1 -0
  843. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-fff2043928ca629e.js +1 -0
  844. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-fff2043928ca629e.js +1 -0
  845. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-fff2043928ca629e.js +1 -0
  846. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-fff2043928ca629e.js +1 -0
  847. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-fff2043928ca629e.js +1 -0
  848. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-fff2043928ca629e.js +1 -0
  849. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-fff2043928ca629e.js +1 -0
  850. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-fff2043928ca629e.js +1 -0
  851. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-fff2043928ca629e.js +1 -0
  852. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-fff2043928ca629e.js +1 -0
  853. package/app/.next-cli-build/static/chunks/app/api/v1/route-fff2043928ca629e.js +1 -0
  854. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-fff2043928ca629e.js +1 -0
  855. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-fff2043928ca629e.js +1 -0
  856. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-fff2043928ca629e.js +1 -0
  857. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-fff2043928ca629e.js +1 -0
  858. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-fff2043928ca629e.js +1 -0
  859. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-fff2043928ca629e.js +1 -0
  860. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-fff2043928ca629e.js +1 -0
  861. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-fff2043928ca629e.js +1 -0
  862. package/app/.next-cli-build/static/chunks/app/api/version/route-fff2043928ca629e.js +1 -0
  863. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-fff2043928ca629e.js +1 -0
  864. package/app/.next-cli-build/static/chunks/app/api/version/update/route-fff2043928ca629e.js +1 -0
  865. package/app/.next-cli-build/static/chunks/app/landing/{page-1f76869d947f63aa.js → page-b50e183e847836c8.js} +1 -1
  866. package/app/.next-cli-build/static/chunks/app/layout-b5dceb29f62eb194.js +1 -0
  867. package/app/.next-cli-build/static/chunks/app/login/{page-61bdc6ffbffa18d7.js → page-6667717a7afa8499.js} +1 -1
  868. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-fff2043928ca629e.js +1 -0
  869. package/app/.next-cli-build/static/chunks/app/page-fff2043928ca629e.js +1 -0
  870. package/app/.next-cli-build/static/chunks/app/privacy/page-869f447902537142.js +1 -0
  871. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-fff2043928ca629e.js +1 -0
  872. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-fff2043928ca629e.js +1 -0
  873. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-fff2043928ca629e.js +1 -0
  874. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-fff2043928ca629e.js +1 -0
  875. package/app/.next-cli-build/static/css/cef12d51423e85fd.css +1 -0
  876. package/app/.next-cli-build/static/wTbyLTLZ735igbdzRXghH/_buildManifest.js +1 -0
  877. package/app/package.json +1 -1
  878. package/app/server.js +1 -1
  879. package/package.json +1 -1
  880. package/app/.next-cli-build/server/chunks/3239.js +0 -9
  881. package/app/.next-cli-build/server/chunks/4946.js +0 -9
  882. package/app/.next-cli-build/server/chunks/8251.js +0 -64
  883. package/app/.next-cli-build/static/chunks/5497-84dfd144b30eda56.js +0 -7
  884. package/app/.next-cli-build/static/chunks/8010-4f17bcbf4cac2817.js +0 -64
  885. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-13296317305f2023.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-4533bd89fa95f36f.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-52f8e9cf6aa8554b.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/_global-error/page-a1ad2a6494b449e0.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-a1ad2a6494b449e0.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-a1ad2a6494b449e0.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-a1ad2a6494b449e0.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-a1ad2a6494b449e0.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-a1ad2a6494b449e0.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-a1ad2a6494b449e0.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/auth/setup-password/route-a1ad2a6494b449e0.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-a1ad2a6494b449e0.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-a1ad2a6494b449e0.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-a1ad2a6494b449e0.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-a1ad2a6494b449e0.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-a1ad2a6494b449e0.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-a1ad2a6494b449e0.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-a1ad2a6494b449e0.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-a1ad2a6494b449e0.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-a1ad2a6494b449e0.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-a1ad2a6494b449e0.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-a1ad2a6494b449e0.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-a1ad2a6494b449e0.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-a1ad2a6494b449e0.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-a1ad2a6494b449e0.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-a1ad2a6494b449e0.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-a1ad2a6494b449e0.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-a1ad2a6494b449e0.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-a1ad2a6494b449e0.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-a1ad2a6494b449e0.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-a1ad2a6494b449e0.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/combos/route-a1ad2a6494b449e0.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-a1ad2a6494b449e0.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-a1ad2a6494b449e0.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-a1ad2a6494b449e0.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-a1ad2a6494b449e0.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-a1ad2a6494b449e0.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-a1ad2a6494b449e0.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/health/route-a1ad2a6494b449e0.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/init/route-a1ad2a6494b449e0.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-a1ad2a6494b449e0.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/keys/route-a1ad2a6494b449e0.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/locale/route-a1ad2a6494b449e0.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-a1ad2a6494b449e0.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-a1ad2a6494b449e0.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-a1ad2a6494b449e0.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-a1ad2a6494b449e0.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-a1ad2a6494b449e0.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-a1ad2a6494b449e0.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-a1ad2a6494b449e0.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-a1ad2a6494b449e0.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-a1ad2a6494b449e0.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-a1ad2a6494b449e0.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-a1ad2a6494b449e0.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/models/route-a1ad2a6494b449e0.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/models/test/route-a1ad2a6494b449e0.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-a1ad2a6494b449e0.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-a1ad2a6494b449e0.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-a1ad2a6494b449e0.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-a1ad2a6494b449e0.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-a1ad2a6494b449e0.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-a1ad2a6494b449e0.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-a1ad2a6494b449e0.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-a1ad2a6494b449e0.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-a1ad2a6494b449e0.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-a1ad2a6494b449e0.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-a1ad2a6494b449e0.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-a1ad2a6494b449e0.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-a1ad2a6494b449e0.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/pricing/route-a1ad2a6494b449e0.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-a1ad2a6494b449e0.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-a1ad2a6494b449e0.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-a1ad2a6494b449e0.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-a1ad2a6494b449e0.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-a1ad2a6494b449e0.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-a1ad2a6494b449e0.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-a1ad2a6494b449e0.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-a1ad2a6494b449e0.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-a1ad2a6494b449e0.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/providers/route-a1ad2a6494b449e0.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-a1ad2a6494b449e0.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-a1ad2a6494b449e0.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-a1ad2a6494b449e0.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-a1ad2a6494b449e0.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-a1ad2a6494b449e0.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-a1ad2a6494b449e0.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-a1ad2a6494b449e0.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-a1ad2a6494b449e0.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-a1ad2a6494b449e0.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-a1ad2a6494b449e0.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-a1ad2a6494b449e0.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-a1ad2a6494b449e0.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-a1ad2a6494b449e0.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-a1ad2a6494b449e0.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-a1ad2a6494b449e0.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-a1ad2a6494b449e0.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-a1ad2a6494b449e0.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/realtime/authorize/route-a1ad2a6494b449e0.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-a1ad2a6494b449e0.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-a1ad2a6494b449e0.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-a1ad2a6494b449e0.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/settings/route-a1ad2a6494b449e0.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-a1ad2a6494b449e0.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/tags/route-a1ad2a6494b449e0.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-a1ad2a6494b449e0.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-a1ad2a6494b449e0.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-a1ad2a6494b449e0.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-a1ad2a6494b449e0.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-a1ad2a6494b449e0.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-a1ad2a6494b449e0.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-a1ad2a6494b449e0.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-a1ad2a6494b449e0.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-a1ad2a6494b449e0.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-a1ad2a6494b449e0.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-a1ad2a6494b449e0.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-a1ad2a6494b449e0.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-a1ad2a6494b449e0.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-a1ad2a6494b449e0.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-a1ad2a6494b449e0.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-a1ad2a6494b449e0.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-a1ad2a6494b449e0.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-a1ad2a6494b449e0.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-a1ad2a6494b449e0.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-a1ad2a6494b449e0.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-a1ad2a6494b449e0.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-a1ad2a6494b449e0.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-a1ad2a6494b449e0.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-a1ad2a6494b449e0.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-a1ad2a6494b449e0.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-a1ad2a6494b449e0.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-a1ad2a6494b449e0.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-a1ad2a6494b449e0.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-a1ad2a6494b449e0.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-a1ad2a6494b449e0.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-a1ad2a6494b449e0.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-a1ad2a6494b449e0.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-a1ad2a6494b449e0.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-a1ad2a6494b449e0.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-a1ad2a6494b449e0.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-a1ad2a6494b449e0.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-a1ad2a6494b449e0.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/v1/route-a1ad2a6494b449e0.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-a1ad2a6494b449e0.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-a1ad2a6494b449e0.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-a1ad2a6494b449e0.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-a1ad2a6494b449e0.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-a1ad2a6494b449e0.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-a1ad2a6494b449e0.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-a1ad2a6494b449e0.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-a1ad2a6494b449e0.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/version/route-a1ad2a6494b449e0.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-a1ad2a6494b449e0.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/version/update/route-a1ad2a6494b449e0.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/layout-c029c07aec92583d.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-a1ad2a6494b449e0.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/page-a1ad2a6494b449e0.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-a1ad2a6494b449e0.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-a1ad2a6494b449e0.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-a1ad2a6494b449e0.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-a1ad2a6494b449e0.js +0 -1
  1045. package/app/.next-cli-build/static/css/b71ca13188930393.css +0 -1
  1046. package/app/.next-cli-build/static/j9NY-4IuO21Wl7djjsl7y/_buildManifest.js +0 -1
  1047. package/app/src/shared/services/installationTelemetry.js +0 -156
  1048. /package/app/.next-cli-build/static/{j9NY-4IuO21Wl7djjsl7y → wTbyLTLZ735igbdzRXghH}/_ssgManifest.js +0 -0
@@ -9,4 +9,4 @@ sk-key-only-auto-named`:R,[J,W]=(0,a.useState)("single"),[B,H]=(0,a.useState)(""
9
9
  "idToken": "eyJhbGc...",
10
10
  "email": "user@example.com"
11
11
  }
12
- ]`;function K({isOpen:e,onClose:t,onSuccess:s}){let[l,n]=(0,a.useState)(""),[r,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(null),u=()=>{r||(n(""),m(""),x(null),t())},h=async()=>{var e;let t;m(""),x(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,k.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void m((0,k.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,k.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,k.Tl)("Bulk Add Codex Accounts"),onClose:u,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,k.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:z,value:l,onChange:e=>n(e.target.value),disabled:r}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,k.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,k.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:" border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:r||!l.trim(),children:r?(0,k.Tl)("Importing..."):(0,k.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:u,variant:"ghost",fullWidth:!0,disabled:r,children:(0,k.Tl)("Close")})]})]})})}K.propTypes={isOpen:$().bool.isRequired,onClose:$().func.isRequired,onSuccess:$().func};let M={claude:"claudeAutoPing",codex:"codexAutoPing"};function F(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),n=t.id,{getCaps:x}=(0,w.y)(),[u,h]=(0,a.useState)([]),[f,y]=(0,a.useState)(!0),[g,b]=(0,a.useState)(null),[N,A]=(0,a.useState)([]),[$,O]=(0,a.useState)(!1),[E,I]=(0,a.useState)(!1),[R,z]=(0,a.useState)(!1),[F,L]=(0,a.useState)(""),[J,W]=(0,a.useState)(!1),[B,H]=(0,a.useState)(!1),[G,V]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)(!1),[Y,X]=(0,a.useState)(null),[ee,et]=(0,a.useState)({}),[es,ei]=(0,a.useState)([]),[ea,el]=(0,a.useState)(!1),[en,er]=(0,a.useState)({}),[eo,ed]=(0,a.useState)(""),[ec,em]=(0,a.useState)(()=>new Set),[ep,ex]=(0,a.useState)(!1),[eu,eh]=(0,a.useState)([]),[ef,ey]=(0,a.useState)("__none__"),[eg,eb]=(0,a.useState)(!1),[ev,ej]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(""),[eN,eC]=(0,a.useState)("auto"),[eS,eA]=(0,a.useState)({enabled:!1,connections:{}}),[e$,eT]=(0,a.useState)([]),[eO,eP]=(0,a.useState)([]),[eE,eI]=(0,a.useState)([]),[eD,eR]=(0,a.useState)([]),[eU,e_]=(0,a.useState)(null),[eq,ez]=(0,a.useState)(!1),[eK,eM]=(0,a.useState)(!1),[eF,eL]=(0,a.useState)(!1),[eJ,eW]=(0,a.useState)(null),[eB,eH]=(0,a.useState)({}),[eG,eV]=(0,a.useState)(null),eQ=(0,a.useRef)(!1),[eZ,eY]=(0,a.useState)(!1),{copied:eX,copy:e0}=(0,j.C)(),e1="ag_risk_confirmed",e2=()=>{O(!0)},e5=()=>{"antigravity"===n&&"true"!==window.localStorage.getItem(e1)?ez(!0):e8?e2():(L(""),z(!0))},e4=()=>{L(""),z(!0)},e3=()=>{e8?e5():e4()},e6=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===g.type?"#16a34a":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:m.zN[n]||m.fg[n]||m.IS[n]||m.nJ[n]||m.br[n],e7=e6?.authModes||[],e8=!!m.zN[n]||!!m.IS[n]||e7.includes("oauth"),e9=!!m.fg[n]||e7.includes("apikey"),te=!!m.IS[n]?.noAuth,tt=(0,p.KC)(n),ts="cursor"===n&&eO.length>0?eO:tt,ti=(0,m.wG)(n),ta=(0,m.mq)(n),tl=(0,m.gb)(n),tn=ta||tl,tr=!tn&&e8&&e9,to="xai"===n?"Grok Build OAuth":"grok-cli"===n?"Grok CLI Device Login":"kimi"===n?"Kimi Coding OAuth":"OAuth",td="xai"===n?"xAI API Key":"kimi"===n?"Kimi API Key":"API Key",tc=e=>{if(!eN||"auto"===eN)return null;let t=v(n,e);return t&&t.includes(eN)?eN:null},tm=tn?n:ti,tp=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=v(n,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ts)s(e.id);for(let e of eE)s(e.id);for(let e of es)e.providerAlias===tm&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tx=tn?g?.prefix||n:ti,tu=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{cache:"no-store"}),t=await e.json();e.ok&&eR(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tm]),th=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:[e]})})).ok&&await tu()}catch(e){console.log("Error disabling model:",e)}},tf=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling model:",e)}},ty=async e=>{e.length&&e_({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e_(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:e})})).ok&&await tu()}catch(e){console.log("Error disabling all models:",e)}}})},tg=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling all models:",e)}},tb=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&et(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tv=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ei(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===n&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eI(e.models)}).catch(()=>{})},[n]);let tj=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),l=await t.json(),r=await s.json(),o=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===n);h(e)}s.ok&&A(r.proxyPools||[]);let d=(o.providerStrategies||{})[n]||{};ej(d.fallbackStrategy||null),ek(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[n]||{};eC(c.mode||"auto");let m=M[n],p=m&&o[m]||{};if(eA({enabled:!0===p.enabled,connections:p.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===n)||null;if(!e&&tn)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===n)||null))break}b(e)}}catch(e){console.log("Error fetching connections:",e)}finally{y(!1)}},[n,tn]),tw=async e=>{try{let t=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(b(s.node),await tj(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},tk=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[n]:l[n]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tN=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[n]={mode:e}:delete s[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tC=async e=>{let t=M[n];if(t){eA(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tj(),tb(),tv(),tu()},[tj,tb,tv,tu]),(0,a.useEffect)(()=>{if("cursor"!==n)return void eP([]);let e=u.find(e=>!1!==e.isActive);if(!e?.id)return void eP([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&eP(s.models)}).catch(()=>{}),()=>{t=!0}},[n,u]),(0,a.useEffect)(()=>{let e=(m.zN[n]||m.fg[n]||m.IS[n]||m.nJ[n])?.modelsFetcher;e&&C(e).then(eT)},[n]);let tS=async(e,t,s=ti)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tb();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tb()}catch(e){console.log("Error deleting alias:",e)}},t$=async(e,t="llm",s=tm)=>{try{let i=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(i.ok)await tv(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await i.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tT=async(e,t="llm",s=tm)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tv(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tO=async()=>{if(eZ)return;let e=u.find(e=>!1!==e.isActive);if(!e)return void alert((0,k.Tl)("Please add an active Qoder connection first"));eY(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,k.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,k.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");es.some(e=>e.providerAlias===tm&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ee).includes(`${tm}/${s}`)||(await t$(s,"llm",tm),a+=1)}0===a?alert((0,k.Tl)("All models already exist, no new models added")):alert((0,k.Tl)("Successfully added")+` ${a} `+(0,k.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,k.Tl)("Error fetching models")+": "+e.message)}finally{eY(!1)}},tP=async()=>{if(eK||0===u.length)return;let e=Object.fromEntries(u.map(e=>[e.id,{state:"queued",error:null}]));eQ.current=!1,eM(!0),eL(!1),eW(null),eH(e),eV({total:u.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<u.length;e+=1){if(eQ.current){eV({total:u.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=u[e];eW(i.id),eH(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,eH(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,eH(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}eV({total:u.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<u.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eW(null),eM(!1),eL(!1),eQ.current=!1}},tE=async e=>{e_({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e_(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tI=()=>{tj(),O(!1)},tD=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tj(),z(!1);return}L(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tR=async e=>{try{(await fetch(`/api/providers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tj(),H(!1))}catch(e){console.log("Error updating connection:",e)}},tU=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t_=async(e,t)=>{let s=[...u];[s[e],s[t]]=[s[t],s[e]],h(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 tj()}},tq=u.filter(e=>eu.includes(e.id)),tz=u.length>0&&eu.length===u.length;(0,a.useEffect)(()=>{eh(e=>e.filter(e=>u.some(t=>t.id===e)))},[u]),(()=>{if(0===tq.length)return;let e=new Set(tq.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=N.find(e=>e.id===t);return s?.name}})();let tK=()=>{eg||Z(!1)},tM=async e=>{eb(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tj(),Z(!1)}finally{eb(!1)}},tF=e=>tM(u.map(t=>({connectionId:t.id,proxyPoolId:e}))),tL=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:u.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eu.includes(s)),onChange:()=>{var t;return t=e.id,void eh(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(D,{connection:e,proxyPools:N,isOAuth:e8,isFirst:0===t,isLast:t===u.length-1,onMoveUp:()=>t_(t,t-1),onMoveDown:()=>t_(t,t+1),onToggleActive:t=>tU(e.id,t),autoPing:M[n]&&"oauth"===e.authType?{on:!0===eS.connections[e.id],onToggle:t=>{var s;return s=e.id,void tC({...eS,connections:{...eS.connections,[s]:t}})},provider:n}: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&&h(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:()=>{X(e),H(!0)},onDelete:()=>tE(e.id),oneByOneStatus:eB[e.id]||null})})]},e.id)})}),tJ=N.filter(e=>!0===e.isActive),tW=(0,i.jsx)(c.aF,{isOpen:Q,onClose:tK,title:`Apply Proxy (${u.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=N.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tM(u.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eg||0===tJ.length,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tF(null),disabled:eg,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),N.map(e=>(0,i.jsxs)("button",{onClick:()=>tF(e.id),disabled:eg||!0!==e.isActive,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eg&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tK,variant:"ghost",fullWidth:!0,disabled:eg,children:"Cancel"})]})}),tB=async e=>{if(!ec.has(e)){em(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:`${tm}/${e}`})}),s=await t.json();er(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{er(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}};if(f)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!e6)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let tH=()=>ta&&e6.apiType?"responses"===e6.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tl?"/providers/anthropic-m.png":(0,d.HY)(e6.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center ",style:{backgroundColor:`${e6.color}15`},children:ea||!tH()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:e6.color},children:e6.textIcon||e6.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:tH(),alt:e6.name,width:48,height:48,className:"max-h-12 max-w-12 object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(e6.id),el(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e6.name}),(e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website)&&(0,i.jsxs)("a",{href:e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e6.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[u.length," connection",1===u.length?"":"s"]})]})]})]}),e6.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e6.deprecationNotice})]}),e6.notice?.text&&!e6.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e6.notice.text}),e6.notice.apiKeyUrl&&(0,i.jsx)("a",{href:e6.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center 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 →"})]}),tn&&g&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tl?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tl?"Messages API":"responses"===g.apiType?"Responses API":"Chat Completions"," \xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",tl?"messages":"responses"===g.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{L(""),z(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e_({title:"Delete Compatible Node",message:`Delete this ${tl?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e_(null);try{(await fetch(`/api/provider-nodes/${n}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),te?(0,i.jsx)(c.gw,{providerId:n}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[u.length>0&&N.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),u.length>0&&(0,i.jsxs)(i.Fragment,{children:[eu.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eu.length;0!==e&&e_({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e_(null);let e=0,t=[...eu];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}h(e=>e.filter(e=>!t.includes(e.id))),eh([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eu.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tP,disabled:eK,children:eK?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eK&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eK&&(eQ.current=!0,eL(!0))},disabled:eF,children:eF?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===ev,onChange:e=>{let t=e?"round-robin":null,s=e?ew||"1":ew;e&&!ew&&ek("1"),ej(t),tk(t,s)}}),"round-robin"===ev&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:ew,onChange:e=>{var t;ek(t=e.target.value),tk("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===u.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e8?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tr&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",to," or ",td,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tr?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e5,children:to}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e4,children:td})]}):(0,i.jsxs)(i.Fragment,{children:[!tn&&"iflow"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),"codex"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),children:(0,k.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e3,children:tn?"Add API Key":"iflow"===n?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[eG&&(0,i.jsx)("div",{className:"mb-4 border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",eG.total]}),(0,i.jsxs)("span",{children:["Completed: ",eG.completed]}),(0,i.jsxs)("span",{children:["Passed: ",eG.passed]}),(0,i.jsxs)("span",{children:["Failed: ",eG.failed]}),eG.stopped&&(0,i.jsx)("span",{className:"text-green-600 dark:text-green-400",children:"Stopped"}),eK&&eJ&&(0,i.jsxs)("span",{children:["Running: ",u.find(e=>e.id===eJ)?.name||eJ]})]})}),u.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:tz,onChange:()=>{tz?eh([]):eh(u.map(e=>e.id))},className:"h-3.5 w-3.5 border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tL,!tn&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),title:(0,k.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,k.Tl)("Bulk Add")}),tr?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e5,className:"w-full sm:w-auto",children:to}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e4,className:"w-full sm:w-auto",children:td})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e3,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tp&&(0,i.jsx)("select",{value:eN,onChange:e=>{var t;eC(t=e.target.value),tN(t)},title:"Appends (level) suffix to copied model names",className:" border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tp.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tn&&(e=[...ts,...eE.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eD.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eD.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tg,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ty(e),children:"Disable All"})]}))]}),!!eo&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eo}),(()=>{let e,t,s;if(tn)return(0,i.jsx)(P,{providerStorageAlias:tm,providerDisplayAlias:tx,modelAliases:ee,customModels:es,copied:eX,onCopy:e0,onSetAlias:tS,onDeleteAlias:tA,onAddCustomModel:e=>t$(e,"llm",tm),onDeleteCustomModel:e=>tT(e,"llm",tm),connections:u,isAnthropic:tl});let a=[...ts,...eE.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eD),r=a.filter(e=>!l.has(e.id)),o=a.filter(e=>l.has(e.id)),d=S({customModels:es,modelAliases:ee,providerAlias:tm,builtInModels:ts,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(T,{model:{id:e.id,name:e.name},fullModel:`${tx}/${e.id}`,alias:e.alias,copied:eX,onCopy:e0,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tT(e.id,"llm",tm):tA(e.alias)},testStatus:en[e.id],onTest:u.length>0||te?()=>tB(e.id):void 0,isTesting:ec.has(e.id),isCustom:!0,isFree:!1,caps:x(`${n}/${e.id}`),thinkingSuffix:tc(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tm}/${e.id}`,s=`${n}/${e.id}`,a=Object.entries(ee).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(T,{model:e,fullModel:`${tx}/${e.id}`,alias:a,copied:eX,onCopy:e0,onSetAlias:t=>tS(e.id,t,tm),onDeleteAlias:()=>tA(a),testStatus:en[e.id],onTest:u.length>0||te?()=>tB(e.id):void 0,isTesting:ec.has(e.id),isFree:e.isFree,onDisable:()=>th(e.id),caps:x(`${n}/${e.id}`),thinkingSuffix:tc(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ex(!0),className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===n&&u.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tO,disabled:eZ,className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:eZ?{animation:"spin 1s linear infinite"}:void 0,children:eZ?"progress_activity":"download"}),eZ?(0,k.Tl)("Fetching..."):(0,k.Tl)("Fetch Qoder Models")]}),e$.length>0&&(e=new Set([...Object.values(ee),...d.map(e=>e.fullModel)]),t=new Set(ts.map(e=>e.id)),0===(s=e$.filter(s=>!e.has(`${tm}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await t$(e.id,"llm",tm)},className:"flex items-center gap-1 px-2.5 py-1.5 border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tf(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tW,"kiro"===n?(0,i.jsx)(c.Mh,{isOpen:$,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}):"cursor"===n?(0,i.jsx)(c.G9,{isOpen:$,onSuccess:tI,onClose:()=>O(!1)}):"gitlab"===n?(0,i.jsx)(c.vj,{isOpen:$,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}):(0,i.jsx)(c.LF,{isOpen:$,provider:n,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}),"iflow"===n&&(0,i.jsx)(c.vE,{isOpen:E,onSuccess:()=>{tj(),I(!1)},onClose:()=>I(!1)}),(0,i.jsx)(U,{isOpen:R,provider:n,providerName:e6.name,isCompatible:tn,isAnthropic:tl,authType:e6?.authType,authHint:e6?.authHint,website:e6?.website,proxyPools:N,error:F,existingNames:u.map(e=>e.name).filter(Boolean),onSave:tD,onBulkDone:tj,onClose:()=>{L(""),z(!1)}}),(0,i.jsx)(c.wI,{isOpen:B,connection:Y,proxyPools:N,onSave:tR,onClose:()=>H(!1)}),tn&&(0,i.jsx)(_,{isOpen:G,node:g,onSave:tw,onClose:()=>V(!1),isAnthropic:tl}),!tn&&(0,i.jsx)(q,{isOpen:ep,providerAlias:tm,providerDisplayAlias:tx,onSave:async e=>{await t$(e,"llm",tm),ex(!1)},onClose:()=>ex(!1)}),"codex"===n&&(0,i.jsx)(K,{isOpen:J,onClose:()=>W(!1),onSuccess:tj}),(0,i.jsx)(c.uo,{isOpen:eq,onClose:()=>ez(!1),onConfirm:()=>{(window.localStorage.setItem(e1,"true"),ez(!1),e8)?e2():e4()},title:"Risk Notice",message:e6?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eU,onClose:()=>e_(null),onConfirm:eU?.onConfirm,title:eU?.title||"Confirm",message:eU?.message,variant:"danger"})]})}},14297:(e,t,s)=>{Promise.resolve().then(s.bind(s,4878))},70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})}},e=>{e.O(0,[8010,5772,1321,7451,5497,8441,3794,7358],()=>e(e.s=14297)),_N_E=e.O()}]);
12
+ ]`;function K({isOpen:e,onClose:t,onSuccess:s}){let[l,n]=(0,a.useState)(""),[r,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(null),u=()=>{r||(n(""),m(""),x(null),t())},h=async()=>{var e;let t;m(""),x(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,k.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void m((0,k.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,k.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,k.Tl)("Bulk Add Codex Accounts"),onClose:u,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,k.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:z,value:l,onChange:e=>n(e.target.value),disabled:r}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,k.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,k.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:" border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:r||!l.trim(),children:r?(0,k.Tl)("Importing..."):(0,k.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:u,variant:"ghost",fullWidth:!0,disabled:r,children:(0,k.Tl)("Close")})]})]})})}K.propTypes={isOpen:$().bool.isRequired,onClose:$().func.isRequired,onSuccess:$().func};let M={claude:"claudeAutoPing",codex:"codexAutoPing"};function F(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),n=t.id,{getCaps:x}=(0,w.y)(),[u,h]=(0,a.useState)([]),[f,y]=(0,a.useState)(!0),[g,b]=(0,a.useState)(null),[N,A]=(0,a.useState)([]),[$,O]=(0,a.useState)(!1),[E,I]=(0,a.useState)(!1),[R,z]=(0,a.useState)(!1),[F,L]=(0,a.useState)(""),[J,W]=(0,a.useState)(!1),[B,H]=(0,a.useState)(!1),[G,V]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)(!1),[Y,X]=(0,a.useState)(null),[ee,et]=(0,a.useState)({}),[es,ei]=(0,a.useState)([]),[ea,el]=(0,a.useState)(!1),[en,er]=(0,a.useState)({}),[eo,ed]=(0,a.useState)(""),[ec,em]=(0,a.useState)(()=>new Set),[ep,ex]=(0,a.useState)(!1),[eu,eh]=(0,a.useState)([]),[ef,ey]=(0,a.useState)("__none__"),[eg,eb]=(0,a.useState)(!1),[ev,ej]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(""),[eN,eC]=(0,a.useState)("auto"),[eS,eA]=(0,a.useState)({enabled:!1,connections:{}}),[e$,eT]=(0,a.useState)([]),[eO,eP]=(0,a.useState)([]),[eE,eI]=(0,a.useState)([]),[eD,eR]=(0,a.useState)([]),[eU,e_]=(0,a.useState)(null),[eq,ez]=(0,a.useState)(!1),[eK,eM]=(0,a.useState)(!1),[eF,eL]=(0,a.useState)(!1),[eJ,eW]=(0,a.useState)(null),[eB,eH]=(0,a.useState)({}),[eG,eV]=(0,a.useState)(null),eQ=(0,a.useRef)(!1),[eZ,eY]=(0,a.useState)(!1),{copied:eX,copy:e0}=(0,j.C)(),e1="ag_risk_confirmed",e2=()=>{O(!0)},e5=()=>{"antigravity"===n&&"true"!==window.localStorage.getItem(e1)?ez(!0):e8?e2():(L(""),z(!0))},e4=()=>{L(""),z(!0)},e3=()=>{e8?e5():e4()},e6=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===g.type?"#16a34a":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:m.zN[n]||m.fg[n]||m.IS[n]||m.nJ[n]||m.br[n],e7=e6?.authModes||[],e8=!!m.zN[n]||!!m.IS[n]||e7.includes("oauth"),e9=!!m.fg[n]||e7.includes("apikey"),te=!!m.IS[n]?.noAuth,tt=(0,p.KC)(n),ts="cursor"===n&&eO.length>0?eO:tt,ti=(0,m.wG)(n),ta=(0,m.mq)(n),tl=(0,m.gb)(n),tn=ta||tl,tr=!tn&&e8&&e9,to="xai"===n?"Grok Build OAuth":"grok-cli"===n?"Grok CLI Device Login":"kimi"===n?"Kimi Coding OAuth":"OAuth",td="xai"===n?"xAI API Key":"kimi"===n?"Kimi API Key":"API Key",tc=e=>{if(!eN||"auto"===eN)return null;let t=v(n,e);return t&&t.includes(eN)?eN:null},tm=tn?n:ti,tp=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=v(n,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ts)s(e.id);for(let e of eE)s(e.id);for(let e of es)e.providerAlias===tm&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tx=tn?g?.prefix||n:ti,tu=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{cache:"no-store"}),t=await e.json();e.ok&&eR(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tm]),th=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:[e]})})).ok&&await tu()}catch(e){console.log("Error disabling model:",e)}},tf=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling model:",e)}},ty=async e=>{e.length&&e_({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e_(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:e})})).ok&&await tu()}catch(e){console.log("Error disabling all models:",e)}}})},tg=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling all models:",e)}},tb=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&et(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tv=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ei(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===n&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eI(e.models)}).catch(()=>{})},[n]);let tj=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),l=await t.json(),r=await s.json(),o=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===n);h(e)}s.ok&&A(r.proxyPools||[]);let d=(o.providerStrategies||{})[n]||{};ej(d.fallbackStrategy||null),ek(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[n]||{};eC(c.mode||"auto");let m=M[n],p=m&&o[m]||{};if(eA({enabled:!0===p.enabled,connections:p.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===n)||null;if(!e&&tn)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===n)||null))break}b(e)}}catch(e){console.log("Error fetching connections:",e)}finally{y(!1)}},[n,tn]),tw=async e=>{try{let t=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(b(s.node),await tj(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},tk=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[n]:l[n]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tN=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[n]={mode:e}:delete s[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tC=async e=>{let t=M[n];if(t){eA(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tj(),tb(),tv(),tu()},[tj,tb,tv,tu]),(0,a.useEffect)(()=>{if("cursor"!==n)return void eP([]);let e=u.find(e=>!1!==e.isActive);if(!e?.id)return void eP([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&eP(s.models)}).catch(()=>{}),()=>{t=!0}},[n,u]),(0,a.useEffect)(()=>{let e=(m.zN[n]||m.fg[n]||m.IS[n]||m.nJ[n])?.modelsFetcher;e&&C(e).then(eT)},[n]);let tS=async(e,t,s=ti)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tb();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tb()}catch(e){console.log("Error deleting alias:",e)}},t$=async(e,t="llm",s=tm)=>{try{let i=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(i.ok)await tv(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await i.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tT=async(e,t="llm",s=tm)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tv(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tO=async()=>{if(eZ)return;let e=u.find(e=>!1!==e.isActive);if(!e)return void alert((0,k.Tl)("Please add an active Qoder connection first"));eY(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,k.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,k.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");es.some(e=>e.providerAlias===tm&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ee).includes(`${tm}/${s}`)||(await t$(s,"llm",tm),a+=1)}0===a?alert((0,k.Tl)("All models already exist, no new models added")):alert((0,k.Tl)("Successfully added")+` ${a} `+(0,k.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,k.Tl)("Error fetching models")+": "+e.message)}finally{eY(!1)}},tP=async()=>{if(eK||0===u.length)return;let e=Object.fromEntries(u.map(e=>[e.id,{state:"queued",error:null}]));eQ.current=!1,eM(!0),eL(!1),eW(null),eH(e),eV({total:u.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<u.length;e+=1){if(eQ.current){eV({total:u.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=u[e];eW(i.id),eH(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,eH(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,eH(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}eV({total:u.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<u.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eW(null),eM(!1),eL(!1),eQ.current=!1}},tE=async e=>{e_({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e_(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tI=()=>{tj(),O(!1)},tD=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tj(),z(!1);return}L(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tR=async e=>{try{(await fetch(`/api/providers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tj(),H(!1))}catch(e){console.log("Error updating connection:",e)}},tU=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t_=async(e,t)=>{let s=[...u];[s[e],s[t]]=[s[t],s[e]],h(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 tj()}},tq=u.filter(e=>eu.includes(e.id)),tz=u.length>0&&eu.length===u.length;(0,a.useEffect)(()=>{eh(e=>e.filter(e=>u.some(t=>t.id===e)))},[u]),(()=>{if(0===tq.length)return;let e=new Set(tq.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=N.find(e=>e.id===t);return s?.name}})();let tK=()=>{eg||Z(!1)},tM=async e=>{eb(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tj(),Z(!1)}finally{eb(!1)}},tF=e=>tM(u.map(t=>({connectionId:t.id,proxyPoolId:e}))),tL=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:u.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eu.includes(s)),onChange:()=>{var t;return t=e.id,void eh(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(D,{connection:e,proxyPools:N,isOAuth:e8,isFirst:0===t,isLast:t===u.length-1,onMoveUp:()=>t_(t,t-1),onMoveDown:()=>t_(t,t+1),onToggleActive:t=>tU(e.id,t),autoPing:M[n]&&"oauth"===e.authType?{on:!0===eS.connections[e.id],onToggle:t=>{var s;return s=e.id,void tC({...eS,connections:{...eS.connections,[s]:t}})},provider:n}: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&&h(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:()=>{X(e),H(!0)},onDelete:()=>tE(e.id),oneByOneStatus:eB[e.id]||null})})]},e.id)})}),tJ=N.filter(e=>!0===e.isActive),tW=(0,i.jsx)(c.aF,{isOpen:Q,onClose:tK,title:`Apply Proxy (${u.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=N.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tM(u.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eg||0===tJ.length,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tF(null),disabled:eg,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),N.map(e=>(0,i.jsxs)("button",{onClick:()=>tF(e.id),disabled:eg||!0!==e.isActive,className:"flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eg&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tK,variant:"ghost",fullWidth:!0,disabled:eg,children:"Cancel"})]})}),tB=async e=>{if(!ec.has(e)){em(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:`${tm}/${e}`})}),s=await t.json();er(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{er(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}};if(f)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!e6)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let tH=()=>ta&&e6.apiType?"responses"===e6.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tl?"/providers/anthropic-m.png":(0,d.HY)(e6.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center ",style:{backgroundColor:`${e6.color}15`},children:ea||!tH()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:e6.color},children:e6.textIcon||e6.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:tH(),alt:e6.name,width:48,height:48,className:"max-h-12 max-w-12 object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(e6.id),el(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e6.name}),(e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website)&&(0,i.jsxs)("a",{href:e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e6.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[u.length," connection",1===u.length?"":"s"]})]})]})]}),e6.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e6.deprecationNotice})]}),e6.notice?.text&&!e6.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e6.notice.text}),e6.notice.apiKeyUrl&&(0,i.jsx)("a",{href:e6.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center 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 →"})]}),tn&&g&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tl?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tl?"Messages API":"responses"===g.apiType?"Responses API":"Chat Completions"," \xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",tl?"messages":"responses"===g.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{L(""),z(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e_({title:"Delete Compatible Node",message:`Delete this ${tl?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e_(null);try{(await fetch(`/api/provider-nodes/${n}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),te?(0,i.jsx)(c.gw,{providerId:n}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[u.length>0&&N.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),u.length>0&&(0,i.jsxs)(i.Fragment,{children:[eu.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eu.length;0!==e&&e_({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e_(null);let e=0,t=[...eu];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}h(e=>e.filter(e=>!t.includes(e.id))),eh([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eu.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tP,disabled:eK,children:eK?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eK&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eK&&(eQ.current=!0,eL(!0))},disabled:eF,children:eF?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===ev,onChange:e=>{let t=e?"round-robin":null,s=e?ew||"1":ew;e&&!ew&&ek("1"),ej(t),tk(t,s)}}),"round-robin"===ev&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:ew,onChange:e=>{var t;ek(t=e.target.value),tk("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===u.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e8?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tr&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",to," or ",td,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tr?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e5,children:to}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e4,children:td})]}):(0,i.jsxs)(i.Fragment,{children:[!tn&&"iflow"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),"codex"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),children:(0,k.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e3,children:tn?"Add API Key":"iflow"===n?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[eG&&(0,i.jsx)("div",{className:"mb-4 border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",eG.total]}),(0,i.jsxs)("span",{children:["Completed: ",eG.completed]}),(0,i.jsxs)("span",{children:["Passed: ",eG.passed]}),(0,i.jsxs)("span",{children:["Failed: ",eG.failed]}),eG.stopped&&(0,i.jsx)("span",{className:"text-green-600 dark:text-green-400",children:"Stopped"}),eK&&eJ&&(0,i.jsxs)("span",{children:["Running: ",u.find(e=>e.id===eJ)?.name||eJ]})]})}),u.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:tz,onChange:()=>{tz?eh([]):eh(u.map(e=>e.id))},className:"h-3.5 w-3.5 border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tL,!tn&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===n&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),title:(0,k.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,k.Tl)("Bulk Add")}),tr?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e5,className:"w-full sm:w-auto",children:to}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e4,className:"w-full sm:w-auto",children:td})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e3,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tp&&(0,i.jsx)("select",{value:eN,onChange:e=>{var t;eC(t=e.target.value),tN(t)},title:"Appends (level) suffix to copied model names",className:" border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tp.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tn&&(e=[...ts,...eE.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eD.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eD.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tg,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ty(e),children:"Disable All"})]}))]}),!!eo&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eo}),(()=>{let e,t,s;if(tn)return(0,i.jsx)(P,{providerStorageAlias:tm,providerDisplayAlias:tx,modelAliases:ee,customModels:es,copied:eX,onCopy:e0,onSetAlias:tS,onDeleteAlias:tA,onAddCustomModel:e=>t$(e,"llm",tm),onDeleteCustomModel:e=>tT(e,"llm",tm),connections:u,isAnthropic:tl});let a=[...ts,...eE.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eD),r=a.filter(e=>!l.has(e.id)),o=a.filter(e=>l.has(e.id)),d=S({customModels:es,modelAliases:ee,providerAlias:tm,builtInModels:ts,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(T,{model:{id:e.id,name:e.name},fullModel:`${tx}/${e.id}`,alias:e.alias,copied:eX,onCopy:e0,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tT(e.id,"llm",tm):tA(e.alias)},testStatus:en[e.id],onTest:u.length>0||te?()=>tB(e.id):void 0,isTesting:ec.has(e.id),isCustom:!0,isFree:!1,caps:x(`${n}/${e.id}`),thinkingSuffix:tc(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tm}/${e.id}`,s=`${n}/${e.id}`,a=Object.entries(ee).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(T,{model:e,fullModel:`${tx}/${e.id}`,alias:a,copied:eX,onCopy:e0,onSetAlias:t=>tS(e.id,t,tm),onDeleteAlias:()=>tA(a),testStatus:en[e.id],onTest:u.length>0||te?()=>tB(e.id):void 0,isTesting:ec.has(e.id),isFree:e.isFree,onDisable:()=>th(e.id),caps:x(`${n}/${e.id}`),thinkingSuffix:tc(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ex(!0),className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===n&&u.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tO,disabled:eZ,className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:eZ?{animation:"spin 1s linear infinite"}:void 0,children:eZ?"progress_activity":"download"}),eZ?(0,k.Tl)("Fetching..."):(0,k.Tl)("Fetch Qoder Models")]}),e$.length>0&&(e=new Set([...Object.values(ee),...d.map(e=>e.fullModel)]),t=new Set(ts.map(e=>e.id)),0===(s=e$.filter(s=>!e.has(`${tm}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await t$(e.id,"llm",tm)},className:"flex items-center gap-1 px-2.5 py-1.5 border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tf(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tW,"kiro"===n?(0,i.jsx)(c.Mh,{isOpen:$,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}):"cursor"===n?(0,i.jsx)(c.G9,{isOpen:$,onSuccess:tI,onClose:()=>O(!1)}):"gitlab"===n?(0,i.jsx)(c.vj,{isOpen:$,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}):(0,i.jsx)(c.LF,{isOpen:$,provider:n,providerInfo:e6,onSuccess:tI,onClose:()=>O(!1)}),"iflow"===n&&(0,i.jsx)(c.vE,{isOpen:E,onSuccess:()=>{tj(),I(!1)},onClose:()=>I(!1)}),(0,i.jsx)(U,{isOpen:R,provider:n,providerName:e6.name,isCompatible:tn,isAnthropic:tl,authType:e6?.authType,authHint:e6?.authHint,website:e6?.website,proxyPools:N,error:F,existingNames:u.map(e=>e.name).filter(Boolean),onSave:tD,onBulkDone:tj,onClose:()=>{L(""),z(!1)}}),(0,i.jsx)(c.wI,{isOpen:B,connection:Y,proxyPools:N,onSave:tR,onClose:()=>H(!1)}),tn&&(0,i.jsx)(_,{isOpen:G,node:g,onSave:tw,onClose:()=>V(!1),isAnthropic:tl}),!tn&&(0,i.jsx)(q,{isOpen:ep,providerAlias:tm,providerDisplayAlias:tx,onSave:async e=>{await t$(e,"llm",tm),ex(!1)},onClose:()=>ex(!1)}),"codex"===n&&(0,i.jsx)(K,{isOpen:J,onClose:()=>W(!1),onSuccess:tj}),(0,i.jsx)(c.uo,{isOpen:eq,onClose:()=>ez(!1),onConfirm:()=>{(window.localStorage.setItem(e1,"true"),ez(!1),e8)?e2():e4()},title:"Risk Notice",message:e6?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eU,onClose:()=>e_(null),onConfirm:eU?.onConfirm,title:eU?.title||"Confirm",message:eU?.message,variant:"danger"})]})}},14297:(e,t,s)=>{Promise.resolve().then(s.bind(s,4878))},70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})}},e=>{e.O(0,[8500,8591,5772,1321,7451,5497,8441,3794,7358],()=>e(e.s=14297)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>h});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function h(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,h]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[m,u]=(0,s.useState)({}),x=(e,r)=>{h(t=>({...t,[e]:r})),m[e]&&u(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),u(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();u({submit:e.error||"Failed to create provider"})}}catch(e){u({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{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.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:m.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:m.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),m.submit&&(0,a.jsx)("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:m.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},39274:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=39274)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>h});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function h(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,h]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[m,u]=(0,s.useState)({}),x=(e,r)=>{h(t=>({...t,[e]:r})),m[e]&&u(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),u(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();u({submit:e.error||"Failed to create provider"})}}catch(e){u({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{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.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:m.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:m.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),m.submit&&(0,a.jsx)("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:m.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},39274:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[8500,8591,1321,7451,5497,8441,3794,7358],()=>e(e.s=39274)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{51153:(e,t,s)=>{Promise.resolve().then(s.bind(s,97678))},97678:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),c=s(8247),d=s(90620),p=s(88105),m=s(98500),x=s.n(m),u=s(65921),h=s(38003);let f={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function b(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,u.i)(),x=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{x();let e=setInterval(x,3e4);return()=>clearInterval(e)},[x]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let h=async(e,t)=>{d(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await x()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{d(null)}};if(s)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:x,className:"p-1 hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,s=c===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let g={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({variant:e,isOpen:t,onClose:s,onCreated:l}){let i=g[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[c,d]=(0,a.useState)(o),[p,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[b,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{i.hasApiType?d(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(w(null),u(""),f(""))},[i.hasApiType?c.apiType:t]);let k=async()=>{if(c.name.trim()&&c.prefix.trim()&&c.baseUrl.trim()){m(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.name,prefix:c.prefix,...i.hasApiType?{apiType:c.apiType}:{},baseUrl:c.baseUrl,type:i.type})}),t=await e.json();e.ok&&(l(t.node),d(o()),u(""),w(null))}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{m(!1)}}},C=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:c.baseUrl,apiKey:x,type:i.type,modelId:h.trim()||void 0})}),t=await e.json();w(t)}catch{w({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,r.jsx)(n.aF,{isOpen:t,title:i.title,onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:c.name,onChange:e=>d({...c,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:c.prefix,onChange:e=>d({...c,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,r.jsx)(n.l6,{label:"API Type",options:v,value:c.apiType,onChange:e=>d({...c,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:c.baseUrl,onChange:e=>d({...c,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:h,onChange:e=>f(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:C,disabled:!x||b||!c.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!N)return null;let{valid:e,error:t,method:s}=N;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:k,fullWidth:!0,disabled:!c.name.trim()||!c.prefix.trim()||!c.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function N(){let[e,t]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[c,m]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[T,A]=(0,a.useState)(null),I=(0,u.i)(),E=(0,h.C)(e=>e.query),$=(0,h.C)(e=>e.register),P=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>($("Search providers..."),()=>P()),[$,P]);let O=e=>!E.trim()||e.toLowerCase().includes(E.trim().toLowerCase()),R=(e,t)=>[...e].sort(([e,s],[r,a])=>{let l=s.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=S(e,t),o=S(r,t),c=+(n.connected>0),d=+(o.connected>0);return c!==d?d-c:(s.name||"").localeCompare(a.name||"")});(0,a.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await s.json();e.ok&&t(r.connections||[]),s.ok&&l(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}})()},[]);let S=(t,s)=>{let r=Array.isArray(s)?s:[s],a=e.filter(e=>e.provider===t&&r.includes(e.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=a.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=a.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,c=a.length,d=c>0&&a.every(e=>!1===e.isActive),p=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:c,errorCode:p?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(p):null,errorTime:p?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(p.lastErrorAt):null,allDisabled:d}},U=async(s,r,a)=>{let l=Array.isArray(r)?r:[r],i=e=>e.provider===s&&l.includes(e.authType),n=e.filter(i);t(e=>e.map(e=>i(e)?{...e,isActive:a}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},_=async(e,t=null)=>{if(!j){N("provider"===e?t:e),A(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(A(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?I.success(`All ${s} tests passed`):I.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){A({error:"Test request failed"}),I.error("Provider test failed")}finally{N(null)}}},z=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>O(e.name)),q=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#16a34a",textIcon:"AC"})).filter(e=>O(e.name)),D=R(Object.entries(d.zN).filter(([,e])=>!e.hidden&&O(e.name)),"oauth"),F=Object.entries(p.IS).filter(([,e])=>!e.hidden&&O(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),L=R(Object.entries(p.nJ).filter(([,e])=>!e.hidden&&O(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),M=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&O(e.name)).sort(([e,t],[s,r])=>{let a=S(e,"apikey").total>0?0:1,l=S(s,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(r.name||"")}),K=!!E.trim(),H=K||c?M:M.slice(0,20),J=M.length-20;if(i)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let B=D.length>0||F.length>0||L.length>0||M.length>0||z.length>0||q.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!B&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border ",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>v(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>f(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===z.length&&0===q.length?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,r.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...z,...q].map(e=>(0,r.jsx)(k,{providerId:e.id,provider:e,stats:S(e.id,"apikey"),authType:"compatible",onToggle:t=>U(e.id,"apikey",t)},e.id))})]}),D.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(b,{}),(0,r.jsxs)("button",{onClick:()=>_("oauth"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===j?" animate-spin":""}`,children:"play_arrow"}),"oauth"===j?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:D.map(([e,t])=>(0,r.jsx)(w,{providerId:e,provider:t,stats:S(e,"oauth"),authType:"oauth",onToggle:t=>U(e,"oauth",t)},e))})]}),(F.length>0||L.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>_("free"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===j?" animate-spin":""}`,children:"play_arrow"}),"free"===j?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[F.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,r.jsx)(w,{providerId:e,provider:t,stats:S(e,s),authType:"free",onToggle:t=>U(e,s,t)},e)}),L.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:S(e,"apikey"),authType:"apikey",onToggle:t=>U(e,"apikey",t)},e))]})]}),M.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>_("apikey"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===j?" animate-spin":""}`,children:"play_arrow"}),"apikey"===j?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:S(e,"apikey"),authType:"apikey",onToggle:t=>U(e,"apikey",t)},e))}),!K&&!c&&J>0&&(0,r.jsxs)("button",{onClick:()=>m(!0),className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",M.length," providers"]})]}),(0,r.jsx)(y,{variant:"openai",isOpen:x,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),(0,r.jsx)(y,{variant:"anthropic",isOpen:g,onClose:()=>v(!1),onCreated:e=>{l(t=>[...t,e]),v(!1)}}),T&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>A(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>A(null),className:"p-1 hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(C,{results:T})})]})]})]})}function w({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:c,errorCode:d,errorTime:p,allDisabled:m}=s,u=!!t.noAuth;return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${m?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:m?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[j(i,c,d),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!m)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})})})]})})})}function k({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:m,errorTime:u,allDisabled:h}=s,f=e.startsWith(p.JH),b=e.startsWith(p.DI);return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:f&&t.apiType?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":(0,c.HY)(t.id),alt:t.name,size:30,className:"object-contain max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[j(i,d,m),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),u&&(0,r.jsx)("span",{className:"text-text-muted",children:u})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function C({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}y.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=51153)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{51153:(e,t,s)=>{Promise.resolve().then(s.bind(s,97678))},97678:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),c=s(8247),d=s(90620),p=s(88105),m=s(98500),x=s.n(m),u=s(65921),h=s(38003);let f={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function b(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,u.i)(),x=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{x();let e=setInterval(x,3e4);return()=>clearInterval(e)},[x]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let h=async(e,t)=>{d(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await x()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{d(null)}};if(s)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:x,className:"p-1 hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,s=c===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let g={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({variant:e,isOpen:t,onClose:s,onCreated:l}){let i=g[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[c,d]=(0,a.useState)(o),[p,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[b,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{i.hasApiType?d(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(w(null),u(""),f(""))},[i.hasApiType?c.apiType:t]);let k=async()=>{if(c.name.trim()&&c.prefix.trim()&&c.baseUrl.trim()){m(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.name,prefix:c.prefix,...i.hasApiType?{apiType:c.apiType}:{},baseUrl:c.baseUrl,type:i.type})}),t=await e.json();e.ok&&(l(t.node),d(o()),u(""),w(null))}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{m(!1)}}},C=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:c.baseUrl,apiKey:x,type:i.type,modelId:h.trim()||void 0})}),t=await e.json();w(t)}catch{w({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,r.jsx)(n.aF,{isOpen:t,title:i.title,onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:c.name,onChange:e=>d({...c,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:c.prefix,onChange:e=>d({...c,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,r.jsx)(n.l6,{label:"API Type",options:v,value:c.apiType,onChange:e=>d({...c,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:c.baseUrl,onChange:e=>d({...c,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:h,onChange:e=>f(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:C,disabled:!x||b||!c.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!N)return null;let{valid:e,error:t,method:s}=N;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:k,fullWidth:!0,disabled:!c.name.trim()||!c.prefix.trim()||!c.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function N(){let[e,t]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[c,m]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[T,A]=(0,a.useState)(null),I=(0,u.i)(),E=(0,h.C)(e=>e.query),$=(0,h.C)(e=>e.register),P=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>($("Search providers..."),()=>P()),[$,P]);let O=e=>!E.trim()||e.toLowerCase().includes(E.trim().toLowerCase()),R=(e,t)=>[...e].sort(([e,s],[r,a])=>{let l=s.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=S(e,t),o=S(r,t),c=+(n.connected>0),d=+(o.connected>0);return c!==d?d-c:(s.name||"").localeCompare(a.name||"")});(0,a.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await s.json();e.ok&&t(r.connections||[]),s.ok&&l(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}})()},[]);let S=(t,s)=>{let r=Array.isArray(s)?s:[s],a=e.filter(e=>e.provider===t&&r.includes(e.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=a.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=a.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,c=a.length,d=c>0&&a.every(e=>!1===e.isActive),p=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:c,errorCode:p?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(p):null,errorTime:p?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(p.lastErrorAt):null,allDisabled:d}},U=async(s,r,a)=>{let l=Array.isArray(r)?r:[r],i=e=>e.provider===s&&l.includes(e.authType),n=e.filter(i);t(e=>e.map(e=>i(e)?{...e,isActive:a}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},_=async(e,t=null)=>{if(!j){N("provider"===e?t:e),A(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(A(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?I.success(`All ${s} tests passed`):I.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){A({error:"Test request failed"}),I.error("Provider test failed")}finally{N(null)}}},z=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>O(e.name)),q=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#16a34a",textIcon:"AC"})).filter(e=>O(e.name)),D=R(Object.entries(d.zN).filter(([,e])=>!e.hidden&&O(e.name)),"oauth"),F=Object.entries(p.IS).filter(([,e])=>!e.hidden&&O(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),L=R(Object.entries(p.nJ).filter(([,e])=>!e.hidden&&O(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),M=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&O(e.name)).sort(([e,t],[s,r])=>{let a=S(e,"apikey").total>0?0:1,l=S(s,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(r.name||"")}),K=!!E.trim(),H=K||c?M:M.slice(0,20),J=M.length-20;if(i)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let B=D.length>0||F.length>0||L.length>0||M.length>0||z.length>0||q.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!B&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border ",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>v(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>f(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===z.length&&0===q.length?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,r.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...z,...q].map(e=>(0,r.jsx)(k,{providerId:e.id,provider:e,stats:S(e.id,"apikey"),authType:"compatible",onToggle:t=>U(e.id,"apikey",t)},e.id))})]}),D.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(b,{}),(0,r.jsxs)("button",{onClick:()=>_("oauth"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===j?" animate-spin":""}`,children:"play_arrow"}),"oauth"===j?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:D.map(([e,t])=>(0,r.jsx)(w,{providerId:e,provider:t,stats:S(e,"oauth"),authType:"oauth",onToggle:t=>U(e,"oauth",t)},e))})]}),(F.length>0||L.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>_("free"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===j?" animate-spin":""}`,children:"play_arrow"}),"free"===j?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[F.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,r.jsx)(w,{providerId:e,provider:t,stats:S(e,s),authType:"free",onToggle:t=>U(e,s,t)},e)}),L.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:S(e,"apikey"),authType:"apikey",onToggle:t=>U(e,"apikey",t)},e))]})]}),M.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>_("apikey"),disabled:!!j,className:`flex w-full items-center justify-center gap-1.5 border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===j?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===j?" animate-spin":""}`,children:"play_arrow"}),"apikey"===j?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:S(e,"apikey"),authType:"apikey",onToggle:t=>U(e,"apikey",t)},e))}),!K&&!c&&J>0&&(0,r.jsxs)("button",{onClick:()=>m(!0),className:"flex w-full items-center justify-center gap-1.5 border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",M.length," providers"]})]}),(0,r.jsx)(y,{variant:"openai",isOpen:x,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),(0,r.jsx)(y,{variant:"anthropic",isOpen:g,onClose:()=>v(!1),onCreated:e=>{l(t=>[...t,e]),v(!1)}}),T&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>A(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>A(null),className:"p-1 hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(C,{results:T})})]})]})]})}function w({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:c,errorCode:d,errorTime:p,allDisabled:m}=s,u=!!t.noAuth;return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${m?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:m?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[j(i,c,d),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!m)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})})})]})})})}function k({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:m,errorTime:u,allDisabled:h}=s,f=e.startsWith(p.JH),b=e.startsWith(p.DI);return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:f&&t.apiType?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":(0,c.HY)(t.id),alt:t.name,size:30,className:"object-contain max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[j(i,d,m),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),u&&(0,r.jsx)("span",{className:"text-text-muted",children:u})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function C({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}y.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}}},e=>{e.O(0,[8500,8591,1321,7451,5497,8441,3794,7358],()=>e(e.s=51153)),_N_E=e.O()}]);
@@ -1,4 +1,4 @@
1
1
  (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6812],{49469:(e,t,l)=>{Promise.resolve().then(l.bind(l,57076))},57076:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>n});var r=l(95155),s=l(12115),a=l(35497),o=l(65921);function i(e={}){return{name:e.name||"",proxyUrl:e.proxyUrl||"",noProxy:e.noProxy||"",isActive:!1!==e.isActive,strictProxy:!0===e.strictProxy}}function n(){let[e,t]=(0,s.useState)([]),[l,n]=(0,s.useState)(!0),[c,d]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),[u,y]=(0,s.useState)(!1),[f,g]=(0,s.useState)(!1),[j,b]=(0,s.useState)(!1),[v,k]=(0,s.useState)(null),[N,w]=(0,s.useState)(i()),[C,P]=(0,s.useState)(""),[$,D]=(0,s.useState)({vercelToken:"",projectName:"vercel-relay"}),[S,T]=(0,s.useState)({accountId:"",apiToken:"",projectName:"cloudflare-relay"}),[A,E]=(0,s.useState)({denoToken:"",orgDomain:"",projectName:""}),[I,U]=(0,s.useState)(!1),[O,z]=(0,s.useState)(!1),[F,W]=(0,s.useState)(!1),[R,_]=(0,s.useState)(null),[L,q]=(0,s.useState)([]),[V,J]=(0,s.useState)(!1),[B,G]=(0,s.useState)({current:0,total:0}),[M,H]=(0,s.useState)(!1),[Y,Q]=(0,s.useState)(null),K=(0,s.useRef)(null),Z=(0,o.i)();(0,s.useEffect)(()=>{let e=e=>{K.current&&!K.current.contains(e.target)&&b(!1)};return j&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[j]);let X=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/proxy-pools?includeUsage=true",{cache:"no-store"}),l=await e.json();e.ok&&t(l.proxyPools||[])}catch(e){console.log("Error fetching proxy pools:",e)}finally{n(!1)}},[]);(0,s.useEffect)(()=>{X()},[X]);let ee=()=>{k(null),w(i())},et=()=>{ee(),d(!0)},el=()=>{d(!1),ee()},er=async()=>{let e={name:N.name.trim(),proxyUrl:N.proxyUrl.trim(),noProxy:N.noProxy.trim(),isActive:!0===N.isActive,strictProxy:!0===N.strictProxy};if(e.name&&e.proxyUrl){U(!0);try{let t=!!v,l=await fetch(t?`/api/proxy-pools/${v.id}`:"/api/proxy-pools",{method:t?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(l.ok)await X(),el(),Z.success(v?"Proxy pool updated":"Proxy pool created");else{let e=await l.json();Z.error(e.error||"Failed to save proxy pool")}}catch(e){console.log("Error saving proxy pool:",e)}finally{U(!1)}}},es=async e=>{Q({title:"Delete Proxy Pool",message:`Delete proxy pool "${e.name}"?`,onConfirm:async()=>{Q(null);try{let l=await fetch(`/api/proxy-pools/${e.id}`,{method:"DELETE"});if(l.ok){t(t=>t.filter(t=>t.id!==e.id)),Z.success("Proxy pool deleted");return}let r=await l.json();409===l.status?Z.warning(`Cannot delete: ${r.boundConnectionCount||0} connection(s) are still using this pool.`):Z.error(r.error||"Failed to delete proxy pool")}catch(e){console.log("Error deleting proxy pool:",e),Z.error("Failed to delete proxy pool")}}})},ea=async e=>{_(e);try{let t=await fetch(`/api/proxy-pools/${e}/test`,{method:"POST"}),l=await t.json();if(!t.ok)return void Z.error(l.error||"Failed to test proxy");await X(),Z.success(l.ok?"Proxy test passed":"Proxy test failed")}catch(e){console.log("Error testing proxy pool:",e),Z.error("Failed to test proxy")}finally{_(null)}},eo=async e=>{let l=!e.isActive;t(t=>t.map(t=>t.id===e.id?{...t,isActive:l}:t));try{(await fetch(`/api/proxy-pools/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:l})})).ok||(t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t)),Z.error("Failed to update active state"))}catch(l){console.log("Error toggling active:",l),t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t))}},ei=e.length>0&&L.length===e.length,en=()=>q([]),ec=async t=>{let l=L.length>0?L:e.map(e=>e.id);if(0!==l.length){H(!0);try{let e=0,r=0;for(let s of l)try{(await fetch(`/api/proxy-pools/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok?e+=1:r+=1}catch{r+=1}await X(),Z.success(`${t?"Activated":"Deactivated"} ${e}${r?`, failed ${r}`:""}`)}finally{H(!1)}}},ed=async()=>{0!==L.length&&Q({title:"Delete Proxy Pools",message:`Delete ${L.length} proxy pool(s)?`,onConfirm:async()=>{Q(null),H(!0);try{let e=0,t=0,l=0;for(let r of L)try{let s=await fetch(`/api/proxy-pools/${r}`,{method:"DELETE"});s.ok?e+=1:409===s.status?t+=1:l+=1}catch{l+=1}await X(),en(),Z.success(`Deleted ${e}${t?`, ${t} bound`:""}${l?`, ${l} failed`:""}`)}finally{H(!1)}}})},ex=async()=>{let t=L.length>0?e.filter(e=>L.includes(e.id)):e;if(0===t.length)return;J(!0),G({current:0,total:t.length});let l=0,r=[],s=0,a=[...t],o=async()=>{for(;a.length>0;){let e=a.shift();if(!e)break;try{let t=await fetch(`/api/proxy-pools/${e.id}/test`,{method:"POST"}),s=await t.json();t.ok&&s.ok?l+=1:r.push(e.id)}catch{r.push(e.id)}finally{G({current:s+=1,total:t.length})}}};await Promise.all(Array.from({length:Math.min(10,t.length)},o)),await X(),J(!1),G({current:0,total:0}),r.length>0?Q({title:"Disable Dead Proxies",message:`Alive: ${l}, Dead: ${r.length}.
2
2
 
3
3
  Disable ${r.length} dead proxies?`,onConfirm:async()=>{Q(null),H(!0);try{for(let e of r)try{await fetch(`/api/proxy-pools/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:!1})})}catch{}await X(),Z.success(`Disabled ${r.length} dead proxies`)}finally{H(!1)}}}):Z.success(`Health check done. Alive: ${l}, Dead: ${r.length}`)};(0,s.useEffect)(()=>{q(t=>t.filter(t=>e.some(e=>e.id===t)))},[e]);let ep=()=>{O||p(!1)},em=()=>{F||h(!1)},eh=()=>{F||y(!1)},eu=()=>{F||g(!1)},ey=async()=>{if($.vercelToken.trim()){W(!0);try{let e=await fetch("/api/proxy-pools/vercel-deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)}),t=await e.json();e.ok?(await X(),em(),Z.success(`Deployed: ${t.deployUrl}`)):Z.error(t.error||"Deploy failed")}catch(e){console.log("Error deploying Vercel relay:",e),Z.error("Deploy failed")}finally{W(!1)}}},ef=async()=>{if(S.accountId.trim()&&S.apiToken.trim()){W(!0);try{let e=await fetch("/api/proxy-pools/cloudflare-deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)}),t=await e.json();e.ok?(await X(),eh(),Z.success(`Deployed: ${t.deployUrl}`)):Z.error(t.error||"Deploy failed")}catch(e){console.log("Error deploying Cloudflare relay:",e),Z.error("Deploy failed")}finally{W(!1)}}},eg=async()=>{if(A.denoToken.trim()){W(!0);try{let e=await fetch("/api/proxy-pools/deno-deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)}),t=await e.json();e.ok?(await X(),eu(),Z.success(`Deployed: ${t.deployUrl}`)):Z.error(t.error||"Deploy failed")}catch(e){console.log("Error deploying Deno relay:",e),Z.error("Deploy failed")}finally{W(!1)}}},ej=async()=>{let t=C.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(0===t.length)return void Z.warning("Please paste at least one proxy line.");let l=[],r=[];if(t.forEach((e,t)=>{try{let r=(e=>{let t=e.trim();if(!t)return null;if(t.includes("://")){let e=new URL(t),l=e.port?`${e.hostname}:${e.port}`:e.hostname;return{proxyUrl:e.toString(),name:`Imported ${l}`}}let l=t.split(":");if(4===l.length){let[e,t,r,s]=l;if(!e||!t||!r||!s)throw Error("Invalid host:port:user:pass format");return{proxyUrl:new URL(`http://${encodeURIComponent(r)}:${encodeURIComponent(s)}@${e}:${t}`).toString(),name:`Imported ${e}:${t}`}}throw Error("Unsupported format")})(e);r&&l.push({...r,lineNumber:t+1})}catch(e){r.push(`Line ${t+1}: ${e.message}`)}}),r.length>0)return void Z.error(`Invalid proxy format:
4
- ${r.join("\n")}`);z(!0);try{let t=new Set(e.map(e=>`${(e.proxyUrl||"").trim()}|||${(e.noProxy||"").trim()}`)),r=0,s=0,a=0;for(let e of l){let l=`${e.proxyUrl}|||`;if(t.has(l)){s+=1;continue}(await fetch("/api/proxy-pools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,proxyUrl:e.proxyUrl,noProxy:"",isActive:!0})})).ok?(r+=1,t.add(l)):a+=1}await X(),p(!1),Z.success(`Batch import completed: Created ${r}, Skipped ${s}, Failed ${a}`)}catch(e){console.log("Error batch importing proxies:",e),Z.error("Batch import failed")}finally{z(!1)}},eb=(0,s.useMemo)(()=>e.filter(e=>!0===e.isActive).length,[e]);return l?(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,r.jsx)(a.Qv,{}),(0,r.jsx)(a.Qv,{})]}):(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsx)("h1",{className:"text-xl font-semibold sm:text-2xl",children:"Proxy Pools"})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,r.jsxs)("div",{className:"relative",ref:K,children:[(0,r.jsxs)(a.$n,{size:"sm",variant:"secondary",icon:"rocket_launch",onClick:()=>b(!j),children:["Deploy Relay",(0,r.jsx)("span",{className:"material-symbols-outlined ml-1 text-[18px]",children:j?"expand_less":"expand_more"})]}),j&&(0,r.jsxs)("div",{className:"absolute left-0 top-full z-50 mt-1 w-48 border border-black/10 bg-white p-1 shadow-xl dark:border-white/10 dark:bg-zinc-900 sm:left-auto sm:right-0",children:[(0,r.jsxs)("button",{onClick:()=>{T({accountId:"",apiToken:"",projectName:"cloudflare-relay"}),y(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-green-500",children:"cloud"}),"Cloudflare Relay"]}),(0,r.jsxs)("button",{onClick:()=>{D({vercelToken:"",projectName:"vercel-relay"}),h(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-blue-500",children:"cloud_upload"}),"Vercel Relay"]}),(0,r.jsxs)("button",{onClick:()=>{E({denoToken:"",orgDomain:"",projectName:""}),g(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-green-500",children:"terminal"}),"Deno Relay"]})]})]}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>{P(""),p(!0)},children:"Batch Import"}),(0,r.jsx)(a.$n,{size:"sm",icon:"add",onClick:et,children:"Add Proxy Pool"})]})]}),(0,r.jsxs)(a.Zp,{children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.length>0&&(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:ei,onChange:()=>q(ei?[]:e.map(e=>e.id)),className:"size-4 border-black/20 dark:border-white/20"}),ei?"Unselect all":"Select all"]}),(0,r.jsxs)(a.Ex,{variant:"default",children:["Total: ",e.length]}),(0,r.jsxs)(a.Ex,{variant:"success",children:["Active: ",eb]})]}),(L.length>0||V)&&(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 border border-primary/30 bg-primary/5 px-3 py-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"checklist"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:L.length>0?`${L.length} selected`:"All pools"}),(0,r.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,r.jsx)(a.$n,{size:"sm",icon:V?"progress_activity":"health_and_safety",onClick:ex,disabled:V||M||0===e.length,children:V?`Checking ${B.current}/${B.total}`:"Health Check"}),L.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_on",onClick:()=>ec(!0),disabled:M||V,children:"Activate"}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_off",onClick:()=>ec(!1),disabled:M||V,children:"Deactivate"}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:ed,disabled:M||V,children:"Delete"}),(0,r.jsx)(a.$n,{size:"sm",variant:"ghost",onClick:en,disabled:M||V,children:"Clear"})]})]})]}),0===e.length?(0,r.jsxs)("div",{className:"text-center py-10",children:[(0,r.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No proxy pool entries yet"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create a proxy pool entry, then assign it to connections."}),(0,r.jsx)(a.$n,{icon:"add",onClick:et,children:"Add Proxy Pool"})]}):(0,r.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.04] dark:divide-white/[0.05]",children:e.map(e=>{var t;return(0,r.jsxs)("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[(0,r.jsx)("input",{type:"checkbox",checked:L.includes(e.id),onChange:()=>{let t;return t=e.id,q(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"mt-1 size-4 shrink-0 border-black/20 dark:border-white/20"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("p",{className:"min-w-0 max-w-full truncate text-sm font-medium sm:max-w-[18rem]",children:e.name}),(0,r.jsx)(a.Ex,{variant:"active"===(t=e.testStatus)?"success":"error"===t?"error":"default",size:"sm",dot:!0,children:e.testStatus||"unknown"}),(0,r.jsx)(a.Ex,{variant:e.isActive?"success":"default",size:"sm",children:e.isActive?"active":"inactive"}),"vercel"===e.type&&(0,r.jsx)(a.Ex,{variant:"default",size:"sm",children:"vercel relay"}),"cloudflare"===e.type&&(0,r.jsx)(a.Ex,{variant:"default",size:"sm",children:"cloudflare relay"}),(0,r.jsxs)(a.Ex,{variant:"default",size:"sm",children:[e.boundConnectionCount||0," bound"]})]}),(0,r.jsx)("p",{className:"text-xs text-text-muted truncate mt-1",children:e.proxyUrl}),e.noProxy?(0,r.jsxs)("p",{className:"text-xs text-text-muted truncate",children:["No proxy: ",e.noProxy]}):null,(0,r.jsxs)("p",{className:"text-[11px] text-text-muted mt-1",children:["Last tested: ",function(e){if(!e)return"Never";let t=new Date(e);return Number.isNaN(t.getTime())?"Never":t.toLocaleString()}(e.lastTestedAt),e.lastError?` \xb7 ${e.lastError}`:""]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,r.jsx)(a.lM,{size:"sm",checked:!0===e.isActive,onChange:()=>eo(e),title:e.isActive?"Disable":"Enable"}),(0,r.jsx)("button",{onClick:()=>ea(e.id),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Test proxy",disabled:R===e.id,children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:R===e.id?{animation:"spin 1s linear infinite"}:void 0,children:R===e.id?"progress_activity":"science"})}),(0,r.jsx)("button",{onClick:()=>{k(e),w(i(e)),d(!0)},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Edit",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,r.jsx)("button",{onClick:()=>es(e),className:"p-2 hover:bg-red-500/10 text-red-500",title:"Delete",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,r.jsx)(a.aF,{isOpen:x,title:"Batch Import Proxies",onClose:ep,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium text-text-main mb-1 block",children:"Paste Proxy List (One per line)"}),(0,r.jsx)("textarea",{value:C,onChange:e=>P(e.target.value),placeholder:"http://user:pass@127.0.0.1:7897\n127.0.0.1:7897:user:pass",className:"w-full min-h-[180px] py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Supported formats: protocol://user:pass@host:port, host:port:user:pass"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ej,disabled:!C.trim()||O,children:O?"Importing...":"Import"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:ep,disabled:O,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:m,title:"Deploy Vercel Relay",onClose:em,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-blue-500/5 border border-blue-500/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Vercel Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys an edge relay function to Vercel. All AI provider requests will be forwarded through Vercel's edge network, masking your real IP from providers."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"Your IP is replaced by Vercel's dynamic edge IPs (hundreds of IPs across 20+ global regions)"}),(0,r.jsx)("li",{children:"Vercel serves millions of apps — providers can't block Vercel IPs without affecting legitimate traffic"}),(0,r.jsx)("li",{children:"Free tier: 100GB bandwidth/month, 500K edge invocations"}),(0,r.jsx)("li",{children:"Deploy multiple relays on different accounts for more IP diversity"})]})]}),(0,r.jsx)(a.pd,{label:"Vercel API Token",value:$.vercelToken,onChange:e=>D(t=>({...t,vercelToken:e.target.value})),placeholder:"your-vercel-api-token",hint:(0,r.jsxs)(r.Fragment,{children:["Token is used once for deployment and not stored. ",(0,r.jsx)("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,r.jsx)(a.pd,{label:"Project Name",value:$.projectName,onChange:e=>D(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Vercel project. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ey,disabled:!$.vercelToken.trim()||F,children:F?"Deploying... (may take ~1 min)":"Deploy"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:em,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:u,title:"Deploy Cloudflare Relay",onClose:eh,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-green-500/5 border border-green-500/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Cloudflare Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys a Cloudflare Worker as a proxy relay. All AI provider requests will be forwarded through Cloudflare's global edge network."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"High performance global routing and IP masking via Cloudflare Workers"}),(0,r.jsx)("li",{children:"Free tier: 100,000 requests per day"}),(0,r.jsx)("li",{children:"Requires Cloudflare Account ID and a Workers API Token (Edit Workers permission)"})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-green-500/10 text-xs text-text-muted",children:[(0,r.jsx)("p",{className:"font-medium text-text-main mb-1",children:"How to generate your API Token:"}),(0,r.jsxs)("ol",{className:"list-decimal pl-4 space-y-0.5",children:[(0,r.jsxs)("li",{children:["Go to ",(0,r.jsx)("b",{children:"My Profile"})," → ",(0,r.jsx)("b",{children:"API Tokens"})," → ",(0,r.jsx)("b",{children:"Create Token"})]}),(0,r.jsxs)("li",{children:["Scroll down to ",(0,r.jsx)("b",{children:"Custom Token"})," and click ",(0,r.jsx)("b",{children:"Get started"})]}),(0,r.jsxs)("li",{children:["Under ",(0,r.jsx)("b",{children:"Permissions"}),": Account | Workers Scripts | Edit"]}),(0,r.jsxs)("li",{children:["Under ",(0,r.jsx)("b",{children:"Account Resources"}),": Include | Account | ",(0,r.jsx)("i",{children:"Your Account Name"})]}),(0,r.jsxs)("li",{children:["Click ",(0,r.jsx)("b",{children:"Continue to summary"})," → ",(0,r.jsx)("b",{children:"Create Token"})]})]})]})]}),(0,r.jsx)(a.pd,{label:"Account ID",value:S.accountId,onChange:e=>T(t=>({...t,accountId:e.target.value})),placeholder:"your-cloudflare-account-id",hint:(0,r.jsx)(r.Fragment,{children:"Found on the right side of the Cloudflare dashboard overview page."})}),(0,r.jsx)(a.pd,{label:"API Token",value:S.apiToken,onChange:e=>T(t=>({...t,apiToken:e.target.value})),placeholder:"your-cloudflare-api-token",hint:(0,r.jsxs)(r.Fragment,{children:['Requires "Workers Scripts: Edit" permission. ',(0,r.jsx)("a",{href:"https://dash.cloudflare.com/profile/api-tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,r.jsx)(a.pd,{label:"Worker Name",value:S.projectName,onChange:e=>T(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Cloudflare Worker. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ef,disabled:!S.accountId.trim()||!S.apiToken.trim()||F,children:F?"Deploying...":"Deploy Worker"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:eh,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:f,title:"Deploy Deno Relay",onClose:eu,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Deno Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys a relay worker to Deno Deploy's global edge network. All AI provider requests are forwarded through Deno's edge, masking your real IP."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"Deno Deploy v2 runs on a high-performance global edge network"}),(0,r.jsx)("li",{children:"Free tier: 1M requests & 100GiB outbound traffic per month"}),(0,r.jsx)("li",{children:"No per-request CPU time limits (unlike Vercel/Cloudflare)"}),(0,r.jsx)("li",{children:"Support up to 20 active apps & 50 custom domains"}),(0,r.jsx)("li",{children:"Deploy multiple relays for maximum IP diversity"})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-black/10 dark:border-white/10 text-xs text-text-muted",children:[(0,r.jsx)("p",{className:"font-medium text-text-main mb-1",children:"How to generate API token:"}),(0,r.jsxs)("ol",{className:"list-decimal pl-4 space-y-0.5",children:[(0,r.jsxs)("li",{children:["Go to ",(0,r.jsx)("b",{children:"console.deno.com"})]}),(0,r.jsxs)("li",{children:["Select your ",(0,r.jsx)("b",{children:"Organization"})," → ",(0,r.jsx)("b",{children:"Settings"})," → ",(0,r.jsx)("b",{children:"Organization Tokens"})]}),(0,r.jsxs)("li",{children:["Create a ",(0,r.jsx)("b",{children:"Organization Token"})," (prefix ",(0,r.jsx)("b",{children:"ddo_"}),")"]})]})]})]}),(0,r.jsx)(a.pd,{label:"Deno Deploy API Token",value:A.denoToken,onChange:e=>E(t=>({...t,denoToken:e.target.value})),placeholder:"ddo_xxxxxxxxxxxxxxxx",hint:(0,r.jsx)(r.Fragment,{children:"Token is used once for deployment, not stored. Found in Organization Settings."}),type:"password"}),(0,r.jsx)(a.pd,{label:"Organization Domain",value:A.orgDomain,onChange:e=>E(t=>({...t,orgDomain:e.target.value})),placeholder:"your-org.deno.net",hint:"Organization's default domain. Your relay URL will be in the format: https://my-relay.your-org.deno.net"}),(0,r.jsx)(a.pd,{label:"App Name",value:A.projectName,onChange:e=>E(t=>({...t,projectName:e.target.value})),placeholder:"deno-relay",hint:"Unique app name. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:eg,disabled:!A.denoToken.trim()||!A.orgDomain.trim()||F,children:F?"Deploying...":"Deploy Relay"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:eu,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:c,title:v?"Edit Proxy Pool":"Add Proxy Pool",onClose:el,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.pd,{label:"Name",value:N.name,onChange:e=>w(t=>({...t,name:e.target.value})),placeholder:"Office Proxy"}),(0,r.jsx)(a.pd,{label:"Proxy URL",value:N.proxyUrl,onChange:e=>w(t=>({...t,proxyUrl:e.target.value})),placeholder:"http://127.0.0.1:7897"}),(0,r.jsx)(a.pd,{label:"No Proxy",value:N.noProxy,onChange:e=>w(t=>({...t,noProxy:e.target.value})),placeholder:"localhost,127.0.0.1,.internal",hint:"Comma-separated hosts/domains to bypass proxy"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium text-sm",children:"Active"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Inactive pools are ignored by runtime resolution."})]}),(0,r.jsx)(a.lM,{checked:!0===N.isActive,onChange:()=>w(e=>({...e,isActive:!e.isActive})),disabled:I})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium text-sm",children:"Strict Proxy"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Fail request if proxy is unreachable instead of falling back to direct."})]}),(0,r.jsx)(a.lM,{checked:!0===N.strictProxy,onChange:()=>w(e=>({...e,strictProxy:!e.strictProxy})),disabled:I})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:er,disabled:!N.name.trim()||!N.proxyUrl.trim()||I,children:I?"Saving...":"Save"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:el,disabled:I,children:"Cancel"})]})]})}),(0,r.jsx)(a.uo,{isOpen:!!Y,onClose:()=>Q(null),onConfirm:Y?.onConfirm,title:Y?.title||"Confirm",message:Y?.message,variant:"danger"})]})}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=49469)),_N_E=e.O()}]);
4
+ ${r.join("\n")}`);z(!0);try{let t=new Set(e.map(e=>`${(e.proxyUrl||"").trim()}|||${(e.noProxy||"").trim()}`)),r=0,s=0,a=0;for(let e of l){let l=`${e.proxyUrl}|||`;if(t.has(l)){s+=1;continue}(await fetch("/api/proxy-pools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,proxyUrl:e.proxyUrl,noProxy:"",isActive:!0})})).ok?(r+=1,t.add(l)):a+=1}await X(),p(!1),Z.success(`Batch import completed: Created ${r}, Skipped ${s}, Failed ${a}`)}catch(e){console.log("Error batch importing proxies:",e),Z.error("Batch import failed")}finally{z(!1)}},eb=(0,s.useMemo)(()=>e.filter(e=>!0===e.isActive).length,[e]);return l?(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,r.jsx)(a.Qv,{}),(0,r.jsx)(a.Qv,{})]}):(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsx)("h1",{className:"text-xl font-semibold sm:text-2xl",children:"Proxy Pools"})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,r.jsxs)("div",{className:"relative",ref:K,children:[(0,r.jsxs)(a.$n,{size:"sm",variant:"secondary",icon:"rocket_launch",onClick:()=>b(!j),children:["Deploy Relay",(0,r.jsx)("span",{className:"material-symbols-outlined ml-1 text-[18px]",children:j?"expand_less":"expand_more"})]}),j&&(0,r.jsxs)("div",{className:"absolute left-0 top-full z-50 mt-1 w-48 border border-black/10 bg-white p-1 shadow-xl dark:border-white/10 dark:bg-zinc-900 sm:left-auto sm:right-0",children:[(0,r.jsxs)("button",{onClick:()=>{T({accountId:"",apiToken:"",projectName:"cloudflare-relay"}),y(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-green-500",children:"cloud"}),"Cloudflare Relay"]}),(0,r.jsxs)("button",{onClick:()=>{D({vercelToken:"",projectName:"vercel-relay"}),h(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-blue-500",children:"cloud_upload"}),"Vercel Relay"]}),(0,r.jsxs)("button",{onClick:()=>{E({denoToken:"",orgDomain:"",projectName:""}),g(!0),b(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-text-main transition-colors hover:bg-black/5 dark:hover:bg-white/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-green-500",children:"terminal"}),"Deno Relay"]})]})]}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>{P(""),p(!0)},children:"Batch Import"}),(0,r.jsx)(a.$n,{size:"sm",icon:"add",onClick:et,children:"Add Proxy Pool"})]})]}),(0,r.jsxs)(a.Zp,{children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.length>0&&(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:ei,onChange:()=>q(ei?[]:e.map(e=>e.id)),className:"size-4 border-black/20 dark:border-white/20"}),ei?"Unselect all":"Select all"]}),(0,r.jsxs)(a.Ex,{variant:"default",children:["Total: ",e.length]}),(0,r.jsxs)(a.Ex,{variant:"success",children:["Active: ",eb]})]}),(L.length>0||V)&&(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 border border-primary/30 bg-primary/5 px-3 py-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"checklist"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:L.length>0?`${L.length} selected`:"All pools"}),(0,r.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,r.jsx)(a.$n,{size:"sm",icon:V?"progress_activity":"health_and_safety",onClick:ex,disabled:V||M||0===e.length,children:V?`Checking ${B.current}/${B.total}`:"Health Check"}),L.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_on",onClick:()=>ec(!0),disabled:M||V,children:"Activate"}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_off",onClick:()=>ec(!1),disabled:M||V,children:"Deactivate"}),(0,r.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:ed,disabled:M||V,children:"Delete"}),(0,r.jsx)(a.$n,{size:"sm",variant:"ghost",onClick:en,disabled:M||V,children:"Clear"})]})]})]}),0===e.length?(0,r.jsxs)("div",{className:"text-center py-10",children:[(0,r.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No proxy pool entries yet"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create a proxy pool entry, then assign it to connections."}),(0,r.jsx)(a.$n,{icon:"add",onClick:et,children:"Add Proxy Pool"})]}):(0,r.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.04] dark:divide-white/[0.05]",children:e.map(e=>{var t;return(0,r.jsxs)("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[(0,r.jsx)("input",{type:"checkbox",checked:L.includes(e.id),onChange:()=>{let t;return t=e.id,q(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"mt-1 size-4 shrink-0 border-black/20 dark:border-white/20"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("p",{className:"min-w-0 max-w-full truncate text-sm font-medium sm:max-w-[18rem]",children:e.name}),(0,r.jsx)(a.Ex,{variant:"active"===(t=e.testStatus)?"success":"error"===t?"error":"default",size:"sm",dot:!0,children:e.testStatus||"unknown"}),(0,r.jsx)(a.Ex,{variant:e.isActive?"success":"default",size:"sm",children:e.isActive?"active":"inactive"}),"vercel"===e.type&&(0,r.jsx)(a.Ex,{variant:"default",size:"sm",children:"vercel relay"}),"cloudflare"===e.type&&(0,r.jsx)(a.Ex,{variant:"default",size:"sm",children:"cloudflare relay"}),(0,r.jsxs)(a.Ex,{variant:"default",size:"sm",children:[e.boundConnectionCount||0," bound"]})]}),(0,r.jsx)("p",{className:"text-xs text-text-muted truncate mt-1",children:e.proxyUrl}),e.noProxy?(0,r.jsxs)("p",{className:"text-xs text-text-muted truncate",children:["No proxy: ",e.noProxy]}):null,(0,r.jsxs)("p",{className:"text-[11px] text-text-muted mt-1",children:["Last tested: ",function(e){if(!e)return"Never";let t=new Date(e);return Number.isNaN(t.getTime())?"Never":t.toLocaleString()}(e.lastTestedAt),e.lastError?` \xb7 ${e.lastError}`:""]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,r.jsx)(a.lM,{size:"sm",checked:!0===e.isActive,onChange:()=>eo(e),title:e.isActive?"Disable":"Enable"}),(0,r.jsx)("button",{onClick:()=>ea(e.id),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Test proxy",disabled:R===e.id,children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:R===e.id?{animation:"spin 1s linear infinite"}:void 0,children:R===e.id?"progress_activity":"science"})}),(0,r.jsx)("button",{onClick:()=>{k(e),w(i(e)),d(!0)},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Edit",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,r.jsx)("button",{onClick:()=>es(e),className:"p-2 hover:bg-red-500/10 text-red-500",title:"Delete",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,r.jsx)(a.aF,{isOpen:x,title:"Batch Import Proxies",onClose:ep,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium text-text-main mb-1 block",children:"Paste Proxy List (One per line)"}),(0,r.jsx)("textarea",{value:C,onChange:e=>P(e.target.value),placeholder:"http://user:pass@127.0.0.1:7897\n127.0.0.1:7897:user:pass",className:"w-full min-h-[180px] py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Supported formats: protocol://user:pass@host:port, host:port:user:pass"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ej,disabled:!C.trim()||O,children:O?"Importing...":"Import"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:ep,disabled:O,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:m,title:"Deploy Vercel Relay",onClose:em,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-blue-500/5 border border-blue-500/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Vercel Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys an edge relay function to Vercel. All AI provider requests will be forwarded through Vercel's edge network, masking your real IP from providers."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"Your IP is replaced by Vercel's dynamic edge IPs (hundreds of IPs across 20+ global regions)"}),(0,r.jsx)("li",{children:"Vercel serves millions of apps — providers can't block Vercel IPs without affecting legitimate traffic"}),(0,r.jsx)("li",{children:"Free tier: 100GB bandwidth/month, 500K edge invocations"}),(0,r.jsx)("li",{children:"Deploy multiple relays on different accounts for more IP diversity"})]})]}),(0,r.jsx)(a.pd,{label:"Vercel API Token",value:$.vercelToken,onChange:e=>D(t=>({...t,vercelToken:e.target.value})),placeholder:"your-vercel-api-token",hint:(0,r.jsxs)(r.Fragment,{children:["Token is used once for deployment and not stored. ",(0,r.jsx)("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,r.jsx)(a.pd,{label:"Project Name",value:$.projectName,onChange:e=>D(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Vercel project. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ey,disabled:!$.vercelToken.trim()||F,children:F?"Deploying... (may take ~1 min)":"Deploy"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:em,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:u,title:"Deploy Cloudflare Relay",onClose:eh,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-green-500/5 border border-green-500/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Cloudflare Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys a Cloudflare Worker as a proxy relay. All AI provider requests will be forwarded through Cloudflare's global edge network."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"High performance global routing and IP masking via Cloudflare Workers"}),(0,r.jsx)("li",{children:"Free tier: 100,000 requests per day"}),(0,r.jsx)("li",{children:"Requires Cloudflare Account ID and a Workers API Token (Edit Workers permission)"})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-green-500/10 text-xs text-text-muted",children:[(0,r.jsx)("p",{className:"font-medium text-text-main mb-1",children:"How to generate your API Token:"}),(0,r.jsxs)("ol",{className:"list-decimal pl-4 space-y-0.5",children:[(0,r.jsxs)("li",{children:["Go to ",(0,r.jsx)("b",{children:"My Profile"})," → ",(0,r.jsx)("b",{children:"API Tokens"})," → ",(0,r.jsx)("b",{children:"Create Token"})]}),(0,r.jsxs)("li",{children:["Scroll down to ",(0,r.jsx)("b",{children:"Custom Token"})," and click ",(0,r.jsx)("b",{children:"Get started"})]}),(0,r.jsxs)("li",{children:["Under ",(0,r.jsx)("b",{children:"Permissions"}),": Account | Workers Scripts | Edit"]}),(0,r.jsxs)("li",{children:["Under ",(0,r.jsx)("b",{children:"Account Resources"}),": Include | Account | ",(0,r.jsx)("i",{children:"Your Account Name"})]}),(0,r.jsxs)("li",{children:["Click ",(0,r.jsx)("b",{children:"Continue to summary"})," → ",(0,r.jsx)("b",{children:"Create Token"})]})]})]})]}),(0,r.jsx)(a.pd,{label:"Account ID",value:S.accountId,onChange:e=>T(t=>({...t,accountId:e.target.value})),placeholder:"your-cloudflare-account-id",hint:(0,r.jsx)(r.Fragment,{children:"Found on the right side of the Cloudflare dashboard overview page."})}),(0,r.jsx)(a.pd,{label:"API Token",value:S.apiToken,onChange:e=>T(t=>({...t,apiToken:e.target.value})),placeholder:"your-cloudflare-api-token",hint:(0,r.jsxs)(r.Fragment,{children:['Requires "Workers Scripts: Edit" permission. ',(0,r.jsx)("a",{href:"https://dash.cloudflare.com/profile/api-tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,r.jsx)(a.pd,{label:"Worker Name",value:S.projectName,onChange:e=>T(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Cloudflare Worker. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:ef,disabled:!S.accountId.trim()||!S.apiToken.trim()||F,children:F?"Deploying...":"Deploy Worker"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:eh,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:f,title:"Deploy Deno Relay",onClose:eu,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:" bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 p-3 flex flex-col gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Deno Relay?"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys a relay worker to Deno Deploy's global edge network. All AI provider requests are forwarded through Deno's edge, masking your real IP."}),(0,r.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,r.jsx)("li",{children:"Deno Deploy v2 runs on a high-performance global edge network"}),(0,r.jsx)("li",{children:"Free tier: 1M requests & 100GiB outbound traffic per month"}),(0,r.jsx)("li",{children:"No per-request CPU time limits (unlike Vercel/Cloudflare)"}),(0,r.jsx)("li",{children:"Support up to 20 active apps & 50 custom domains"}),(0,r.jsx)("li",{children:"Deploy multiple relays for maximum IP diversity"})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-black/10 dark:border-white/10 text-xs text-text-muted",children:[(0,r.jsx)("p",{className:"font-medium text-text-main mb-1",children:"How to generate API token:"}),(0,r.jsxs)("ol",{className:"list-decimal pl-4 space-y-0.5",children:[(0,r.jsxs)("li",{children:["Go to ",(0,r.jsx)("b",{children:"console.deno.com"})]}),(0,r.jsxs)("li",{children:["Select your ",(0,r.jsx)("b",{children:"Organization"})," → ",(0,r.jsx)("b",{children:"Settings"})," → ",(0,r.jsx)("b",{children:"Organization Tokens"})]}),(0,r.jsxs)("li",{children:["Create a ",(0,r.jsx)("b",{children:"Organization Token"})," (prefix ",(0,r.jsx)("b",{children:"ddo_"}),")"]})]})]})]}),(0,r.jsx)(a.pd,{label:"Deno Deploy API Token",value:A.denoToken,onChange:e=>E(t=>({...t,denoToken:e.target.value})),placeholder:"ddo_xxxxxxxxxxxxxxxx",hint:(0,r.jsx)(r.Fragment,{children:"Token is used once for deployment, not stored. Found in Organization Settings."}),type:"password"}),(0,r.jsx)(a.pd,{label:"Organization Domain",value:A.orgDomain,onChange:e=>E(t=>({...t,orgDomain:e.target.value})),placeholder:"your-org.deno.net",hint:"Organization's default domain. Your relay URL will be in the format: https://my-relay.your-org.deno.net"}),(0,r.jsx)(a.pd,{label:"App Name",value:A.projectName,onChange:e=>E(t=>({...t,projectName:e.target.value})),placeholder:"deno-relay",hint:"Unique app name. Leave empty for auto-generated name."}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:eg,disabled:!A.denoToken.trim()||!A.orgDomain.trim()||F,children:F?"Deploying...":"Deploy Relay"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:eu,disabled:F,children:"Cancel"})]})]})}),(0,r.jsx)(a.aF,{isOpen:c,title:v?"Edit Proxy Pool":"Add Proxy Pool",onClose:el,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(a.pd,{label:"Name",value:N.name,onChange:e=>w(t=>({...t,name:e.target.value})),placeholder:"Office Proxy"}),(0,r.jsx)(a.pd,{label:"Proxy URL",value:N.proxyUrl,onChange:e=>w(t=>({...t,proxyUrl:e.target.value})),placeholder:"http://127.0.0.1:7897"}),(0,r.jsx)(a.pd,{label:"No Proxy",value:N.noProxy,onChange:e=>w(t=>({...t,noProxy:e.target.value})),placeholder:"localhost,127.0.0.1,.internal",hint:"Comma-separated hosts/domains to bypass proxy"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium text-sm",children:"Active"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Inactive pools are ignored by runtime resolution."})]}),(0,r.jsx)(a.lM,{checked:!0===N.isActive,onChange:()=>w(e=>({...e,isActive:!e.isActive})),disabled:I})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium text-sm",children:"Strict Proxy"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Fail request if proxy is unreachable instead of falling back to direct."})]}),(0,r.jsx)(a.lM,{checked:!0===N.strictProxy,onChange:()=>w(e=>({...e,strictProxy:!e.strictProxy})),disabled:I})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,r.jsx)(a.$n,{fullWidth:!0,onClick:er,disabled:!N.name.trim()||!N.proxyUrl.trim()||I,children:I?"Saving...":"Save"}),(0,r.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:el,disabled:I,children:"Cancel"})]})]})}),(0,r.jsx)(a.uo,{isOpen:!!Y,onClose:()=>Q(null),onConfirm:Y?.onConfirm,title:Y?.title||"Confirm",message:Y?.message,variant:"danger"})]})}}},e=>{e.O(0,[8500,8591,1321,7451,5497,8441,3794,7358],()=>e(e.s=49469)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7414],{18796:(e,t,s)=>{Promise.resolve().then(s.bind(s,71470))},71470:(e,t,s)=>{"use strict";s.d(t,{default:()=>j});var a=s(95155),l=s(12115),r=s(21742),i=s(63346),d=s(77496),n=s(32539),o=s(59656),x=s(51037),c=s(31310),m=s(35497);let p=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0),h=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"last7d",label:"7 days"},{id:"last30d",label:"30 days"},{id:"all",label:"All time"}],u={applied:"Prompt exceeded threshold",below_threshold:"Below size threshold",not_profitable:"Compression not profitable",below_min_chars:"Below minimum chars",below_min_tokens:"Below minimum tokens",unsupported_model:"Model not in allowlist",unsupported_format:"Non-Claude request format",timeout:"Compression timed out",transform_error:"Transform error",passthrough:"Passthrough",disabled:"Disabled",not_installed:"Not installed"};function g({label:e,value:t,sub:s,tone:l}){return(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted uppercase tracking-wide",children:e}),(0,a.jsx)("p",{className:`text-xl font-semibold mt-1 ${l||""}`,children:t}),s&&(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:s})]})}function j(){let[e,t]=(0,l.useState)(null),[s,j]=(0,l.useState)(null),[b,f]=(0,l.useState)(null),[N,y]=(0,l.useState)(null),[v,w]=(0,l.useState)("last7d"),[k,S]=(0,l.useState)(!0),P=(0,l.useCallback)(async()=>{S(!0);try{let[e,s,a]=await Promise.all([fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),fetch("/api/pxpipe/stats"),fetch("/api/pxpipe/logs?limit=50")]);t(await e.json()),f(await s.json()),y(await a.json());let l=await fetch("/api/pxpipe/health",{method:"POST"});j(await l.json())}catch{}finally{S(!1)}},[]);(0,l.useEffect)(()=>{P()},[P]);let E=b?.windows?.[v],$=e?e.installed?s?.healthy?"Healthy":e.running?"Running":"Stopped":"Not installed":"—";return(0,a.jsxs)("div",{className:"space-y-6 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"image"}),"PXPIPE Dashboard"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("a",{href:"/dashboard/token-saver",className:"text-xs text-primary underline hover:opacity-80",children:"Token Saver settings"}),(0,a.jsx)(m.$n,{size:"sm",variant:"ghost",onClick:P,disabled:k,children:k?"Refreshing…":"Refresh"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[(0,a.jsx)(g,{label:"Status",value:$,tone:s?.healthy?"text-success":e?.installed?"text-warning":"text-text-muted",sub:e?.enabled?"Enabled in pipeline":"Disabled in pipeline"}),(0,a.jsx)(g,{label:"Version",value:e?.version?`v${e.version}`:"—",sub:"pxpipe-proxy"}),(0,a.jsx)(g,{label:"Uptime",value:(e=>{if(!e||e<=0)return"—";let t=Math.floor(e/6e4),s=Math.floor(t/60);return s>0?`${s}h${String(t%60).padStart(2,"0")}m`:`${t}m`})(e?.uptimeMs),sub:"module loaded"}),(0,a.jsx)(g,{label:"Requests",value:E?E.requests.toLocaleString():"—"}),(0,a.jsx)(g,{label:"Compressed",value:E?E.compressed.toLocaleString():"—",tone:"text-success"}),(0,a.jsx)(g,{label:"Bypassed",value:E?E.bypassed.toLocaleString():"—"})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-4",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Token savings (estimated)"}),(0,a.jsx)("div",{className:"flex items-center gap-1 border border-border bg-bg-subtle p-1",children:h.map(e=>(0,a.jsx)("button",{onClick:()=>w(e.id),className:`px-3 py-1 text-xs font-medium transition-colors ${v===e.id?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.id))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Original tokens"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensBeforeEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"After PXPIPE"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensAfterEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Saved"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?p(E.tokensSavedEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Reduction"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?`${E.savedPct}%`:"—"})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3",children:["Estimates from body size before/after imaging; billed usage per request (recorded on the Usage page) remains the ground truth. Images generated:"," ",E?E.imagesGenerated.toLocaleString():"—"," \xb7 avg compression time:"," ",E?`${E.avgCompressionMs}ms`:"—"," \xb7 errors: ",E?E.errors:"—"]})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"Tokens saved — last 30 days"}),b?.timeline?.some(e=>e.tokensSavedEst>0)?(0,a.jsx)(r.u,{width:"100%",height:220,children:(0,a.jsxs)(i.Q,{data:b.timeline,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"gradPxpipe",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.25}),(0,a.jsx)("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]})}),(0,a.jsx)(d.d,{strokeDasharray:"3 3",strokeOpacity:.2}),(0,a.jsx)(n.W,{dataKey:"date",tick:{fontSize:11},tickFormatter:e=>e.slice(5)}),(0,a.jsx)(o.h,{tick:{fontSize:11},tickFormatter:p,width:48}),(0,a.jsx)(x.m,{formatter:e=>[p(e),"Tokens saved"],labelFormatter:e=>e}),(0,a.jsx)(c.Gk,{type:"monotone",dataKey:"tokensSavedEst",stroke:"#10b981",fill:"url(#gradPxpipe)",strokeWidth:2})]})}):(0,a.jsx)("div",{className:"h-32 flex items-center justify-center text-text-muted text-sm",children:"No savings recorded yet — enable PXPIPE in the Token Saver and route a large Claude-format request."})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"History"}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"py-2 pr-3",children:"Time"}),(0,a.jsx)("th",{className:"py-2 pr-3",children:"Model"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Original"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Compressed"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Saved"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"%"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Duration"}),(0,a.jsx)("th",{className:"py-2",children:"Status"})]})}),(0,a.jsxs)("tbody",{children:[(b?.recent||[]).slice(0,50).map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-border/50",children:[(0,a.jsx)("td",{className:"py-1.5 pr-3 whitespace-nowrap text-text-muted",children:new Date(e.ts).toLocaleString()}),(0,a.jsx)("td",{className:"py-1.5 pr-3 font-mono text-xs",children:e.provider?`${e.provider}/${e.model}`:e.model||"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensBeforeEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensAfterEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs text-success",children:e.applied?p(e.tokensSavedEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?`${e.savedPct}%`:"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:null!=e.durationMs?`${e.durationMs}ms`:"—"}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)("span",{className:`text-xs px-2 py-0.5 ${e.applied?"bg-success/15 text-success":"transform_error"===e.reason||"timeout"===e.reason?"bg-danger/15 text-danger":"bg-warning/15 text-warning"}`,title:e.detail||"",children:e.applied?"Compressed":u[e.reason]||e.reason})})]},`${e.ts}-${t}`)),(!b?.recent||0===b.recent.length)&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:8,className:"py-6 text-center text-text-muted text-sm",children:"No PXPIPE activity yet"})})]})]})})]}),(0,a.jsxs)(m.Zp,{className:"p-4",id:"logs",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"PXPIPE Logs"}),N?.installLog?(0,a.jsx)("pre",{className:" bg-black/5 dark:bg-white/5 p-3 text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:N.installLog}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No install log yet."})]})]})}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=18796)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7414],{18796:(e,t,s)=>{Promise.resolve().then(s.bind(s,71470))},71470:(e,t,s)=>{"use strict";s.d(t,{default:()=>j});var a=s(95155),l=s(12115),r=s(21742),i=s(63346),d=s(77496),n=s(32539),o=s(59656),x=s(51037),c=s(31310),m=s(35497);let p=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0),h=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"last7d",label:"7 days"},{id:"last30d",label:"30 days"},{id:"all",label:"All time"}],u={applied:"Prompt exceeded threshold",below_threshold:"Below size threshold",not_profitable:"Compression not profitable",below_min_chars:"Below minimum chars",below_min_tokens:"Below minimum tokens",unsupported_model:"Model not in allowlist",unsupported_format:"Non-Claude request format",timeout:"Compression timed out",transform_error:"Transform error",passthrough:"Passthrough",disabled:"Disabled",not_installed:"Not installed"};function g({label:e,value:t,sub:s,tone:l}){return(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted uppercase tracking-wide",children:e}),(0,a.jsx)("p",{className:`text-xl font-semibold mt-1 ${l||""}`,children:t}),s&&(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:s})]})}function j(){let[e,t]=(0,l.useState)(null),[s,j]=(0,l.useState)(null),[b,f]=(0,l.useState)(null),[N,y]=(0,l.useState)(null),[v,w]=(0,l.useState)("last7d"),[k,S]=(0,l.useState)(!0),P=(0,l.useCallback)(async()=>{S(!0);try{let[e,s,a]=await Promise.all([fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),fetch("/api/pxpipe/stats"),fetch("/api/pxpipe/logs?limit=50")]);t(await e.json()),f(await s.json()),y(await a.json());let l=await fetch("/api/pxpipe/health",{method:"POST"});j(await l.json())}catch{}finally{S(!1)}},[]);(0,l.useEffect)(()=>{P()},[P]);let E=b?.windows?.[v],$=e?e.installed?s?.healthy?"Healthy":e.running?"Running":"Stopped":"Not installed":"—";return(0,a.jsxs)("div",{className:"space-y-6 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"image"}),"PXPIPE Dashboard"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("a",{href:"/dashboard/token-saver",className:"text-xs text-primary underline hover:opacity-80",children:"Token Saver settings"}),(0,a.jsx)(m.$n,{size:"sm",variant:"ghost",onClick:P,disabled:k,children:k?"Refreshing…":"Refresh"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[(0,a.jsx)(g,{label:"Status",value:$,tone:s?.healthy?"text-success":e?.installed?"text-warning":"text-text-muted",sub:e?.enabled?"Enabled in pipeline":"Disabled in pipeline"}),(0,a.jsx)(g,{label:"Version",value:e?.version?`v${e.version}`:"—",sub:"pxpipe-proxy"}),(0,a.jsx)(g,{label:"Uptime",value:(e=>{if(!e||e<=0)return"—";let t=Math.floor(e/6e4),s=Math.floor(t/60);return s>0?`${s}h${String(t%60).padStart(2,"0")}m`:`${t}m`})(e?.uptimeMs),sub:"module loaded"}),(0,a.jsx)(g,{label:"Requests",value:E?E.requests.toLocaleString():"—"}),(0,a.jsx)(g,{label:"Compressed",value:E?E.compressed.toLocaleString():"—",tone:"text-success"}),(0,a.jsx)(g,{label:"Bypassed",value:E?E.bypassed.toLocaleString():"—"})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-4",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Token savings (estimated)"}),(0,a.jsx)("div",{className:"flex items-center gap-1 border border-border bg-bg-subtle p-1",children:h.map(e=>(0,a.jsx)("button",{onClick:()=>w(e.id),className:`px-3 py-1 text-xs font-medium transition-colors ${v===e.id?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.id))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Original tokens"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensBeforeEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"After PXPIPE"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:E?p(E.tokensAfterEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Saved"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?p(E.tokensSavedEst):"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Reduction"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-success",children:E?`${E.savedPct}%`:"—"})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3",children:["Estimates from body size before/after imaging; billed usage per request (recorded on the Usage page) remains the ground truth. Images generated:"," ",E?E.imagesGenerated.toLocaleString():"—"," \xb7 avg compression time:"," ",E?`${E.avgCompressionMs}ms`:"—"," \xb7 errors: ",E?E.errors:"—"]})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"Tokens saved — last 30 days"}),b?.timeline?.some(e=>e.tokensSavedEst>0)?(0,a.jsx)(r.u,{width:"100%",height:220,children:(0,a.jsxs)(i.Q,{data:b.timeline,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"gradPxpipe",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.25}),(0,a.jsx)("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]})}),(0,a.jsx)(d.d,{strokeDasharray:"3 3",strokeOpacity:.2}),(0,a.jsx)(n.W,{dataKey:"date",tick:{fontSize:11},tickFormatter:e=>e.slice(5)}),(0,a.jsx)(o.h,{tick:{fontSize:11},tickFormatter:p,width:48}),(0,a.jsx)(x.m,{formatter:e=>[p(e),"Tokens saved"],labelFormatter:e=>e}),(0,a.jsx)(c.Gk,{type:"monotone",dataKey:"tokensSavedEst",stroke:"#10b981",fill:"url(#gradPxpipe)",strokeWidth:2})]})}):(0,a.jsx)("div",{className:"h-32 flex items-center justify-center text-text-muted text-sm",children:"No savings recorded yet — enable PXPIPE in the Token Saver and route a large Claude-format request."})]}),(0,a.jsxs)(m.Zp,{className:"p-4",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"History"}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"py-2 pr-3",children:"Time"}),(0,a.jsx)("th",{className:"py-2 pr-3",children:"Model"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Original"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Compressed"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Saved"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"%"}),(0,a.jsx)("th",{className:"py-2 pr-3 text-right",children:"Duration"}),(0,a.jsx)("th",{className:"py-2",children:"Status"})]})}),(0,a.jsxs)("tbody",{children:[(b?.recent||[]).slice(0,50).map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-border/50",children:[(0,a.jsx)("td",{className:"py-1.5 pr-3 whitespace-nowrap text-text-muted",children:new Date(e.ts).toLocaleString()}),(0,a.jsx)("td",{className:"py-1.5 pr-3 font-mono text-xs",children:e.provider?`${e.provider}/${e.model}`:e.model||"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensBeforeEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?p(e.tokensAfterEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs text-success",children:e.applied?p(e.tokensSavedEst):"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:e.applied?`${e.savedPct}%`:"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-right font-mono text-xs",children:null!=e.durationMs?`${e.durationMs}ms`:"—"}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)("span",{className:`text-xs px-2 py-0.5 ${e.applied?"bg-success/15 text-success":"transform_error"===e.reason||"timeout"===e.reason?"bg-danger/15 text-danger":"bg-warning/15 text-warning"}`,title:e.detail||"",children:e.applied?"Compressed":u[e.reason]||e.reason})})]},`${e.ts}-${t}`)),(!b?.recent||0===b.recent.length)&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:8,className:"py-6 text-center text-text-muted text-sm",children:"No PXPIPE activity yet"})})]})]})})]}),(0,a.jsxs)(m.Zp,{className:"p-4",id:"logs",children:[(0,a.jsx)("h3",{className:"font-medium mb-3",children:"PXPIPE Logs"}),N?.installLog?(0,a.jsx)("pre",{className:" bg-black/5 dark:bg-white/5 p-3 text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:N.installLog}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No install log yet."})]})]})}}},e=>{e.O(0,[8500,8591,1321,7451,5497,8441,3794,7358],()=>e(e.s=18796)),_N_E=e.O()}]);