9router 0.5.35 → 0.5.40

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 (618) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +4 -4
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/react-loadable-manifest.json +2 -2
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +3 -3
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +5 -5
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  89. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  92. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  95. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +16 -11
  103. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  107. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +15 -10
  118. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  301. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  303. package/app/.next-cli-build/server/app/callback.html +1 -1
  304. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  305. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  306. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  308. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  313. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  314. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  317. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  318. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  320. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  321. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  323. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  324. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  325. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  328. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  330. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  331. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  333. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  334. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  337. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  338. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  340. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  343. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  344. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  347. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  348. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  350. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  353. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  358. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  359. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  361. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  362. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  364. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  365. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  368. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  369. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  371. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  372. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  374. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  375. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  379. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  381. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  382. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  383. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  384. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  385. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  389. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  390. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  392. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  394. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  395. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  396. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  399. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  400. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  402. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  403. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  405. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  409. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  410. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  412. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  413. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +7 -7
  415. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  419. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
  420. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +5 -5
  422. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  424. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  425. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  426. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  430. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  432. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  433. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  438. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  439. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  441. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  448. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  452. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  453. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  455. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  458. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  462. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  463. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  465. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  468. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  472. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  473. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  475. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  478. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  482. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  483. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  485. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  486. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  487. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  488. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  491. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  492. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  494. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  496. package/app/.next-cli-build/server/app/index.html +1 -1
  497. package/app/.next-cli-build/server/app/index.rsc +5 -5
  498. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  500. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  502. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  503. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  504. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  505. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  506. package/app/.next-cli-build/server/app/landing.html +1 -1
  507. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  508. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  509. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  511. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  512. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/login/page.js +1 -1
  515. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  516. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  517. package/app/.next-cli-build/server/app/login.html +1 -1
  518. package/app/.next-cli-build/server/app/login.rsc +6 -6
  519. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  520. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  521. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  522. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  523. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  526. package/app/.next-cli-build/server/app/page.js +1 -1
  527. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  528. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  529. package/app/.next-cli-build/server/app-paths-manifest.json +4 -4
  530. package/app/.next-cli-build/server/chunks/1829.js +1 -1
  531. package/app/.next-cli-build/server/chunks/{4329.js → 1882.js} +1 -1
  532. package/app/.next-cli-build/server/chunks/203.js +10 -0
  533. package/app/.next-cli-build/server/chunks/2112.js +1 -1
  534. package/app/.next-cli-build/server/chunks/{3813.js → 2194.js} +1 -1
  535. package/app/.next-cli-build/server/chunks/318.js +10 -17
  536. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  537. package/app/.next-cli-build/server/chunks/3558.js +1 -1
  538. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  539. package/app/.next-cli-build/server/chunks/412.js +3 -3
  540. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  541. package/app/.next-cli-build/server/chunks/507.js +1 -1
  542. package/app/.next-cli-build/server/chunks/5258.js +1 -1
  543. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  544. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  545. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  546. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  547. package/app/.next-cli-build/server/chunks/615.js +1 -1
  548. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  549. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  550. package/app/.next-cli-build/server/chunks/6805.js +8 -8
  551. package/app/.next-cli-build/server/chunks/6832.js +1 -0
  552. package/app/.next-cli-build/server/chunks/7011.js +1 -1
  553. package/app/.next-cli-build/server/chunks/7807.js +3 -0
  554. package/app/.next-cli-build/server/chunks/8038.js +20 -13
  555. package/app/.next-cli-build/server/chunks/827.js +1 -1
  556. package/app/.next-cli-build/server/chunks/869.js +1 -1
  557. package/app/.next-cli-build/server/chunks/8895.js +3 -3
  558. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  559. package/app/.next-cli-build/server/chunks/9660.js +1 -0
  560. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  561. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  562. package/app/.next-cli-build/server/pages/404.html +1 -1
  563. package/app/.next-cli-build/server/pages/500.html +1 -1
  564. package/app/.next-cli-build/static/chunks/{1321-7f70ea1854851a9b.js → 1321-e8265f2c70e59151.js} +1 -1
  565. package/app/.next-cli-build/static/chunks/1a258343.e25ce4decd2c9ea4.js +1 -0
  566. package/app/.next-cli-build/static/chunks/3521.a9e2daf685420cc7.js +1 -0
  567. package/app/.next-cli-build/static/chunks/5116-caa65e79dc026898.js +70 -0
  568. package/app/.next-cli-build/static/chunks/5497-0119413b694f1231.js +7 -0
  569. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-3fea5e5140e9e9e2.js → page-b581f847e6f172c7.js} +1 -1
  570. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-ffde99503dc31523.js +1 -0
  571. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-f99b581b394e9850.js +1 -0
  572. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-217b751496114bf0.js → page-6226ad0df4077bca.js} +11 -11
  573. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-108328d1577f1b0f.js → page-87777e15e4d22276.js} +3 -3
  574. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-fcb6795c5cefd72c.js +12 -0
  575. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-3892b9a4c7cbf0f7.js +1 -0
  576. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-4a4e8b584d49bc4c.js → page-c36e962e75b41c07.js} +1 -1
  577. package/app/.next-cli-build/static/chunks/app/landing/page-a27674e6c5b0a2a5.js +1 -0
  578. package/app/.next-cli-build/static/chunks/webpack-c3c4abfc45a2a611.js +1 -0
  579. package/app/.next-cli-build/static/css/a17f873d769dc530.css +1 -0
  580. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  581. package/app/package.json +1 -1
  582. package/app/public/i18n/literals/km.json +1396 -0
  583. package/app/public/providers/agentrouter.png +0 -0
  584. package/app/public/providers/codebuddy-cn.png +0 -0
  585. package/app/public/providers/commandcode.png +0 -0
  586. package/app/public/providers/featherless.png +0 -0
  587. package/app/public/providers/gitlab.png +0 -0
  588. package/app/public/providers/longcat.png +0 -0
  589. package/app/public/providers/mmf.png +0 -0
  590. package/app/public/providers/morph.png +0 -0
  591. package/app/public/providers/novita.png +0 -0
  592. package/app/public/providers/perplexity-agent.png +0 -0
  593. package/app/public/providers/qoder.png +0 -0
  594. package/app/public/providers/reka.png +0 -0
  595. package/app/public/providers/venice.png +0 -0
  596. package/app/public/providers/vercel-ai-gateway.png +0 -0
  597. package/app/public/providers/vercel.png +0 -0
  598. package/app/src/lib/db/adapters/betterSqliteAdapter.js +3 -3
  599. package/cli.js +2 -2
  600. package/package.json +1 -1
  601. package/src/cli/menus/providers.js +1 -1
  602. package/app/.next-cli-build/server/chunks/112.js +0 -3
  603. package/app/.next-cli-build/server/chunks/2056.js +0 -1
  604. package/app/.next-cli-build/server/chunks/5491.js +0 -1
  605. package/app/.next-cli-build/server/chunks/8335.js +0 -10
  606. package/app/.next-cli-build/static/chunks/1a258343.5938f676ed376386.js +0 -1
  607. package/app/.next-cli-build/static/chunks/3521.8dce45f121472d5c.js +0 -1
  608. package/app/.next-cli-build/static/chunks/5116-abbb531d1c70d939.js +0 -63
  609. package/app/.next-cli-build/static/chunks/5497-25476bc01a0ff241.js +0 -7
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-500933e92ec9d704.js +0 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-00ee45b3da219332.js +0 -1
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b2d9fdc7aa9d2bfd.js +0 -12
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-a2ed056ba7f0b270.js +0 -1
  614. package/app/.next-cli-build/static/chunks/app/landing/page-38fb1c1cf15b58e6.js +0 -1
  615. package/app/.next-cli-build/static/chunks/webpack-9f85387c1012d8a6.js +0 -1
  616. package/app/.next-cli-build/static/css/da4a0bfccb4cb38e.css +0 -1
  617. /package/app/.next-cli-build/static/{sQN_jz73W79rVHaflXPWr → 5p1y6Lsi8TIMY64_Iqb9v}/_buildManifest.js +0 -0
  618. /package/app/.next-cli-build/static/{sQN_jz73W79rVHaflXPWr → 5p1y6Lsi8TIMY64_Iqb9v}/_ssgManifest.js +0 -0
@@ -1,13 +1,13 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},7934:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},46293:a=>{"use strict";a.exports=require("sql.js")},48102:(a,b,c)=>{Promise.resolve().then(c.bind(c,54577))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54577:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>N});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(50412),k=c(92592),l=c(91431),m=c(59160),n=c(18982);let o=["none","low","medium","high"],p=["none","thinking"],q=["none","low","medium","high","max"],r={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":q,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":o,zai:p,qwen:o,kimi:q,deepseek:["none","high","max"],minimax:p,hunyuan:o,step:o},s=[{pattern:"*gpt-5.6-sol*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function t(a,b){let c=(0,m.nl)(a,b);if(!c.reasoning)return null;let d=s.find(a=>(0,n.gH)(a.pattern,b)),e=d?.levels||r[c.thinkingFormat]||o;return!1===c.thinkingCanDisable&&(e=e.filter(a=>"none"!==a)),e}var u=c(50377),v=c(29476),w=c(99258);function x({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var y=c(49885),z=c.n(y);function A({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:k,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:r?{color:r}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:q}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(j.nh,{caps:o,colorOverride:"text-text-muted/70",size:12})]})]}),l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(q,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:k,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function B({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function C({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:k,onDeleteCustomModel:l,connections:m,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,y]=(0,e.useState)({}),z=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();y(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{y(a=>({...a,[b]:"error"}))}finally{v(null)}}},A=x({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),D=async()=>{if(!o.trim()||q)return;let a=o.trim();if(A.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await k(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},E=async()=>{if(s)return;let a=m.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(A.some(a=>a.id===b)||(await k(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},F=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&D(),placeholder:n?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:D,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"download",onClick:E,disabled:!F||s,children:s?"Importing...":"Import from /models"})]}),!F&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),A.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:A.map(({id:c,alias:e,source:f})=>(0,d.jsx)(B,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>z(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}A.propTypes={model:z().shape({id:z().string.isRequired}).isRequired,fullModel:z().string.isRequired,alias:z().string,copied:z().string,onCopy:z().func.isRequired,testStatus:z().oneOf(["ok","error"]),isCustom:z().bool,isFree:z().bool,onDeleteAlias:z().func,onTest:z().func,isTesting:z().bool,onDisable:z().func,caps:z().object,thinkingSuffix:z().string},z().string.isRequired,z().string.isRequired,z().string,z().func.isRequired,z().func.isRequired,z().func,z().oneOf(["ok","error"]),z().bool,z().string.isRequired,z().object.isRequired,z().arrayOf(z().object),z().string,z().func.isRequired,z().func.isRequired,z().func.isRequired,z().func.isRequired,C.propTypes={providerStorageAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,modelAliases:z().object.isRequired,customModels:z().arrayOf(z().object),copied:z().string,onCopy:z().func.isRequired,onDeleteAlias:z().func.isRequired,onAddCustomModel:z().func.isRequired,onDeleteCustomModel:z().func.isRequired,connections:z().arrayOf(z().shape({id:z().string,isActive:z().bool})).isRequired,isAnthropic:z().bool};var D=c(74875);function E({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function F({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:k,onUpdateProxy:l,onEdit:m,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=new Map((b||[]).map(a=>[a.id,a])),w=a.providerSpecificData?.proxyPoolId||null,x=w?v.get(w):null,y=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,z=!!w||y,A=x?`Pool: ${x.name}`:w?`Pool: ${w} (inactive/missing)`:y?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",B=p?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",C="";if(x?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=x?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);C=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{C=b}}let G=x?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";x?.isActive===!0?H="success":(w||y)&&(H="error");let I=async a=>{t(!0);try{await l("__none__"===a?null:a)}finally{t(!1),r(!1)}},J=a.authType||(c?"oauth":"apikey"),K="oauth"===J,L="cookie"===J,M=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(K?"OAuth Account":L?"Cookie Account":"API Key"),N=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[O,P]=(0,e.useState)(!1),Q=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,R="unavailable"!==a.testStatus||O?a.testStatus:"active",S=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:L?"cookie":K?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:M}),N&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:N}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(j.Ex,{variant:(0,D.g)(a.isActive,R),size:"sm",dot:!0,children:!1===a.isActive?"disabled":R||"Unknown"}),(0,d.jsx)(j.Ex,{variant:"default",size:"sm",children:K?"OAuth":L?"Cookie":"API Key"}),z&&(0,d.jsx)(j.Ex,{variant:H,size:"sm",children:"Proxy"}),O&&!1!==a.isActive&&(0,d.jsx)(E,{until:Q}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),S()&&(0,d.jsx)(j.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:S()})]}),z&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:A,children:A}),C&&(0,d.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:C}),G&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:G,children:["no_proxy: ",G]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{className:"relative",ref:u,children:[(0,d.jsxs)("button",{onClick:()=>r(a=>!a),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${z?"text-primary":"text-text-muted hover:text-primary"}`,disabled:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,d.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>I(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsx)(j.m_,{text:B,children:(0,d.jsxs)("button",{onClick:()=>p.onToggle(!p.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:k,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}E.propTypes={until:z().string.isRequired},F.propTypes={connection:z().shape({id:z().string,name:z().string,email:z().string,displayName:z().string,modelLockUntil:z().string,testStatus:z().string,isActive:z().bool,lastError:z().string,priority:z().number,globalPriority:z().number}).isRequired,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string,proxyUrl:z().string,noProxy:z().string,isActive:z().bool})),isOAuth:z().bool.isRequired,isFirst:z().bool.isRequired,isLast:z().bool.isRequired,onMoveUp:z().func.isRequired,onMoveDown:z().func.isRequired,onToggleActive:z().func.isRequired,onUpdateProxy:z().func,onEdit:z().func.isRequired,onDelete:z().func.isRequired,oneByOneStatus:z().shape({state:z().string,error:z().string}),autoPing:z().shape({on:z().bool,onToggle:z().func,provider:z().string})};let G=`name1|sk-key1
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},7934:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},46293:a=>{"use strict";a.exports=require("sql.js")},48102:(a,b,c)=>{Promise.resolve().then(c.bind(c,54577))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54577:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>O});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(29225),k=c(50412),l=c(92592),m=c(91431),n=c(59160),o=c(18982);let p=["none","low","medium","high"],q=["none","thinking"],r=["none","low","medium","high","max"],s={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":r,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":p,zai:q,qwen:p,kimi:r,deepseek:["none","high","max"],minimax:q,hunyuan:p,step:p},t=[{pattern:"*gpt-5.6-sol*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function u(a,b){let c=(0,n.nl)(a,b);if(!c.reasoning)return null;let d=t.find(a=>(0,o.gH)(a.pattern,b)),e=d?.levels||s[c.thinkingFormat]||p;return!1===c.thinkingCanDisable&&(e=e.filter(a=>"none"!==a)),e}var v=c(50377),w=c(29476),x=c(99258);function y({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var z=c(49885),A=c.n(z);function B({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:r?{color:r}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:q}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(k.nh,{caps:o,colorOverride:"text-text-muted/70",size:12})]})]}),l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(q,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function C({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function D({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:l,connections:m,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)({}),z=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();x(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{x(a=>({...a,[b]:"error"}))}finally{v(null)}}},A=y({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),B=async()=>{if(!o.trim()||q)return;let a=o.trim();if(A.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await j(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},E=async()=>{if(s)return;let a=m.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(A.some(a=>a.id===b)||(await j(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},F=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&B(),placeholder:n?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:B,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"download",onClick:E,disabled:!F||s,children:s?"Importing...":"Import from /models"})]}),!F&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),A.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:A.map(({id:c,alias:e,source:f})=>(0,d.jsx)(C,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>z(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}B.propTypes={model:A().shape({id:A().string.isRequired}).isRequired,fullModel:A().string.isRequired,alias:A().string,copied:A().string,onCopy:A().func.isRequired,testStatus:A().oneOf(["ok","error"]),isCustom:A().bool,isFree:A().bool,onDeleteAlias:A().func,onTest:A().func,isTesting:A().bool,onDisable:A().func,caps:A().object,thinkingSuffix:A().string},A().string.isRequired,A().string.isRequired,A().string,A().func.isRequired,A().func.isRequired,A().func,A().oneOf(["ok","error"]),A().bool,A().string.isRequired,A().object.isRequired,A().arrayOf(A().object),A().string,A().func.isRequired,A().func.isRequired,A().func.isRequired,A().func.isRequired,D.propTypes={providerStorageAlias:A().string.isRequired,providerDisplayAlias:A().string.isRequired,modelAliases:A().object.isRequired,customModels:A().arrayOf(A().object),copied:A().string,onCopy:A().func.isRequired,onDeleteAlias:A().func.isRequired,onAddCustomModel:A().func.isRequired,onDeleteCustomModel:A().func.isRequired,connections:A().arrayOf(A().shape({id:A().string,isActive:A().bool})).isRequired,isAnthropic:A().bool};var E=c(74875);function F({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function G({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:j,onUpdateProxy:l,onEdit:m,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=new Map((b||[]).map(a=>[a.id,a])),w=a.providerSpecificData?.proxyPoolId||null,x=w?v.get(w):null,y=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,z=!!w||y,A=x?`Pool: ${x.name}`:w?`Pool: ${w} (inactive/missing)`:y?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",B=p?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",C="";if(x?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=x?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);C=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{C=b}}let D=x?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";x?.isActive===!0?H="success":(w||y)&&(H="error");let I=async a=>{t(!0);try{await l("__none__"===a?null:a)}finally{t(!1),r(!1)}},J=a.authType||(c?"oauth":"apikey"),K="oauth"===J,L="cookie"===J,M=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(K?"OAuth Account":L?"Cookie Account":"API Key"),N=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[O,P]=(0,e.useState)(!1),Q=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,R="unavailable"!==a.testStatus||O?a.testStatus:"active",S=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:L?"cookie":K?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:M}),N&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:N}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(k.Ex,{variant:(0,E.g)(a.isActive,R),size:"sm",dot:!0,children:!1===a.isActive?"disabled":R||"Unknown"}),(0,d.jsx)(k.Ex,{variant:"default",size:"sm",children:K?"OAuth":L?"Cookie":"API Key"}),z&&(0,d.jsx)(k.Ex,{variant:H,size:"sm",children:"Proxy"}),O&&!1!==a.isActive&&(0,d.jsx)(F,{until:Q}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),S()&&(0,d.jsx)(k.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:S()})]}),z&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:A,children:A}),C&&(0,d.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:C}),D&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:D,children:["no_proxy: ",D]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{className:"relative",ref:u,children:[(0,d.jsxs)("button",{onClick:()=>r(a=>!a),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${z?"text-primary":"text-text-muted hover:text-primary"}`,disabled:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,d.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>I(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsx)(k.m_,{text:B,children:(0,d.jsxs)("button",{onClick:()=>p.onToggle(!p.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(k.lM,{size:"sm",checked:a.isActive??!0,onChange:j,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}F.propTypes={until:A().string.isRequired},G.propTypes={connection:A().shape({id:A().string,name:A().string,email:A().string,displayName:A().string,modelLockUntil:A().string,testStatus:A().string,isActive:A().bool,lastError:A().string,priority:A().number,globalPriority:A().number}).isRequired,proxyPools:A().arrayOf(A().shape({id:A().string,name:A().string,proxyUrl:A().string,noProxy:A().string,isActive:A().bool})),isOAuth:A().bool.isRequired,isFirst:A().bool.isRequired,isLast:A().bool.isRequired,onMoveUp:A().func.isRequired,onMoveDown:A().func.isRequired,onToggleActive:A().func.isRequired,onUpdateProxy:A().func,onEdit:A().func.isRequired,onDelete:A().func.isRequired,oneByOneStatus:A().shape({state:A().string,error:A().string}),autoPing:A().shape({on:A().bool,onToggle:A().func,provider:A().string})};let H=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function H({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:l,proxyPools:m,error:n,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=k.Q2?.[b]?.regions||null,A=k.Q2?.[b]?.defaultRegion||z?.[0]?.id||"",[B,C]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[D,E]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[F,I]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)(A),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),R=y?`name1|sk-key1|acc123456
3
+ sk-key-only-auto-named`;function I({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:j,proxyPools:m,error:n,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=l.Q2?.[b]?.regions||null,A=l.Q2?.[b]?.defaultRegion||z?.[0]?.id||"",[B,C]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[D,E]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[F,G]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)(A),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),R=y?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
5
- sk-key-only-auto-named`:G,[S,T]=(0,e.useState)("single"),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(null),Y=()=>t&&B.ollamaHostUrl.trim()?{baseUrl:B.ollamaHostUrl.trim()}:x?{azureEndpoint:D.azureEndpoint,apiVersion:D.apiVersion,deployment:D.deployment,organization:D.organization}:y?{accountId:F.accountId}:z&&J?{region:J}:void 0,Z=async()=>{M(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:B.apiKey,providerSpecificData:Y()})}),c=await a.json();O(c.valid?"success":"failed")}catch{O("failed")}finally{M(!1)}},$=async()=>{if(b&&(t||B.apiKey)&&(t||B.name)&&(!f||B.defaultModel.trim())){Q(!0);try{let a=!1;try{M(!0),O(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:B.apiKey,providerSpecificData:Y()})});a=!!(await c.json()).valid,O(a?"success":"failed")}catch{O("failed")}finally{M(!1)}await p({name:B.name||(t?"Ollama Local":""),apiKey:B.apiKey,defaultModel:f?B.defaultModel.trim():void 0,priority:B.priority,proxyPoolId:B.proxyPoolId===s?null:B.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Y()})}finally{Q(!1)}}},_=async()=>{let a=U.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b,d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;Q(!0),X(null);let d=0,e=0;for(let a of c)try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}Q(!1),X({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"single"===S?"primary":"ghost",onClick:()=>{T("single"),X(null)},children:"Single"}),(0,d.jsx)(j.$n,{size:"sm",variant:"bulk"===S?"primary":"ghost",onClick:()=>{T("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===S&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:R,value:U,onChange:a=>V(a.target.value)}),W&&(0,d.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:_,fullWidth:!0,disabled:P||!U.trim(),children:P?"Adding...":"Add All Keys"}),(0,d.jsx)(j.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{label:"Name",value:B.name,onChange:a=>C({...B,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"Ollama Host URL",value:B.ollamaHostUrl,onChange:a=>C({...B,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:L||P,variant:"secondary",children:L?"Checking...":"Check"})})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:w,type:u?"text":"password",value:B.apiKey,onChange:a=>C({...B,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:!B.apiKey||L||P,variant:"secondary",children:L?"Checking...":"Check"})})]}),v&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,l&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",l.replace(/^https?:\/\//,"")]})]})]}),z&&(0,d.jsx)(j.l6,{label:"Region",value:J,onChange:a=>K(a.target.value),options:z.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(j.pd,{label:"Default Model",value:B.defaultModel,onChange:a=>C({...B,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),N&&(0,d.jsx)(j.Ex,{variant:"success"===N?"success":"error",children:"success"===N?"Valid":"Invalid"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(j.pd,{label:"Account ID",value:F.accountId,onChange:a=>I({...F,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"Azure Endpoint",value:D.azureEndpoint,onChange:a=>E({...D,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(j.pd,{label:"Deployment Name",value:D.deployment,onChange:a=>E({...D,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(j.pd,{label:"API Version",value:D.apiVersion,onChange:a=>E({...D,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(j.pd,{label:"Organization",value:D.organization,onChange:a=>E({...D,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(j.pd,{label:"Priority",type:"number",value:B.priority,onChange:a=>C({...B,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(j.l6,{label:"Proxy Pool",value:B.proxyPoolId,onChange:a=>C({...B,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:$,fullWidth:!0,disabled:P||!t&&(!B.name||!B.apiKey)||f&&!B.defaultModel.trim()||x&&(!D.azureEndpoint||!D.deployment||!D.organization)||y&&!F.accountId,children:P?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function I({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(j.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(j.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(j.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(j.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(j.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||k,children:k?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function J({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"science",loading:"testing"===k,onClick:r,disabled:!h.trim()||"testing"===k,children:"testing"===k?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===k&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(j.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(j.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}H.propTypes={isOpen:z().bool.isRequired,provider:z().string,providerName:z().string,isCompatible:z().bool,isAnthropic:z().bool,authType:z().string,authHint:z().string,website:z().string,proxyPools:z().arrayOf(z().shape({id:z().string,name:z().string})),error:z().string,existingNames:z().arrayOf(z().string),onSave:z().func.isRequired,onBulkDone:z().func,onClose:z().func.isRequired},I.propTypes={isOpen:z().bool.isRequired,node:z().shape({id:z().string,name:z().string,prefix:z().string,apiType:z().string,baseUrl:z().string}),onSave:z().func.isRequired,onClose:z().func.isRequired,isAnthropic:z().bool},J.propTypes={isOpen:z().bool.isRequired,providerAlias:z().string.isRequired,providerDisplayAlias:z().string.isRequired,onSave:z().func.isRequired,onClose:z().func.isRequired};let K=`[
5
+ sk-key-only-auto-named`:H,[S,T]=(0,e.useState)("single"),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(null),Y=()=>t&&B.ollamaHostUrl.trim()?{baseUrl:B.ollamaHostUrl.trim()}:x?{azureEndpoint:D.azureEndpoint,apiVersion:D.apiVersion,deployment:D.deployment,organization:D.organization}:y?{accountId:F.accountId}:z&&J?{region:J}:void 0,Z=async()=>{M(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:B.apiKey,providerSpecificData:Y()})}),c=await a.json();O(c.valid?"success":"failed")}catch{O("failed")}finally{M(!1)}},$=async()=>{if(b&&(t||B.apiKey)&&(t||B.name)&&(!f||B.defaultModel.trim())){Q(!0);try{let a=!1;try{M(!0),O(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:B.apiKey,providerSpecificData:Y()})});a=!!(await c.json()).valid,O(a?"success":"failed")}catch{O("failed")}finally{M(!1)}await p({name:B.name||(t?"Ollama Local":""),apiKey:B.apiKey,defaultModel:f?B.defaultModel.trim():void 0,priority:B.priority,proxyPoolId:B.proxyPoolId===s?null:B.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Y()})}finally{Q(!1)}}},_=async()=>{let a=U.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b,d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;Q(!0),X(null);let d=0,e=0;for(let a of c)try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}Q(!1),X({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{size:"sm",variant:"single"===S?"primary":"ghost",onClick:()=>{T("single"),X(null)},children:"Single"}),(0,d.jsx)(k.$n,{size:"sm",variant:"bulk"===S?"primary":"ghost",onClick:()=>{T("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===S&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:R,value:U,onChange:a=>V(a.target.value)}),W&&(0,d.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:_,fullWidth:!0,disabled:P||!U.trim(),children:P?"Adding...":"Add All Keys"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.pd,{label:"Name",value:B.name,onChange:a=>C({...B,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"Ollama Host URL",value:B.ollamaHostUrl,onChange:a=>C({...B,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:Z,disabled:L||P,variant:"secondary",children:L?"Checking...":"Check"})})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:w,type:u?"text":"password",value:B.apiKey,onChange:a=>C({...B,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:Z,disabled:!B.apiKey||L||P,variant:"secondary",children:L?"Checking...":"Check"})})]}),v&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,j&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",j.replace(/^https?:\/\//,"")]})]})]}),z&&(0,d.jsx)(k.l6,{label:"Region",value:J,onChange:a=>K(a.target.value),options:z.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(k.pd,{label:"Default Model",value:B.defaultModel,onChange:a=>C({...B,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),N&&(0,d.jsx)(k.Ex,{variant:"success"===N?"success":"error",children:"success"===N?"Valid":"Invalid"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(k.pd,{label:"Account ID",value:F.accountId,onChange:a=>G({...F,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(k.pd,{label:"Azure Endpoint",value:D.azureEndpoint,onChange:a=>E({...D,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(k.pd,{label:"Deployment Name",value:D.deployment,onChange:a=>E({...D,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(k.pd,{label:"API Version",value:D.apiVersion,onChange:a=>E({...D,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(k.pd,{label:"Organization",value:D.organization,onChange:a=>E({...D,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(k.pd,{label:"Priority",type:"number",value:B.priority,onChange:a=>C({...B,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(k.l6,{label:"Proxy Pool",value:B.proxyPoolId,onChange:a=>C({...B,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:$,fullWidth:!0,disabled:P||!t&&(!B.name||!B.apiKey)||f&&!B.defaultModel.trim()||x&&(!D.azureEndpoint||!D.deployment||!D.organization)||y&&!F.accountId,children:P?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function J({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(k.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(k.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(k.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(k.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(k.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(k.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function K({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[j,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(k.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsx)(k.$n,{variant:"secondary",icon:"science",loading:"testing"===j,onClick:r,disabled:!h.trim()||"testing"===j,children:"testing"===j?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===j&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===j&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(k.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(k.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}I.propTypes={isOpen:A().bool.isRequired,provider:A().string,providerName:A().string,isCompatible:A().bool,isAnthropic:A().bool,authType:A().string,authHint:A().string,website:A().string,proxyPools:A().arrayOf(A().shape({id:A().string,name:A().string})),error:A().string,existingNames:A().arrayOf(A().string),onSave:A().func.isRequired,onBulkDone:A().func,onClose:A().func.isRequired},J.propTypes={isOpen:A().bool.isRequired,node:A().shape({id:A().string,name:A().string,prefix:A().string,apiType:A().string,baseUrl:A().string}),onSave:A().func.isRequired,onClose:A().func.isRequired,isAnthropic:A().bool},K.propTypes={isOpen:A().bool.isRequired,providerAlias:A().string.isRequired,providerDisplayAlias:A().string.isRequired,onSave:A().func.isRequired,onClose:A().func.isRequired};let L=`[
6
6
  {
7
7
  "accessToken": "eyJhbGc...",
8
8
  "refreshToken": "rt_...",
9
9
  "idToken": "eyJhbGc...",
10
10
  "email": "user@example.com"
11
11
  }
12
- ]`;function L({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),o=()=>{h||(g(""),l(""),n(null),b())},p=async()=>{var a;let b;l(""),n(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){l(`${(0,w.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void l((0,w.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void l(b?.error||`Request failed: ${a.status}`);n(b),b.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,w.Tl)("Request failed"))}finally{i(!1)}},q=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(j.aF,{isOpen:a,title:(0,w.Tl)("Bulk Add Codex Accounts"),onClose:o,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,w.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:K,value:f,onChange:a=>g(a.target.value),disabled:h}),k&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:k}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,w.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,w.Tl)("failed")}`:""]}),q.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:q.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:p,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,w.Tl)("Importing..."):(0,w.Tl)("Import All")}),(0,d.jsx)(j.$n,{onClick:o,variant:"ghost",fullWidth:!0,disabled:h,children:(0,w.Tl)("Close")})]})]})})}L.propTypes={isOpen:z().bool.isRequired,onClose:z().func.isRequired,onSuccess:z().func};let M={claude:"claudeAutoPing",codex:"codexAutoPing"};function N(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,{getCaps:m}=(0,v.y)(),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(null),[y,z]=(0,e.useState)([]),[B,D]=(0,e.useState)(!1),[E,G]=(0,e.useState)(!1),[K,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(""),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(null),[$,_]=(0,e.useState)({}),[aa,ab]=(0,e.useState)([]),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)({}),[ag,ah]=(0,e.useState)(""),[ai,aj]=(0,e.useState)(()=>new Set),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)([]),[ao,ap]=(0,e.useState)("__none__"),[aq,ar]=(0,e.useState)(!1),[as,at]=(0,e.useState)(null),[au,av]=(0,e.useState)(""),[aw,ax]=(0,e.useState)("auto"),[ay,az]=(0,e.useState)({enabled:!1,connections:{}}),[aA,aB]=(0,e.useState)([]),[aC,aD]=(0,e.useState)([]),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)(null),[aI,aJ]=(0,e.useState)(!1),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(!1),[aO,aP]=(0,e.useState)(null),[aQ,aR]=(0,e.useState)({}),[aS,aT]=(0,e.useState)(null),aU=(0,e.useRef)(!1),[aV,aW]=(0,e.useState)(!1),{copied:aX,copy:aY}=(0,u.C)(),aZ=()=>{D(!0)},a$=()=>{a3?aZ():(P(""),N(!0))},a_=()=>{P(""),N(!0)},a0=()=>{a3?a$():a_()},a1=r?{id:r.id,name:r.name||("anthropic-compatible"===r.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===r.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===r.type?"AC":"OC",apiType:r.apiType,baseUrl:r.baseUrl,type:r.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],a2=a1?.authModes||[],a3=!!k.zN[g]||!!k.IS[g]||a2.includes("oauth"),a4=!!k.fg[g]||a2.includes("apikey"),a5=!!k.IS[g]?.noAuth,a6=(0,l.KC)(g),a7=(0,k.wG)(g),a8=(0,k.mq)(g),a9=(0,k.gb)(g),ba=a8||a9,bb=!ba&&a3&&a4,bc="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"OAuth",bd="xai"===g?"xAI API Key":"API Key",be=a=>{if(!aw||"auto"===aw)return null;let b=t(g,a);return b&&b.includes(aw)?aw:null},bf=ba?g:a7,bg=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=t(g,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of a6)c(a.id);for(let a of aC)c(a.id);for(let a of aa)a.providerAlias===bf&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),bh=ba?r?.prefix||g:a7,bi=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bf)}`,{cache:"no-store"}),b=await a.json();a.ok&&aF(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bf]),bj=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bf,ids:[a]})})).ok&&await bi()}catch(a){console.log("Error disabling model:",a)}},bk=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bf)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bi()}catch(a){console.log("Error enabling model:",a)}},bl=async a=>{a.length&&aH({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aH(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bf,ids:a})})).ok&&await bi()}catch(a){console.log("Error disabling all models:",a)}}})},bm=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bf)}`,{method:"DELETE"})).ok&&await bi()}catch(a){console.log("Error enabling all models:",a)}},bn=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&_(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bo=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&ab(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),bp=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=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"})]),e=await a.json(),f=await b.json(),h=await c.json(),i=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===g);o(a)}c.ok&&z(h.proxyPools||[]);let j=(i.providerStrategies||{})[g]||{};at(j.fallbackStrategy||null),av(null!=j.stickyRoundRobinLimit?String(j.stickyRoundRobinLimit):"1");let k=(i.providerThinking||{})[g]||{};ax(k.mode||"auto");let l=M[g],m=l&&i[l]||{};if(az({enabled:!0===m.enabled,connections:m.connections||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===g)||null;if(!a&&ba)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===g)||null))break}s(a)}}catch(a){console.log("Error fetching connections:",a)}finally{q(!1)}},[g,ba]),bq=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(s(c.node),await bp(),V(!1))}catch(a){console.log("Error updating provider node:",a)}},br=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bs=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bt=async a=>{let b=M[g];if(b){az(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},bu=async(a,b,c=a7)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await bn();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bv=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bn()}catch(a){console.log("Error deleting alias:",a)}},bw=async(a,b="llm",c=bf)=>{try{let d=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b})});if(d.ok)await bo();else{let a=await d.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},bx=async(a,b="llm",c=bf)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await bo()}catch(a){console.log("Error deleting custom model:",a)}},by=async()=>{if(aV)return;let a=n.find(a=>!1!==a.isActive);if(!a)return void alert((0,w.Tl)("Please add an active Qoder connection first"));aW(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,w.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,w.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,"");aa.some(a=>a.providerAlias===bf&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values($).includes(`${bf}/${c}`)||(await bw(c,"llm",bf),e+=1)}0===e?alert((0,w.Tl)("All models already exist, no new models added")):alert((0,w.Tl)("Successfully added")+` ${e} `+(0,w.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,w.Tl)("Error fetching models")+": "+a.message)}finally{aW(!1)}},bz=async()=>{if(aK||0===n.length)return;let a=Object.fromEntries(n.map(a=>[a.id,{state:"queued",error:null}]));aU.current=!1,aL(!0),aN(!1),aP(null),aR(a),aT({total:n.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<n.length;a+=1){if(aU.current){aT({total:n.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=n[a];aP(d.id),aR(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,aR(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,aR(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}aT({total:n.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<n.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aP(null),aL(!1),aN(!1),aU.current=!1}},bA=async a=>{aH({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aH(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&o(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bB=()=>{bp(),D(!1)},bC=async a=>{P("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bp(),N(!1);return}P(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),P("Failed to save connection")}},bD=async a=>{try{(await fetch(`/api/providers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bp(),T(!1))}catch(a){console.log("Error updating connection:",a)}},bE=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&o(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},bF=async(a,b)=>{let c=[...n];[c[a],c[b]]=[c[b],c[a]],o(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bp()}},bG=n.filter(a=>am.includes(a.id)),bH=n.length>0&&am.length===n.length;(()=>{if(0===bG.length)return;let a=new Set(bG.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=y.find(a=>a.id===b);return c?.name}})();let bI=()=>{aq||X(!1)},bJ=async a=>{ar(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bp(),X(!1)}finally{ar(!1)}},bK=a=>bJ(n.map(b=>({connectionId:b.id,proxyPoolId:a}))),bL=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:n.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,am.includes(c)),onChange:()=>{var b;return b=a.id,void an(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(F,{connection:a,proxyPools:y,isOAuth:a3,isFirst:0===b,isLast:b===n.length-1,onMoveUp:()=>bF(b,b-1),onMoveDown:()=>bF(b,b+1),onToggleActive:b=>bE(a.id,b),autoPing:M[g]&&"oauth"===a.authType?{on:!0===ay.connections[a.id],onToggle:b=>{var c;return c=a.id,void bt({...ay,connections:{...ay.connections,[c]:b}})},provider:g}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&o(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{Z(a),T(!0)},onDelete:()=>bA(a.id),oneByOneStatus:aQ[a.id]||null})})]},a.id)})}),bM=y.filter(a=>!0===a.isActive),bN=(0,d.jsx)(j.aF,{isOpen:W,onClose:bI,title:`Apply Proxy (${n.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=y.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):bJ(n.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aq||0===bM.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>bK(null),disabled:aq,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),y.map(a=>(0,d.jsxs)("button",{onClick:()=>bK(a.id),disabled:aq||!0!==a.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aq&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:bI,variant:"ghost",fullWidth:!0,disabled:aq,children:"Cancel"})]})}),bO=async a=>{if(!ai.has(a)){aj(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bf}/${a}`})}),c=await b.json();af(b=>({...b,[a]:c.ok?"ok":"error"})),ah(c.ok?"":c.error||"Model not reachable")}catch{af(b=>({...b,[a]:"error"})),ah("Network error")}finally{aj(b=>{let c=new Set(b);return c.delete(a),c})}}};return p?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):a1?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${a1.color}15`},children:ac?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:a1.color},children:a1.textIcon||a1.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:a8&&a1.apiType?"responses"===a1.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":a9?"/providers/anthropic-m.png":`/providers/${a1.id}.png`,alt:a1.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ad(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a1.name}),(a1.notice?.apiKeyUrl||a1.notice?.signupUrl||a1.website)&&(0,d.jsxs)("a",{href:a1.notice?.apiKeyUrl||a1.notice?.signupUrl||a1.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),a1.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[n.length," connection",1===n.length?"":"s"]})]})]})]}),a1.deprecated&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:a1.deprecationNotice})]}),a1.notice?.text&&!a1.deprecated&&(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:a1.notice.text}),a1.notice.apiKeyUrl&&(0,d.jsx)("a",{href:a1.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),ba&&r&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:a9?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[a9?"Messages API":"responses"===r.apiType?"Responses API":"Chat Completions"," \xb7 ",(r.baseUrl||"").replace(/\/$/,""),"/",a9?"messages":"responses"===r.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{P(""),N(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aH({title:"Delete Compatible Node",message:`Delete this ${a9?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aH(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),a5?(0,d.jsx)(j.gw,{providerId:g}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[n.length>0&&y.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>X(!0),children:"Apply Proxy"}),n.length>0&&(0,d.jsxs)(d.Fragment,{children:[am.length>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=am.length;0!==a&&aH({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{aH(null);let a=0,b=[...am];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}o(a=>a.filter(a=>!b.includes(a.id))),an([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",am.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bz,disabled:aK,children:aK?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aK&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aK&&(aU.current=!0,aN(!0))},disabled:aM,children:aM?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(j.lM,{checked:"round-robin"===as,onChange:a=>{let b=a?"round-robin":null,c=a?au||"1":au;a&&!au&&av("1"),at(b),br(b,c)}}),"round-robin"===as&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:au,onChange:a=>{var b;av(b=a.target.value),br("round-robin",b)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===n.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a3?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bb&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bc," or ",bd,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bb?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a$,children:bc}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:a_,children:bd})]}):(0,d.jsxs)(d.Fragment,{children:[!ba&&"iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),children:"Cookie"}),"codex"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>R(!0),children:(0,w.Tl)("Bulk Add")}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a0,children:ba?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[aS&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",aS.total]}),(0,d.jsxs)("span",{children:["Completed: ",aS.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aS.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aS.failed]}),aS.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aK&&aO&&(0,d.jsxs)("span",{children:["Running: ",n.find(a=>a.id===aO)?.name||aO]})]})}),n.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:bH,onChange:()=>{bH?an([]):an(n.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),bL,!ba&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>R(!0),title:(0,w.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,w.Tl)("Bulk Add")}),bb?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a$,className:"w-full sm:w-auto",children:bc}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:a_,className:"w-full sm:w-auto",children:bd})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a0,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bg&&(0,d.jsx)("select",{value:aw,onChange:a=>{var b;ax(b=a.target.value),bs(b)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:bg.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),!ba&&(a=[...a6,...aC.filter(a=>!a6.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!aE.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aE.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bm,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bl(a),children:"Disable All"})]}))]}),!!ag&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ag}),(()=>{let a,b,c;if(ba)return(0,d.jsx)(C,{providerStorageAlias:bf,providerDisplayAlias:bh,modelAliases:$,customModels:aa,copied:aX,onCopy:aY,onSetAlias:bu,onDeleteAlias:bv,onAddCustomModel:a=>bw(a,"llm",bf),onDeleteCustomModel:a=>bx(a,"llm",bf),connections:n,isAnthropic:a9});let e=[...a6,...aC.filter(a=>!a6.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}),f=new Set(aE),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),j=x({customModels:aa,modelAliases:$,providerAlias:bf,builtInModels:a6,type:"llm"});return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[j.map(a=>(0,d.jsx)(A,{model:{id:a.id,name:a.name},fullModel:`${bh}/${a.id}`,alias:a.alias,copied:aX,onCopy:aY,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?bx(a.id,"llm",bf):bv(a.alias)},testStatus:ae[a.id],onTest:n.length>0||a5?()=>bO(a.id):void 0,isTesting:ai.has(a.id),isCustom:!0,isFree:!1,caps:m(`${g}/${a.id}`),thinkingSuffix:be(a.id)},`${a.source}-${a.fullModel}`)),h.map(a=>{let b=`${bf}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries($).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(A,{model:a,fullModel:`${bh}/${a.id}`,alias:e,copied:aX,onCopy:aY,onSetAlias:b=>bu(a.id,b,bf),onDeleteAlias:()=>bv(e),testStatus:ae[a.id],onTest:n.length>0||a5?()=>bO(a.id):void 0,isTesting:ai.has(a.id),isFree:a.isFree,onDisable:()=>bj(a.id),caps:m(`${g}/${a.id}`),thinkingSuffix:be(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>al(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&n.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:by,disabled:aV,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:aV?{animation:"spin 1s linear infinite"}:void 0,children:aV?"progress_activity":"download"}),aV?(0,w.Tl)("Fetching..."):(0,w.Tl)("Fetch Qoder Models")]}),aA.length>0&&(a=new Set([...Object.values($),...j.map(a=>a.fullModel)]),b=new Set(a6.map(a=>a.id)),0===(c=aA.filter(c=>!a.has(`${bf}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await bw(a.id,"llm",bf)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>bk(a.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),bN,"kiro"===g?(0,d.jsx)(j.Mh,{isOpen:B,providerInfo:a1,onSuccess:bB,onClose:()=>D(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:B,onSuccess:bB,onClose:()=>D(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:B,providerInfo:a1,onSuccess:bB,onClose:()=>D(!1)}):(0,d.jsx)(j.LF,{isOpen:B,provider:g,providerInfo:a1,onSuccess:bB,onClose:()=>D(!1)}),"iflow"===g&&(0,d.jsx)(j.vE,{isOpen:E,onSuccess:()=>{bp(),G(!1)},onClose:()=>G(!1)}),(0,d.jsx)(H,{isOpen:K,provider:g,providerName:a1.name,isCompatible:ba,isAnthropic:a9,authType:a1?.authType,authHint:a1?.authHint,website:a1?.website,proxyPools:y,error:O,existingNames:n.map(a=>a.name).filter(Boolean),onSave:bC,onBulkDone:bp,onClose:()=>{P(""),N(!1)}}),(0,d.jsx)(j.wI,{isOpen:S,connection:Y,proxyPools:y,onSave:bD,onClose:()=>T(!1)}),ba&&(0,d.jsx)(I,{isOpen:U,node:r,onSave:bq,onClose:()=>V(!1),isAnthropic:a9}),!ba&&(0,d.jsx)(J,{isOpen:ak,providerAlias:bf,providerDisplayAlias:bh,onSave:async a=>{await bw(a,"llm",bf),al(!1)},onClose:()=>al(!1)}),"codex"===g&&(0,d.jsx)(L,{isOpen:Q,onClose:()=>R(!1),onSuccess:bp}),(0,d.jsx)(j.uo,{isOpen:aI,onClose:()=>aJ(!1),onConfirm:()=>{(aJ(!1),a3)?aZ():a_()},title:"Risk Notice",message:a1?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aG,onClose:()=>aH(null),onConfirm:aG?.onConfirm,title:aG?.title||"Confirm",message:aG?.message,variant:"danger"})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60976:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>M,handler:()=>O,routeModule:()=>N});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(63747),o=c(24235),p=c(23938),q=c(261),r=c(66758),s=c(77243),t=c(26713),u=c(37527),v=c(22820),w=c(88216),x=c(47929),y=c(79551),z=c(71797),A=c(89125),B=c(86439),C=c(77068),D=c(27269),E=c(61287),F=c(81494),G=c(70722),H=c(70753),I=c(43954),J=c(17891),K={};for(let a in E)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(K[a]=()=>E[a]);c.d(b,K);let L={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,93110)),"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/Users/Working/router4/9router/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,57529)),"/Users/Working/router4/9router/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,M={require:c,loadChunk:()=>Promise.resolve()},N=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:L},distDir:".next-cli-build",relativeProjectDir:""});async function O(a,b,d){var K,P,Q,R,S;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),N.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let T=!!(0,h.getRequestMeta)(a,"minimalMode"),U="/(dashboard)/dashboard/providers/[id]/page";"/index"===U&&(U="/");let V=await N.prepare(a,b,{srcPage:U,multiZoneDraftMode:!1});if(!V)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:W,query:X,params:Y,pageIsDynamic:Z,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,serverActionsManifest:ab,clientReferenceManifest:ac,subresourceIntegrityManifest:ad,prerenderManifest:ae,isDraftMode:af,resolvedPathname:ag,revalidateOnlyGenerated:ah,routerServerContext:ai,nextConfig:aj,parsedUrl:ak,interceptionRoutePatterns:al,deploymentId:am,clientAssetToken:an}=V,ao=(0,q.normalizeAppPath)(U),{isOnDemandRevalidate:ap}=V,aq=aj.experimental.ppr&&!aj.cacheComponents&&(0,I.isInterceptionRouteAppPath)(ag)?null:N.match(ag,ae),ar=(null==aq?void 0:aq.route)??null,as=!!ae.routes[ag],at=a.headers["user-agent"]||"",au=(0,t.getBotType)(at),av=(0,p.isHtmlBotRequest)(a),aw=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ax=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],ay=(0,r.getIsPossibleServerAction)(a),az=(0,m.checkIsAppPPREnabled)(aj.experimental.ppr),aA=a.headers[x.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&T&&az&&ay&&aA&&"string"==typeof aA){let e=parseInt(aA,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(S=aj.experimental.serverActions)?void 0:S.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,D.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&az&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize),f=await (0,D.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aB=!0===N.isDev||!0===aj.experimental.exposeTestingApiInProductionBuild,aC=aB&&("1"===a.headers[s.NEXT_INSTANT_PREFETCH_HEADER]||void 0===a.headers[s.RSC_HEADER]&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(s.NEXT_INSTANT_TEST_COOKIE+"=")),aD=(az||aC)&&((null==(K=ae.routes[ao]??ae.dynamicRoutes[ao])?void 0:K.renderingMode)==="PARTIALLY_STATIC"||aC&&(aB||(null==ai?void 0:ai.experimentalTestProxy)===!0)),aE=aC&&aD,aF=aE&&!0===N.isDev,aG=!1,aH=aD?(0,h.getRequestMeta)(a,"postponed"):void 0,aI=null==(P=ae.routes[ag])?void 0:P.prefetchDataRoute,aJ=aD&&ax&&!aw&&!aI;T&&(aJ=aJ&&!!aH);let aK=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aL=(!au||!aD)&&(!at||(0,p.shouldServeStreamingMetadata)(at,aj.htmlLimitedBots)),aM=!!((ar||as||ae.routes[ao])&&!(au&&aD)),aN=aD&&!0===aj.cacheComponents,aO=!0===N.isDev||!aM||"string"==typeof aH||(aN&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aJ&&!T:aJ),aP=!!au&&aD,aQ=(null==ar?void 0:ar.remainingPrerenderableParams)??[],aR=(null==ar?void 0:ar.fallback)===null&&((null==(Q=ar.fallbackRootParams)?void 0:Q.length)??0)>0,aS=null;if(!af&&aM&&!aO&&!ay&&!aH&&!aJ){let a=aq?"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:aq.source:null;if(!0===aj.experimental.partialFallbacks&&a&&(null==ar?void 0:ar.fallbackRouteParams)&&!aR){if(aQ.length>0){let b,c=(b=new Map(aQ.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,J.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==Y?void 0:Y[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace(function(a){let{repeat:b,optional:c}=(0,J.getParamProperties)(a.paramType);return c?`[[...${a.paramName}]]`:b?`[...${a.paramName}]`:`[${a.paramName}]`}(d),f)}).join("/")||"/");aS=c!==a?c:null}}else aS=ag}let aT=aS;!aT&&(N.isDev||aM&&Z&&(null==ar?void 0:ar.fallbackRouteParams)&&!ay)&&(aT=ag),N.isDev||af||!aM||!ax||aJ||(0,k.d)(a.headers);let aU={...E,tree:L,handler:O,routeModule:N,__next_app__:M};ab&&ac&&(0,o.setManifestsSingleton)({page:U,clientReferenceManifest:ac,serverActionsManifest:ab});let aV=a.method||"GET",aW=(0,g.getTracer)(),aX=aW.getActiveScopeSpan(),aY=!!(null==ai?void 0:ai.isWrappedByNextServer),aZ=!0===aj.experimental.partialFallbacks&&aQ.length>0?(null==ar||null==(R=ar.fallbackRouteParams)?void 0:R.filter(a=>!aQ.some(b=>b.paramName===a.paramName)))??[]:[],a$=async()=>((null==ai?void 0:ai.render404)?await ai.render404(a,b,ak,!1):b.end("This page could not be found"),null);try{let f,k=N.getVaryHeader(ag,al);b.setHeader("Vary",k);let m=async(c,d)=>{let e=new l.NodeNextRequest(a),g=new l.NodeNextResponse(b);return N.render(e,g,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aW.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aV} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),f&&f!==c&&(f.setAttribute("http.route",d),f.updateName(a))}else c.updateName(`${aV} ${U}`)})},o=(0,h.getRequestMeta)(a,"incrementalCache")||await N.getIncrementalCache(a,aj,ae,T);null==o||o.resetRequestCache(),globalThis.__incrementalCache=o;let p=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:X,params:Y,page:ao,sharedContext:{buildId:W,deploymentId:am,clientAssetToken:an},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aU,Component:(0,j.T)(aU),params:Y,routeModule:N,page:U,postponed:f,shouldWaitOnAllReady:aP,serveStreamingMetadata:aL,supportsDynamicResponse:"string"==typeof f||aO,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,subresourceIntegrityManifest:ad,setCacheStatus:null==ai?void 0:ai.setCacheStatus,setIsrStatus:null==ai?void 0:ai.setIsrStatus,setReactDebugChannel:null==ai?void 0:ai.setReactDebugChannel,sendErrorsToBrowser:null==ai?void 0:ai.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),N.relativeProjectDir),isDraftMode:af,botType:au,isOnDemandRevalidate:ap,isPossibleServerAction:ay,assetPrefix:aj.assetPrefix,nextConfigOutput:aj.output,crossOrigin:aj.crossOrigin,trailingSlash:aj.trailingSlash,images:aj.images,previewProps:ae.preview,enableTainting:aj.experimental.taint,htmlLimitedBots:aj.htmlLimitedBots,reactMaxHeadersLength:aj.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:o,cacheLifeProfiles:aj.cacheLife,basePath:aj.basePath,serverActions:aj.experimental.serverActions,logServerFunctions:"object"==typeof aj.logging&&!!aj.logging.serverFunctions,...aE||aF||aG?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aF}:{},cacheComponents:!!aj.cacheComponents,experimental:{isRoutePPREnabled:aD,expireTime:aj.expireTime,staleTimes:aj.experimental.staleTimes,dynamicOnHover:!!aj.experimental.dynamicOnHover,optimisticRouting:!!aj.experimental.optimisticRouting,inlineCss:!!aj.experimental.inlineCss,prefetchInlining:aj.experimental.prefetchInlining??!1,authInterrupts:!!aj.experimental.authInterrupts,cachedNavigations:!!aj.experimental.cachedNavigations,clientTraceMetadata:aj.experimental.clientTraceMetadata||[],clientParamParsingOrigins:aj.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,C.parseMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>N.onRequestError(a,b,d,e,ai),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await m(e,k),{metadata:n}=l,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=n;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aM&&(null==p?void 0:p.revalidate)===0&&!N.isDev&&!aD){let a=n.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ag}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
13
- see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:n.flightData,postponed:n.postponed,status:n.statusCode,segmentData:n.segmentData},cacheControl:p}},q=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===N.isDev,m=c||b.writableEnded;if(ap&&ah&&!f&&!T)return(null==ai?void 0:ai.render404)?await ai.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ar&&(k=(0,v.parseFallbackField)(ar.fallback)),!0===aj.experimental.partialFallbacks&&(null==ar?void 0:ar.fallback)===null&&!aR&&aQ.length>0&&(k=v.FallbackMode.PRERENDER),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(at)&&(!aD||av)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ap=!0),ap&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!T&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aT&&!m&&!af&&Z&&(l||!as)){if((l||ar)&&k===v.FallbackMode.NOT_FOUND){if(aj.adapterPath)return await a$();throw new B.NoFallbackError}if(aD&&(aj.cacheComponents?!aJ:!ax)){let b=l&&"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:ao,f=(l||aE)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;aE&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await N.handleResponse({cacheKey:b,req:a,nextConfig:aj,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ae,isRoutePPREnabled:aD,responseGenerator:async()=>p({span:i,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:T});if(null===g)return null;if(g)return T||!aD||!(aQ.length>0)||!0!==aj.experimental.partialFallbacks||!aS||!o||ap||aG||aB||aC||aw||(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(aS,o,aD,!1,a=>p({span:a.span,postponed:void 0,fallbackRouteParams:aZ.length>0?(0,n.createOpaqueFallbackRouteParams)(aZ):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let r=ap||g||!aH?void 0:aH;if(aN&&!T&&o&&(aJ||ay)&&!j){let b=await o.get(ag,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(ag,o,aD,!1,a=>q({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aE||aF)&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||aE&&!as)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;if((l||aE)&&aj.cacheComponents&&!as&&(null==ar?void 0:ar.fallbackRouteParams)){let b=(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return p({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},r=async c=>{var f,g,i,j,k;let l,m=await N.handleResponse({cacheKey:aS,responseGenerator:a=>q({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ap,isRoutePPREnabled:aD,req:a,nextConfig:aj,prerenderManifest:ae,waitUntil:d.waitUntil,isMinimalMode:T});if(af&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),N.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!m){if(aS)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;ax&&!ay&&am&&b.setHeader(x.NEXT_NAV_DEPLOYMENT_ID_HEADER,am),aM&&!aJ&&(!n||aw)&&(T||b.setHeader("x-nextjs-cache",ap?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:o}=m;if(aH)l={revalidate:0,expire:void 0};else if(aJ)l={revalidate:0,expire:void 0};else if(!N.isDev)if(af)l={revalidate:0,expire:void 0};else if(aM){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??aj.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof aK&&(null==o?void 0:o.kind)===u.CachedRouteKind.APP_PAGE&&o.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=o.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];T&&aM&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=o.segmentData.get(aK);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aN?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(o.headers){let a={...o.headers};for(let[c,d]of(T&&aM||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=o.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(T&&aM&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!o.status||ax&&aD||(b.statusCode=o.status),!T&&o.status&&F.RedirectStatusCode[o.status]&&ax&&(b.statusCode=200),n&&!aJ&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ax&&!af){if(void 0===o.rscData){if(o.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(aj.cacheComponents)return b.statusCode=404,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${o.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:o.html,cacheControl:m.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(o.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=o.html;if(aC&&aE){let c=!0===N.isDev?crypto.randomUUID():null;return v.pipeThrough((0,z.createInstantTestScriptInsertionTransformStream)(c)),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})}if(!n||T||ax)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:m.cacheControl});if(aE||aF)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let B=new TransformStream;return v.push(B.readable),p({span:c,postponed:o.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(B.writable)}).catch(a=>{B.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aY||!aX)return f=aW.getActiveScopeSpan(),await aW.withPropagatedContext(a.headers,()=>aW.trace(i.BaseServerSpan.handleRequest,{spanName:`${aV} ${U}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aV,"http.target":a.url}},r),void 0,!aY);await r(aX)}catch(b){throw b instanceof B.NoFallbackError||await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},74875:(a,b,c)=>{"use strict";function d(a,b){return!1===a?"default":"active"===b||"success"===b?"success":"error"===b||"expired"===b||"unavailable"===b?"error":"default"}c.d(b,{g:()=>d})},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1260,63,155,7108,1220,4884,2056,6070,869,915,6457,4123,7011,6777,412,3284],()=>b(b.s=60976));module.exports=c})();
12
+ ]`;function M({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),o=()=>{h||(g(""),l(""),n(null),b())},p=async()=>{var a;let b;l(""),n(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){l(`${(0,x.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void l((0,x.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void l(b?.error||`Request failed: ${a.status}`);n(b),b.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,x.Tl)("Request failed"))}finally{i(!1)}},q=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(k.aF,{isOpen:a,title:(0,x.Tl)("Bulk Add Codex Accounts"),onClose:o,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,x.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:L,value:f,onChange:a=>g(a.target.value),disabled:h}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,x.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,x.Tl)("failed")}`:""]}),q.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:q.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:p,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,x.Tl)("Importing..."):(0,x.Tl)("Import All")}),(0,d.jsx)(k.$n,{onClick:o,variant:"ghost",fullWidth:!0,disabled:h,children:(0,x.Tl)("Close")})]})]})})}M.propTypes={isOpen:A().bool.isRequired,onClose:A().func.isRequired,onSuccess:A().func};let N={claude:"claudeAutoPing",codex:"codexAutoPing"};function O(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,{getCaps:n}=(0,w.y)(),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(!0),[s,t]=(0,e.useState)(null),[z,A]=(0,e.useState)([]),[C,E]=(0,e.useState)(!1),[F,H]=(0,e.useState)(!1),[L,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(null),[_,aa]=(0,e.useState)({}),[ab,ac]=(0,e.useState)([]),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)({}),[ah,ai]=(0,e.useState)(""),[aj,ak]=(0,e.useState)(()=>new Set),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)([]),[ap,aq]=(0,e.useState)("__none__"),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)(null),[av,aw]=(0,e.useState)(""),[ax,ay]=(0,e.useState)("auto"),[az,aA]=(0,e.useState)({enabled:!1,connections:{}}),[aB,aC]=(0,e.useState)([]),[aD,aE]=(0,e.useState)([]),[aF,aG]=(0,e.useState)([]),[aH,aI]=(0,e.useState)([]),[aJ,aK]=(0,e.useState)(null),[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(!1),[aR,aS]=(0,e.useState)(null),[aT,aU]=(0,e.useState)({}),[aV,aW]=(0,e.useState)(null),aX=(0,e.useRef)(!1),[aY,aZ]=(0,e.useState)(!1),{copied:a$,copy:a_}=(0,v.C)(),a0=()=>{E(!0)},a1=()=>{a6?a0():(Q(""),O(!0))},a2=()=>{Q(""),O(!0)},a3=()=>{a6?a1():a2()},a4=s?{id:s.id,name:s.name||("anthropic-compatible"===s.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===s.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===s.type?"AC":"OC",apiType:s.apiType,baseUrl:s.baseUrl,type:s.type}:l.zN[g]||l.fg[g]||l.IS[g]||l.nJ[g]||l.br[g],a5=a4?.authModes||[],a6=!!l.zN[g]||!!l.IS[g]||a5.includes("oauth"),a7=!!l.fg[g]||a5.includes("apikey"),a8=!!l.IS[g]?.noAuth,a9=(0,m.KC)(g),ba="cursor"===g&&aD.length>0?aD:a9,bb=(0,l.wG)(g),bc=(0,l.mq)(g),bd=(0,l.gb)(g),be=bc||bd,bf=!be&&a6&&a7,bg="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"kimi"===g?"Kimi Coding OAuth":"OAuth",bh="xai"===g?"xAI API Key":"kimi"===g?"Kimi API Key":"API Key",bi=a=>{if(!ax||"auto"===ax)return null;let b=u(g,a);return b&&b.includes(ax)?ax:null},bj=be?g:bb,bk=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=u(g,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of ba)c(a.id);for(let a of aF)c(a.id);for(let a of ab)a.providerAlias===bj&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),bl=be?s?.prefix||g:bb,bm=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bj)}`,{cache:"no-store"}),b=await a.json();a.ok&&aI(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bj]),bn=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bj,ids:[a]})})).ok&&await bm()}catch(a){console.log("Error disabling model:",a)}},bo=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bj)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bm()}catch(a){console.log("Error enabling model:",a)}},bp=async a=>{a.length&&aK({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aK(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bj,ids:a})})).ok&&await bm()}catch(a){console.log("Error disabling all models:",a)}}})},bq=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bj)}`,{method:"DELETE"})).ok&&await bm()}catch(a){console.log("Error enabling all models:",a)}},br=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&aa(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bs=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&ac(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),bt=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=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"})]),e=await a.json(),f=await b.json(),h=await c.json(),i=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===g);p(a)}c.ok&&A(h.proxyPools||[]);let j=(i.providerStrategies||{})[g]||{};au(j.fallbackStrategy||null),aw(null!=j.stickyRoundRobinLimit?String(j.stickyRoundRobinLimit):"1");let k=(i.providerThinking||{})[g]||{};ay(k.mode||"auto");let l=N[g],m=l&&i[l]||{};if(aA({enabled:!0===m.enabled,connections:m.connections||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===g)||null;if(!a&&be)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===g)||null))break}t(a)}}catch(a){console.log("Error fetching connections:",a)}finally{r(!1)}},[g,be]),bu=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(t(c.node),await bt(),W(!1))}catch(a){console.log("Error updating provider node:",a)}},bv=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bw=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bx=async a=>{let b=N[g];if(b){aA(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},by=async(a,b,c=bb)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await br();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bz=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await br()}catch(a){console.log("Error deleting alias:",a)}},bA=async(a,b="llm",c=bj)=>{try{let d=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b})});if(d.ok)await bs();else{let a=await d.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},bB=async(a,b="llm",c=bj)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await bs()}catch(a){console.log("Error deleting custom model:",a)}},bC=async()=>{if(aY)return;let a=o.find(a=>!1!==a.isActive);if(!a)return void alert((0,x.Tl)("Please add an active Qoder connection first"));aZ(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,x.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,x.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,"");ab.some(a=>a.providerAlias===bj&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values(_).includes(`${bj}/${c}`)||(await bA(c,"llm",bj),e+=1)}0===e?alert((0,x.Tl)("All models already exist, no new models added")):alert((0,x.Tl)("Successfully added")+` ${e} `+(0,x.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,x.Tl)("Error fetching models")+": "+a.message)}finally{aZ(!1)}},bD=async()=>{if(aN||0===o.length)return;let a=Object.fromEntries(o.map(a=>[a.id,{state:"queued",error:null}]));aX.current=!1,aO(!0),aQ(!1),aS(null),aU(a),aW({total:o.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<o.length;a+=1){if(aX.current){aW({total:o.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=o[a];aS(d.id),aU(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,aU(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,aU(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}aW({total:o.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<o.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aS(null),aO(!1),aQ(!1),aX.current=!1}},bE=async a=>{aK({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aK(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&p(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bF=()=>{bt(),E(!1)},bG=async a=>{Q("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bt(),O(!1);return}Q(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),Q("Failed to save connection")}},bH=async a=>{try{(await fetch(`/api/providers/${Z.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bt(),U(!1))}catch(a){console.log("Error updating connection:",a)}},bI=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&p(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},bJ=async(a,b)=>{let c=[...o];[c[a],c[b]]=[c[b],c[a]],p(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bt()}},bK=o.filter(a=>an.includes(a.id)),bL=o.length>0&&an.length===o.length;(()=>{if(0===bK.length)return;let a=new Set(bK.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=z.find(a=>a.id===b);return c?.name}})();let bM=()=>{ar||Y(!1)},bN=async a=>{as(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bt(),Y(!1)}finally{as(!1)}},bO=a=>bN(o.map(b=>({connectionId:b.id,proxyPoolId:a}))),bP=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:o.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,an.includes(c)),onChange:()=>{var b;return b=a.id,void ao(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(G,{connection:a,proxyPools:z,isOAuth:a6,isFirst:0===b,isLast:b===o.length-1,onMoveUp:()=>bJ(b,b-1),onMoveDown:()=>bJ(b,b+1),onToggleActive:b=>bI(a.id,b),autoPing:N[g]&&"oauth"===a.authType?{on:!0===az.connections[a.id],onToggle:b=>{var c;return c=a.id,void bx({...az,connections:{...az.connections,[c]:b}})},provider:g}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&p(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{$(a),U(!0)},onDelete:()=>bE(a.id),oneByOneStatus:aT[a.id]||null})})]},a.id)})}),bQ=z.filter(a=>!0===a.isActive),bR=(0,d.jsx)(k.aF,{isOpen:X,onClose:bM,title:`Apply Proxy (${o.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=z.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):bN(o.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:ar||0===bQ.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>bO(null),disabled:ar,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),z.map(a=>(0,d.jsxs)("button",{onClick:()=>bO(a.id),disabled:ar||!0!==a.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),ar&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(k.$n,{onClick:bM,variant:"ghost",fullWidth:!0,disabled:ar,children:"Cancel"})]})}),bS=async a=>{if(!aj.has(a)){ak(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bj}/${a}`})}),c=await b.json();ag(b=>({...b,[a]:c.ok?"ok":"error"})),ai(c.ok?"":c.error||"Model not reachable")}catch{ag(b=>({...b,[a]:"error"})),ai("Network error")}finally{ak(b=>{let c=new Set(b);return c.delete(a),c})}}};if(q)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(k.Qv,{}),(0,d.jsx)(k.Qv,{})]});if(!a4)return(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let bT=()=>bc&&a4.apiType?"responses"===a4.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bd?"/providers/anthropic-m.png":(0,j.HY)(a4.id);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${a4.color}15`},children:ad||!bT()?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:a4.color},children:a4.textIcon||a4.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bT(),alt:a4.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,j.Kw)(a4.id),ae(!0)},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a4.name}),(a4.notice?.apiKeyUrl||a4.notice?.signupUrl||a4.website)&&(0,d.jsxs)("a",{href:a4.notice?.apiKeyUrl||a4.notice?.signupUrl||a4.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),a4.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[o.length," connection",1===o.length?"":"s"]})]})]})]}),a4.deprecated&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:a4.deprecationNotice})]}),a4.notice?.text&&!a4.deprecated&&(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:a4.notice.text}),a4.notice.apiKeyUrl&&(0,d.jsx)("a",{href:a4.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),be&&s&&(0,d.jsx)(k.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bd?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bd?"Messages API":"responses"===s.apiType?"Responses API":"Chat Completions"," \xb7 ",(s.baseUrl||"").replace(/\/$/,""),"/",bd?"messages":"responses"===s.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),O(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>W(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aK({title:"Delete Compatible Node",message:`Delete this ${bd?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aK(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),a8?(0,d.jsx)(k.gw,{providerId:g}):(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[o.length>0&&z.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Y(!0),children:"Apply Proxy"}),o.length>0&&(0,d.jsxs)(d.Fragment,{children:[an.length>0&&(0,d.jsxs)(k.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=an.length;0!==a&&aK({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{aK(null);let a=0,b=[...an];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}p(a=>a.filter(a=>!b.includes(a.id))),ao([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",an.length,")"]}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bD,disabled:aN,children:aN?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aN&&(0,d.jsx)(k.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aN&&(aX.current=!0,aQ(!0))},disabled:aP,children:aP?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(k.lM,{checked:"round-robin"===at,onChange:a=>{let b=a?"round-robin":null,c=a?av||"1":av;a&&!av&&aw("1"),au(b),bv(b,c)}}),"round-robin"===at&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:av,onChange:a=>{var b;aw(b=a.target.value),bv("round-robin",b)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===o.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a6?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bf&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bg," or ",bh,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bf?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a1,children:bg}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:a2,children:bh})]}):(0,d.jsxs)(d.Fragment,{children:[!be&&"iflow"===g&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===g&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>S(!0),children:(0,x.Tl)("Bulk Add")}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:a3,children:be?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[aV&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",aV.total]}),(0,d.jsxs)("span",{children:["Completed: ",aV.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aV.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aV.failed]}),aV.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aN&&aR&&(0,d.jsxs)("span",{children:["Running: ",o.find(a=>a.id===aR)?.name||aR]})]})}),o.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:bL,onChange:()=>{bL?ao([]):ao(o.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),bP,!be&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>S(!0),title:(0,x.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,x.Tl)("Bulk Add")}),bf?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a1,className:"w-full sm:w-auto",children:bg}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:a2,className:"w-full sm:w-auto",children:bh})]}):(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:a3,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bk&&(0,d.jsx)("select",{value:ax,onChange:a=>{var b;ay(b=a.target.value),bw(b)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:bk.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),!be&&(a=[...ba,...aF.filter(a=>!ba.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!aH.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aH.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bq,children:"Active All"}),a.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bp(a),children:"Disable All"})]}))]}),!!ah&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ah}),(()=>{let a,b,c;if(be)return(0,d.jsx)(D,{providerStorageAlias:bj,providerDisplayAlias:bl,modelAliases:_,customModels:ab,copied:a$,onCopy:a_,onSetAlias:by,onDeleteAlias:bz,onAddCustomModel:a=>bA(a,"llm",bj),onDeleteCustomModel:a=>bB(a,"llm",bj),connections:o,isAnthropic:bd});let e=[...ba,...aF.filter(a=>!ba.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}),f=new Set(aH),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),j=y({customModels:ab,modelAliases:_,providerAlias:bj,builtInModels:ba,type:"llm"});return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[j.map(a=>(0,d.jsx)(B,{model:{id:a.id,name:a.name},fullModel:`${bl}/${a.id}`,alias:a.alias,copied:a$,onCopy:a_,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?bB(a.id,"llm",bj):bz(a.alias)},testStatus:af[a.id],onTest:o.length>0||a8?()=>bS(a.id):void 0,isTesting:aj.has(a.id),isCustom:!0,isFree:!1,caps:n(`${g}/${a.id}`),thinkingSuffix:bi(a.id)},`${a.source}-${a.fullModel}`)),h.map(a=>{let b=`${bj}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(_).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(B,{model:a,fullModel:`${bl}/${a.id}`,alias:e,copied:a$,onCopy:a_,onSetAlias:b=>by(a.id,b,bj),onDeleteAlias:()=>bz(e),testStatus:af[a.id],onTest:o.length>0||a8?()=>bS(a.id):void 0,isTesting:aj.has(a.id),isFree:a.isFree,onDisable:()=>bn(a.id),caps:n(`${g}/${a.id}`),thinkingSuffix:bi(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>am(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&o.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bC,disabled:aY,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:aY?{animation:"spin 1s linear infinite"}:void 0,children:aY?"progress_activity":"download"}),aY?(0,x.Tl)("Fetching..."):(0,x.Tl)("Fetch Qoder Models")]}),aB.length>0&&(a=new Set([...Object.values(_),...j.map(a=>a.fullModel)]),b=new Set(ba.map(a=>a.id)),0===(c=aB.filter(c=>!a.has(`${bj}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await bA(a.id,"llm",bj)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>bo(a.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),bR,"kiro"===g?(0,d.jsx)(k.Mh,{isOpen:C,providerInfo:a4,onSuccess:bF,onClose:()=>E(!1)}):"cursor"===g?(0,d.jsx)(k.G9,{isOpen:C,onSuccess:bF,onClose:()=>E(!1)}):"gitlab"===g?(0,d.jsx)(k.vj,{isOpen:C,providerInfo:a4,onSuccess:bF,onClose:()=>E(!1)}):(0,d.jsx)(k.LF,{isOpen:C,provider:g,providerInfo:a4,onSuccess:bF,onClose:()=>E(!1)}),"iflow"===g&&(0,d.jsx)(k.vE,{isOpen:F,onSuccess:()=>{bt(),H(!1)},onClose:()=>H(!1)}),(0,d.jsx)(I,{isOpen:L,provider:g,providerName:a4.name,isCompatible:be,isAnthropic:bd,authType:a4?.authType,authHint:a4?.authHint,website:a4?.website,proxyPools:z,error:P,existingNames:o.map(a=>a.name).filter(Boolean),onSave:bG,onBulkDone:bt,onClose:()=>{Q(""),O(!1)}}),(0,d.jsx)(k.wI,{isOpen:T,connection:Z,proxyPools:z,onSave:bH,onClose:()=>U(!1)}),be&&(0,d.jsx)(J,{isOpen:V,node:s,onSave:bu,onClose:()=>W(!1),isAnthropic:bd}),!be&&(0,d.jsx)(K,{isOpen:al,providerAlias:bj,providerDisplayAlias:bl,onSave:async a=>{await bA(a,"llm",bj),am(!1)},onClose:()=>am(!1)}),"codex"===g&&(0,d.jsx)(M,{isOpen:R,onClose:()=>S(!1),onSuccess:bt}),(0,d.jsx)(k.uo,{isOpen:aL,onClose:()=>aM(!1),onConfirm:()=>{(aM(!1),a6)?a0():a2()},title:"Risk Notice",message:a4?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(k.uo,{isOpen:!!aJ,onClose:()=>aK(null),onConfirm:aJ?.onConfirm,title:aJ?.title||"Confirm",message:aJ?.message,variant:"danger"})]})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60976:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>M,handler:()=>O,routeModule:()=>N});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(63747),o=c(24235),p=c(23938),q=c(261),r=c(66758),s=c(77243),t=c(26713),u=c(37527),v=c(22820),w=c(88216),x=c(47929),y=c(79551),z=c(71797),A=c(89125),B=c(86439),C=c(77068),D=c(27269),E=c(61287),F=c(81494),G=c(70722),H=c(70753),I=c(43954),J=c(17891),K={};for(let a in E)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(K[a]=()=>E[a]);c.d(b,K);let L={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,93110)),"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/Users/Working/router4/9router/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,57529)),"/Users/Working/router4/9router/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,M={require:c,loadChunk:()=>Promise.resolve()},N=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:L},distDir:".next-cli-build",relativeProjectDir:""});async function O(a,b,d){var K,P,Q,R,S;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),N.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let T=!!(0,h.getRequestMeta)(a,"minimalMode"),U="/(dashboard)/dashboard/providers/[id]/page";"/index"===U&&(U="/");let V=await N.prepare(a,b,{srcPage:U,multiZoneDraftMode:!1});if(!V)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:W,query:X,params:Y,pageIsDynamic:Z,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,serverActionsManifest:ab,clientReferenceManifest:ac,subresourceIntegrityManifest:ad,prerenderManifest:ae,isDraftMode:af,resolvedPathname:ag,revalidateOnlyGenerated:ah,routerServerContext:ai,nextConfig:aj,parsedUrl:ak,interceptionRoutePatterns:al,deploymentId:am,clientAssetToken:an}=V,ao=(0,q.normalizeAppPath)(U),{isOnDemandRevalidate:ap}=V,aq=aj.experimental.ppr&&!aj.cacheComponents&&(0,I.isInterceptionRouteAppPath)(ag)?null:N.match(ag,ae),ar=(null==aq?void 0:aq.route)??null,as=!!ae.routes[ag],at=a.headers["user-agent"]||"",au=(0,t.getBotType)(at),av=(0,p.isHtmlBotRequest)(a),aw=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ax=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],ay=(0,r.getIsPossibleServerAction)(a),az=(0,m.checkIsAppPPREnabled)(aj.experimental.ppr),aA=a.headers[x.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&T&&az&&ay&&aA&&"string"==typeof aA){let e=parseInt(aA,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(S=aj.experimental.serverActions)?void 0:S.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,D.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&az&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize),f=await (0,D.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aB=!0===N.isDev||!0===aj.experimental.exposeTestingApiInProductionBuild,aC=aB&&("1"===a.headers[s.NEXT_INSTANT_PREFETCH_HEADER]||void 0===a.headers[s.RSC_HEADER]&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(s.NEXT_INSTANT_TEST_COOKIE+"=")),aD=(az||aC)&&((null==(K=ae.routes[ao]??ae.dynamicRoutes[ao])?void 0:K.renderingMode)==="PARTIALLY_STATIC"||aC&&(aB||(null==ai?void 0:ai.experimentalTestProxy)===!0)),aE=aC&&aD,aF=aE&&!0===N.isDev,aG=!1,aH=aD?(0,h.getRequestMeta)(a,"postponed"):void 0,aI=null==(P=ae.routes[ag])?void 0:P.prefetchDataRoute,aJ=aD&&ax&&!aw&&!aI;T&&(aJ=aJ&&!!aH);let aK=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aL=(!au||!aD)&&(!at||(0,p.shouldServeStreamingMetadata)(at,aj.htmlLimitedBots)),aM=!!((ar||as||ae.routes[ao])&&!(au&&aD)),aN=aD&&!0===aj.cacheComponents,aO=!0===N.isDev||!aM||"string"==typeof aH||(aN&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aJ&&!T:aJ),aP=!!au&&aD,aQ=(null==ar?void 0:ar.remainingPrerenderableParams)??[],aR=(null==ar?void 0:ar.fallback)===null&&((null==(Q=ar.fallbackRootParams)?void 0:Q.length)??0)>0,aS=null;if(!af&&aM&&!aO&&!ay&&!aH&&!aJ){let a=aq?"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:aq.source:null;if(!0===aj.experimental.partialFallbacks&&a&&(null==ar?void 0:ar.fallbackRouteParams)&&!aR){if(aQ.length>0){let b,c=(b=new Map(aQ.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,J.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==Y?void 0:Y[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace(function(a){let{repeat:b,optional:c}=(0,J.getParamProperties)(a.paramType);return c?`[[...${a.paramName}]]`:b?`[...${a.paramName}]`:`[${a.paramName}]`}(d),f)}).join("/")||"/");aS=c!==a?c:null}}else aS=ag}let aT=aS;!aT&&(N.isDev||aM&&Z&&(null==ar?void 0:ar.fallbackRouteParams)&&!ay)&&(aT=ag),N.isDev||af||!aM||!ax||aJ||(0,k.d)(a.headers);let aU={...E,tree:L,handler:O,routeModule:N,__next_app__:M};ab&&ac&&(0,o.setManifestsSingleton)({page:U,clientReferenceManifest:ac,serverActionsManifest:ab});let aV=a.method||"GET",aW=(0,g.getTracer)(),aX=aW.getActiveScopeSpan(),aY=!!(null==ai?void 0:ai.isWrappedByNextServer),aZ=!0===aj.experimental.partialFallbacks&&aQ.length>0?(null==ar||null==(R=ar.fallbackRouteParams)?void 0:R.filter(a=>!aQ.some(b=>b.paramName===a.paramName)))??[]:[],a$=async()=>((null==ai?void 0:ai.render404)?await ai.render404(a,b,ak,!1):b.end("This page could not be found"),null);try{let f,k=N.getVaryHeader(ag,al);b.setHeader("Vary",k);let m=async(c,d)=>{let e=new l.NodeNextRequest(a),g=new l.NodeNextResponse(b);return N.render(e,g,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aW.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aV} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),f&&f!==c&&(f.setAttribute("http.route",d),f.updateName(a))}else c.updateName(`${aV} ${U}`)})},o=(0,h.getRequestMeta)(a,"incrementalCache")||await N.getIncrementalCache(a,aj,ae,T);null==o||o.resetRequestCache(),globalThis.__incrementalCache=o;let p=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:X,params:Y,page:ao,sharedContext:{buildId:W,deploymentId:am,clientAssetToken:an},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aU,Component:(0,j.T)(aU),params:Y,routeModule:N,page:U,postponed:f,shouldWaitOnAllReady:aP,serveStreamingMetadata:aL,supportsDynamicResponse:"string"==typeof f||aO,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,subresourceIntegrityManifest:ad,setCacheStatus:null==ai?void 0:ai.setCacheStatus,setIsrStatus:null==ai?void 0:ai.setIsrStatus,setReactDebugChannel:null==ai?void 0:ai.setReactDebugChannel,sendErrorsToBrowser:null==ai?void 0:ai.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),N.relativeProjectDir),isDraftMode:af,botType:au,isOnDemandRevalidate:ap,isPossibleServerAction:ay,assetPrefix:aj.assetPrefix,nextConfigOutput:aj.output,crossOrigin:aj.crossOrigin,trailingSlash:aj.trailingSlash,images:aj.images,previewProps:ae.preview,enableTainting:aj.experimental.taint,htmlLimitedBots:aj.htmlLimitedBots,reactMaxHeadersLength:aj.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:o,cacheLifeProfiles:aj.cacheLife,basePath:aj.basePath,serverActions:aj.experimental.serverActions,logServerFunctions:"object"==typeof aj.logging&&!!aj.logging.serverFunctions,...aE||aF||aG?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aF}:{},cacheComponents:!!aj.cacheComponents,experimental:{isRoutePPREnabled:aD,expireTime:aj.expireTime,staleTimes:aj.experimental.staleTimes,dynamicOnHover:!!aj.experimental.dynamicOnHover,optimisticRouting:!!aj.experimental.optimisticRouting,inlineCss:!!aj.experimental.inlineCss,prefetchInlining:aj.experimental.prefetchInlining??!1,authInterrupts:!!aj.experimental.authInterrupts,cachedNavigations:!!aj.experimental.cachedNavigations,clientTraceMetadata:aj.experimental.clientTraceMetadata||[],clientParamParsingOrigins:aj.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,C.parseMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>N.onRequestError(a,b,d,e,ai),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await m(e,k),{metadata:n}=l,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=n;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aM&&(null==p?void 0:p.revalidate)===0&&!N.isDev&&!aD){let a=n.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ag}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
13
+ see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:n.flightData,postponed:n.postponed,status:n.statusCode,segmentData:n.segmentData},cacheControl:p}},q=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===N.isDev,m=c||b.writableEnded;if(ap&&ah&&!f&&!T)return(null==ai?void 0:ai.render404)?await ai.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ar&&(k=(0,v.parseFallbackField)(ar.fallback)),!0===aj.experimental.partialFallbacks&&(null==ar?void 0:ar.fallback)===null&&!aR&&aQ.length>0&&(k=v.FallbackMode.PRERENDER),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(at)&&(!aD||av)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ap=!0),ap&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!T&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aT&&!m&&!af&&Z&&(l||!as)){if((l||ar)&&k===v.FallbackMode.NOT_FOUND){if(aj.adapterPath)return await a$();throw new B.NoFallbackError}if(aD&&(aj.cacheComponents?!aJ:!ax)){let b=l&&"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:ao,f=(l||aE)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;aE&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await N.handleResponse({cacheKey:b,req:a,nextConfig:aj,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ae,isRoutePPREnabled:aD,responseGenerator:async()=>p({span:i,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:T});if(null===g)return null;if(g)return T||!aD||!(aQ.length>0)||!0!==aj.experimental.partialFallbacks||!aS||!o||ap||aG||aB||aC||aw||(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(aS,o,aD,!1,a=>p({span:a.span,postponed:void 0,fallbackRouteParams:aZ.length>0?(0,n.createOpaqueFallbackRouteParams)(aZ):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let r=ap||g||!aH?void 0:aH;if(aN&&!T&&o&&(aJ||ay)&&!j){let b=await o.get(ag,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(ag,o,aD,!1,a=>q({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aE||aF)&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||aE&&!as)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;if((l||aE)&&aj.cacheComponents&&!as&&(null==ar?void 0:ar.fallbackRouteParams)){let b=(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return p({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},r=async c=>{var f,g,i,j,k;let l,m=await N.handleResponse({cacheKey:aS,responseGenerator:a=>q({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ap,isRoutePPREnabled:aD,req:a,nextConfig:aj,prerenderManifest:ae,waitUntil:d.waitUntil,isMinimalMode:T});if(af&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),N.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!m){if(aS)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;ax&&!ay&&am&&b.setHeader(x.NEXT_NAV_DEPLOYMENT_ID_HEADER,am),aM&&!aJ&&(!n||aw)&&(T||b.setHeader("x-nextjs-cache",ap?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:o}=m;if(aH)l={revalidate:0,expire:void 0};else if(aJ)l={revalidate:0,expire:void 0};else if(!N.isDev)if(af)l={revalidate:0,expire:void 0};else if(aM){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??aj.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof aK&&(null==o?void 0:o.kind)===u.CachedRouteKind.APP_PAGE&&o.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=o.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];T&&aM&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=o.segmentData.get(aK);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aN?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(o.headers){let a={...o.headers};for(let[c,d]of(T&&aM||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=o.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(T&&aM&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!o.status||ax&&aD||(b.statusCode=o.status),!T&&o.status&&F.RedirectStatusCode[o.status]&&ax&&(b.statusCode=200),n&&!aJ&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ax&&!af){if(void 0===o.rscData){if(o.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(aj.cacheComponents)return b.statusCode=404,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${o.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:o.html,cacheControl:m.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(o.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=o.html;if(aC&&aE){let c=!0===N.isDev?crypto.randomUUID():null;return v.pipeThrough((0,z.createInstantTestScriptInsertionTransformStream)(c)),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})}if(!n||T||ax)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:m.cacheControl});if(aE||aF)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let B=new TransformStream;return v.push(B.readable),p({span:c,postponed:o.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(B.writable)}).catch(a=>{B.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aY||!aX)return f=aW.getActiveScopeSpan(),await aW.withPropagatedContext(a.headers,()=>aW.trace(i.BaseServerSpan.handleRequest,{spanName:`${aV} ${U}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aV,"http.target":a.url}},r),void 0,!aY);await r(aX)}catch(b){throw b instanceof B.NoFallbackError||await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},74875:(a,b,c)=>{"use strict";function d(a,b){return!1===a?"default":"active"===b||"success"===b?"success":"error"===b||"expired"===b||"unavailable"===b?"error":"default"}c.d(b,{g:()=>d})},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1260,63,155,7108,1220,4884,9660,6070,869,915,6457,4123,7011,6777,412,3284],()=>b(b.s=60976));module.exports=c})();