@ltgiang/9router 0.5.37 → 0.5.39

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 (536) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +13 -13
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +9 -9
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  73. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  74. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  81. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  83. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  84. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  85. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  86. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  88. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/combos/reorder/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/models/order/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/providers/[id]/connections/disabled/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/[id]/pool/pull/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/pool/push/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/[id]/pool/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  278. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  280. package/app/.next-cli-build/server/app/callback.html +1 -1
  281. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  282. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  283. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  285. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  290. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  291. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  294. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  295. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  297. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  300. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  301. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  304. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  305. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  307. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  310. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  311. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  314. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  315. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  317. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  325. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  327. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  331. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  335. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  336. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  338. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  341. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  342. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  345. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  346. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  348. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  351. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  352. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  355. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  356. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  358. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  361. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  362. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  367. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  369. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  372. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  374. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  376. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  377. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  379. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  382. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  386. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  387. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  389. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  391. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  392. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  393. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  394. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  396. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  397. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  399. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  405. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  406. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  408. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  415. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  419. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  420. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  422. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  425. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  430. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  432. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  435. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  440. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  442. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  445. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  450. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  452. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  455. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  459. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  461. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/index.html +1 -1
  464. package/app/.next-cli-build/server/app/index.rsc +4 -4
  465. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  466. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  467. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  469. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  471. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  472. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  473. package/app/.next-cli-build/server/app/landing.html +1 -1
  474. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  475. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  476. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  478. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  480. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/login/page.js +1 -1
  482. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  484. package/app/.next-cli-build/server/app/login.html +1 -1
  485. package/app/.next-cli-build/server/app/login.rsc +5 -5
  486. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  487. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  489. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  491. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  493. package/app/.next-cli-build/server/app/page.js +1 -1
  494. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  496. package/app/.next-cli-build/server/app-paths-manifest.json +13 -13
  497. package/app/.next-cli-build/server/chunks/255.js +1 -1
  498. package/app/.next-cli-build/server/chunks/3862.js +1 -1
  499. package/app/.next-cli-build/server/chunks/412.js +2 -2
  500. package/app/.next-cli-build/server/chunks/{9212.js → 4746.js} +1 -1
  501. package/app/.next-cli-build/server/chunks/{9325.js → 4827.js} +1 -1
  502. package/app/.next-cli-build/server/chunks/5330.js +5 -3
  503. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  504. package/app/.next-cli-build/server/chunks/6173.js +1 -0
  505. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  506. package/app/.next-cli-build/server/chunks/{3008.js → 8238.js} +1 -1
  507. package/app/.next-cli-build/server/chunks/8612.js +1 -1
  508. package/app/.next-cli-build/server/chunks/8668.js +1 -1
  509. package/app/.next-cli-build/server/chunks/8914.js +1 -1
  510. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  511. package/app/.next-cli-build/server/pages/404.html +1 -1
  512. package/app/.next-cli-build/server/pages/500.html +1 -1
  513. package/app/.next-cli-build/static/chunks/1321-e4c79e2cdf68e284.js +1 -0
  514. package/app/.next-cli-build/static/chunks/{5497-474ddf2f9f1e240f.js → 5497-98a294643e6a188f.js} +2 -2
  515. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-7ba4c41756c05cb5.js → page-f72dd3feb26e37b8.js} +1 -1
  516. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-8b1acb4da984eaa1.js → page-125afc454b5cabed.js} +1 -1
  517. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-d6c84f2d5e1f6918.js +59 -0
  518. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-8d76903c3a660e35.js → page-a80f28e86b1c62f4.js} +1 -1
  519. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-58605ef32c4743da.js → page-2fe0585adb58584f.js} +1 -1
  520. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-e3f67c61640e6c04.js → page-5d766b35ca3d5649.js} +1 -1
  521. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-8087edfe1b477a47.js → page-d7e816b59a7568a3.js} +1 -1
  522. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d79551790a599cc0.js → page-19beba08f131dae3.js} +1 -1
  523. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-c1d4cc4e73287170.js → page-dce32961998d9205.js} +1 -1
  524. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-ef9399b03a241d5d.js → page-682f62efbaa33d99.js} +1 -1
  525. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-3c4a78d014c6e082.js → page-368d5a5281671f5a.js} +1 -1
  526. package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.21-to-0.5.22-0.5.22-20260630-180928 → upgrade-0.5.36-to-0.5.37-0.5.37-20260706-105502}/data.sqlite +0 -0
  527. package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.22-to-0.5.26-0.5.26-20260701-181108 → upgrade-0.5.37-to-0.5.38-0.5.38-20260706-111459}/data.sqlite +0 -0
  528. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  529. package/app/package.json +1 -1
  530. package/package.json +1 -1
  531. package/app/.next-cli-build/server/chunks/604.js +0 -1
  532. package/app/.next-cli-build/server/chunks/6775.js +0 -1
  533. package/app/.next-cli-build/static/chunks/1321-87efb6064fab51ca.js +0 -1
  534. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-7fb2bc13098a64e2.js +0 -59
  535. /package/app/.next-cli-build/static/{CZsjEfWjq_f7idhY_DQnQ → t19opduSGtFKLoqvYoUh6}/_buildManifest.js +0 -0
  536. /package/app/.next-cli-build/static/{CZsjEfWjq_f7idhY_DQnQ → t19opduSGtFKLoqvYoUh6}/_ssgManifest.js +0 -0
@@ -1,59 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{53836:(e,t,a)=>{Promise.resolve().then(a.bind(a,90973))},70217:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},90973:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>F});var s=a(95155),r=a(73321),n=a(98500),i=a.n(n),l=a(12115),o=a(35497),d=a(57250),c=a(81095),m=a(70217),p=a(14051),u=a.n(p);function x({until:e}){let[t,a]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function h({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:n,onMoveUp:i,onMoveDown:d,onToggleActive:c,onUpdateProxy:p,onEdit:u,onDelete:b}){let[g,f]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),[j,w]=(0,l.useState)(!1),N=(0,l.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),S=e.providerSpecificData?.proxyPoolId||null,C=S?k.get(S):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,T=!!S||$,P=C?`Pool: ${C.name}`:S?`Pool: ${S} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",_="",A=C?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(A)try{let e=new URL(A);_=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{_=A}let E=C?.noProxy||e.providerSpecificData?.connectionNoProxy||"",I=C?.isActive===!0?"success":S||$?"error":"default",R=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=R?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[R]),(0,l.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let M="unavailable"!==e.testStatus||j?e.testStatus:"active",O=a?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{v(!0);try{await p("__none__"===e?null:e)}finally{v(!1),f(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:i,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(o.Ex,{variant:(0,m.g)(e.isActive,M),size:"sm",dot:!0,children:!1===e.isActive?"disabled":M||"Unknown"}),T&&(0,s.jsx)(o.Ex,{variant:I,size:"sm",children:"Proxy"}),j&&!1!==e.isActive&&(0,s.jsx)(x,{until:R}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),T&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:P,children:P}),_&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:_}),E&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${T?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!S?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${S===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:u,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function b({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:n,onClose:i}){let d="__none__",[c,m]=(0,l.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[p,u]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),y=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();h(a.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},v=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{u(!0),h(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,s.jsx)(o.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(o.$n,{onClick:y,disabled:!c.apiKey||p||g,variant:"secondary",children:p?"Checking...":"Check"})})]}),x&&(0,s.jsx)(o.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(o.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(o.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function g({providerId:e,isOAuth:t}){let[a,r]=(0,l.useState)([]),[n,i]=(0,l.useState)([]),[d,c]=(0,l.useState)(!0),[m,p]=(0,l.useState)(!1),[u,x]=(0,l.useState)(!1),[f,y]=(0,l.useState)(null),[v,j]=(0,l.useState)(null),[w,N]=(0,l.useState)("1"),[k,S]=(0,l.useState)(null),C=(0,l.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),n=await t.json(),l=await a.json(),o=s.ok?await s.json():{};t.ok&&r((n.connections||[]).filter(t=>t.provider===e)),a.ok&&i(l.proxyPools||[]);let d=(o.providerStrategies||{})[e]||{};j(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,l.useEffect)(()=>{C()},[C]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},n={};t&&(n.fallbackStrategy=t),"round-robin"===t&&""!==a&&(n.stickyRoundRobinLimit=Number(a)||3);let i={...r};0===Object.keys(n).length?delete i[e]:i[e]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("saveStrategy error:",e)}},T=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch{await C()}},P=async e=>{S({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{S(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},_=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await C(),p(!1))}catch(e){console.log("save apikey error:",e)}},I=async e=>{try{(await fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await C(),x(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(o.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(o.lM,{checked:"round-robin"===v,onChange:e=>{let t=e?"round-robin":null;j(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===v&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(h,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>T(r,r-1),onMoveDown:()=>T(r,r+1),onToggleActive:t=>_(e.id,t),onUpdateProxy:t=>A(e.id,t),onEdit:()=>{y(e),x(!0)},onDelete:()=>P(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add"})})]})]}),(0,s.jsx)(b,{isOpen:m,provider:e,proxyPools:n,onSave:E,onClose:()=>p(!1)}),(0,s.jsx)(o.wI,{isOpen:u,connection:f,proxyPools:n,onSave:I,onClose:()=>x(!1)}),(0,s.jsx)(o.uo,{isOpen:!!k,onClose:()=>S(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}x.propTypes={until:u().string.isRequired},h.propTypes={connection:u().shape({id:u().string,name:u().string,email:u().string,displayName:u().string,testStatus:u().string,isActive:u().bool,lastError:u().string,priority:u().number}).isRequired,proxyPools:u().array,isOAuth:u().bool.isRequired,isFirst:u().bool.isRequired,isLast:u().bool.isRequired,onMoveUp:u().func.isRequired,onMoveDown:u().func.isRequired,onToggleActive:u().func.isRequired,onUpdateProxy:u().func,onEdit:u().func.isRequired,onDelete:u().func.isRequired},b.propTypes={isOpen:u().bool.isRequired,provider:u().string,providerName:u().string,proxyPools:u().array,onSave:u().func.isRequired,onClose:u().func.isRequired},g.propTypes={providerId:u().string.isRequired,isOAuth:u().bool};var f=a(28777),y=a(11059);function v({model:e,fullModel:t,copied:a,onCopy:r,testStatus:n,isCustom:i,isFree:l,onDeleteAlias:o,onTest:d,isTesting:c}){let m="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute 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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),l&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),i&&(0,s.jsx)("button",{onClick:o,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function j({isOpen:e,onSave:t,onClose:a}){let[r,n]=(0,l.useState)(""),i=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,s.jsx)(o.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&i(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:i,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(o.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:n}=(0,y.C)(),[i,d]=(0,l.useState)({}),[m,p]=(0,l.useState)([]),[u,x]=(0,l.useState)({}),[h,b]=(0,l.useState)(null),[g,N]=(0,l.useState)(""),[k,S]=(0,l.useState)(!1),[C,$]=(0,l.useState)([]),T=a||(0,c.wG)(e),P=t||"llm",_=(0,l.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),n=await a.json(),i=await s.json();t.ok&&d(r.aliases||{}),a.ok&&$((n.connections||[]).filter(t=>t.provider===e)),s.ok&&p(i.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[e]);(0,l.useEffect)(()=>{_()},[_]);let A=async(e,t)=>{let a=`${T}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await _()}catch(e){console.log("set alias error:",e)}},E=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await _()}catch(e){console.log("delete alias error:",e)}},I=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:T,id:e,type:P})})).ok&&(await _(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},R=async e=>{try{let t=new URLSearchParams({providerAlias:T,id:e,type:P});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await _(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},M=async e=>{if(!h){b(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${T}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),N(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),N("Network error")}finally{b(null)}}},O=(0,f.KC)(e),K=t?O.filter(e=>e.kinds?e.kinds.includes(t):(0,f.CP)(e,"llm")===t):O,L=m.filter(e=>e.providerAlias===T&&(0,f.CP)(e,"llm")===P&&!K.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),g&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:g}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${T}/${e.id}`,a=Object.entries(i).find(([,e])=>e===t)?.[0];return(0,s.jsx)(v,{model:e,fullModel:`${T}/${e.id}`,alias:a,copied:r,onCopy:n,onSetAlias:t=>A(e.id,t),onDeleteAlias:()=>E(a),testStatus:u[e.id],onTest:C.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),L.map(e=>(0,s.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${T}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>R(e.id),testStatus:u[e.id],onTest:C.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>S(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(j,{isOpen:k,onSave:async e=>{await I(e),S(!1)},onClose:()=>S(!1)})]})}function N({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}v.propTypes={model:u().shape({id:u().string.isRequired}).isRequired,fullModel:u().string.isRequired,copied:u().string,onCopy:u().func.isRequired,testStatus:u().oneOf(["ok","error"]),isCustom:u().bool,isFree:u().bool,onDeleteAlias:u().func,onTest:u().func,isTesting:u().bool},j.propTypes={isOpen:u().bool.isRequired,onSave:u().func.isRequired,onClose:u().func.isRequired},w.propTypes={providerId:u().string.isRequired,kindFilter:u().string,providerAliasOverride:u().string};let k={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
2
- "results": [
3
- { "title": "...", "url": "...", "snippet": "..." }
4
- ]
5
- }`,extraFields:[{key:"search_type",label:"Type",type:"select",default:"web",options:["web","news"]},{key:"max_results",label:"Max results",type:"number",default:5,min:1,max:100},{key:"country",label:"Country",type:"text",default:""},{key:"language",label:"Language",type:"text",default:""}]},webFetch:{inputLabel:"URL",inputPlaceholder:"https://example.com",defaultInput:"https://example.com",bodyKey:"url",defaultResponse:`{
6
- "content": "...",
7
- "title": "...",
8
- "url": "..."
9
- }`,extraFields:[{key:"format",label:"Format",type:"select",default:"markdown",options:["markdown","text","html"]},{key:"max_characters",label:"Max chars",type:"number",default:0,min:0}]},image:{inputLabel:"Prompt",inputPlaceholder:"A cute cat wearing a hat",defaultInput:"A cute cat wearing a hat",bodyKey:"prompt",defaultResponse:`{
10
- "data": [
11
- { "url": "...", "b64_json": "..." }
12
- ]
13
- }`,extraFields:[{key:"n",label:"n",type:"number",default:1,min:1,max:4},{key:"size",label:"Size",type:"select",default:"auto",options:["auto","1024x1024","1024x1536","1536x1024","1024x1792","1792x1024"]},{key:"quality",label:"Quality",type:"select",default:"auto",options:["auto","low","medium","high","standard","hd"]},{key:"background",label:"Background",type:"select",default:"auto",options:["auto","transparent","opaque"]},{key:"style",label:"Style",type:"select",default:"",options:["","vivid","natural"]},{key:"response_format",label:"Format",type:"select",default:"",options:["","url","b64_json"]},{key:"image_detail",label:"Image Detail",type:"select",default:"high",options:["auto","low","high","original"]},{key:"output_format",label:"Codec",type:"select",default:"png",options:["png","jpeg","webp"]}]},imageToText:{inputLabel:"Image URL",inputPlaceholder:"https://example.com/image.png",defaultInput:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg",bodyKey:"url",extraBody:{prompt:"Describe this image in detail"},defaultResponse:`{
14
- "text": "A cat sitting on a windowsill...",
15
- "model": "..."
16
- }`},video:{inputLabel:"Prompt",inputPlaceholder:"A serene lake at sunset",defaultInput:"A serene lake at sunset",bodyKey:"prompt",defaultResponse:`{
17
- "data": [
18
- { "url": "..." }
19
- ]
20
- }`},music:{inputLabel:"Prompt",inputPlaceholder:"A calm piano melody",defaultInput:"A calm piano melody",bodyKey:"prompt",defaultResponse:`{
21
- "data": [
22
- { "url": "...", "format": "mp3" }
23
- ]
24
- }`}},S=`{
25
- "object": "list",
26
- "data": [{
27
- "object": "embedding",
28
- "index": 0,
29
- "embedding": [0.002301, -0.019212, 0.004815, -0.031249, ...]
30
- }],
31
- "model": "...",
32
- "usage": { "prompt_tokens": 9, "total_tokens": 9 }
33
- }`;function C({providerId:e,customAlias:t}){let a=(0,c.gC)(e),r=a?t||e:(0,c.wG)(e),n=a?[]:(0,f.KC)(e).filter(e=>"embedding"===(0,f.CP)(e)),[i,d]=(0,l.useState)(n[0]?.id??""),[m,p]=(0,l.useState)("The quick brown fox jumps over the lazy dog"),[u,x]=(0,l.useState)(""),[h,b]=(0,l.useState)(""),[g,v]=(0,l.useState)(!1),[j,w]=(0,l.useState)(""),[k,$]=(0,l.useState)(""),[T,P]=(0,l.useState)(null),[_,A]=(0,l.useState)(!1),[E,I]=(0,l.useState)(""),{copied:R,copy:M}=(0,y.C)(),{copied:O,copy:K}=(0,y.C)();(0,l.useEffect)(()=>{w(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{b((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&$(e.publicUrl)}).catch(()=>{})},[]);let L=g?k:j,B=i?`${r}/${i}`:"",D=()=>{let e={model:B,input:m.trim()},t=Number(u);return u&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},U=`curl -X POST ${L}/v1/embeddings \\
34
- -H "Content-Type: application/json" \\
35
- -H "Authorization: Bearer ${h||"YOUR_KEY"}" \\
36
- -d '${JSON.stringify(D())}'`,F=async()=>{if(!m.trim()||!B)return;A(!0),I(""),P(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let a=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(D())}),s=Date.now()-e,r=await a.json();if(!a.ok)return void I(r?.error?.message||r?.error||`HTTP ${a.status}`);P({data:r,latencyMs:s})}catch(e){I(e.message||"Network error")}finally{A(!1)}},V=T?JSON.stringify(T.data,null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(N,{label:"Model",children:a?(0,s.jsx)("input",{value:i,onChange:e=>d(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,s.jsx)("select",{value:i,onChange:e=>d(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:n.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(N,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:L,onChange:e=>g?$(e.target.value):w(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"}),k&&(0,s.jsxs)("button",{onClick:()=>v(e=>!e),title:g?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${g?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(N,{label:"API Key",children:(0,s.jsx)("input",{type:"password",value:h,onChange:e=>b(e.target.value),placeholder:"sk-...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(N,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:m,onChange:e=>p(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,s.jsx)("button",{type:"button",onClick:()=>p(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)(N,{label:"Dimensions",children:(0,s.jsx)("input",{type:"number",min:"1",value:u,onChange:e=>x(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>M(U),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:R?"check":"content_copy"}),R?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:F,disabled:_||!m.trim()||!B,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:_?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),_?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:U})]}),E&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:E}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",T&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",T.latencyMs,"ms"]})]}),T&&(0,s.jsxs)("button",{onClick:()=>K(V),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:O?"check":"content_copy"}),O?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return S;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(T?.data)})]})]})]})}let $={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0}},T=[{id:"af",name:"Afrikaans",type:"tts"},{id:"ar",name:"Arabic",type:"tts"},{id:"bg",name:"Bulgarian",type:"tts"},{id:"bn",name:"Bengali",type:"tts"},{id:"bs",name:"Bosnian",type:"tts"},{id:"ca",name:"Catalan",type:"tts"},{id:"cs",name:"Czech",type:"tts"},{id:"cy",name:"Welsh",type:"tts"},{id:"da",name:"Danish",type:"tts"},{id:"de",name:"German",type:"tts"},{id:"el",name:"Greek",type:"tts"},{id:"en",name:"English",type:"tts"},{id:"eo",name:"Esperanto",type:"tts"},{id:"es",name:"Spanish",type:"tts"},{id:"et",name:"Estonian",type:"tts"},{id:"fi",name:"Finnish",type:"tts"},{id:"fr",name:"French",type:"tts"},{id:"gu",name:"Gujarati",type:"tts"},{id:"hi",name:"Hindi",type:"tts"},{id:"hr",name:"Croatian",type:"tts"},{id:"hu",name:"Hungarian",type:"tts"},{id:"hy",name:"Armenian",type:"tts"},{id:"id",name:"Indonesian",type:"tts"},{id:"is",name:"Icelandic",type:"tts"},{id:"it",name:"Italian",type:"tts"},{id:"ja",name:"Japanese",type:"tts"},{id:"jw",name:"Javanese",type:"tts"},{id:"km",name:"Khmer",type:"tts"},{id:"kn",name:"Kannada",type:"tts"},{id:"ko",name:"Korean",type:"tts"},{id:"la",name:"Latin",type:"tts"},{id:"lv",name:"Latvian",type:"tts"},{id:"mk",name:"Macedonian",type:"tts"},{id:"ml",name:"Malayalam",type:"tts"},{id:"mr",name:"Marathi",type:"tts"},{id:"my",name:"Myanmar (Burmese)",type:"tts"},{id:"ne",name:"Nepali",type:"tts"},{id:"nl",name:"Dutch",type:"tts"},{id:"no",name:"Norwegian",type:"tts"},{id:"pl",name:"Polish",type:"tts"},{id:"pt",name:"Portuguese",type:"tts"},{id:"ro",name:"Romanian",type:"tts"},{id:"ru",name:"Russian",type:"tts"},{id:"si",name:"Sinhala",type:"tts"},{id:"sk",name:"Slovak",type:"tts"},{id:"sq",name:"Albanian",type:"tts"},{id:"sr",name:"Serbian",type:"tts"},{id:"su",name:"Sundanese",type:"tts"},{id:"sv",name:"Swedish",type:"tts"},{id:"sw",name:"Swahili",type:"tts"},{id:"ta",name:"Tamil",type:"tts"},{id:"te",name:"Telugu",type:"tts"},{id:"th",name:"Thai",type:"tts"},{id:"tl",name:"Filipino",type:"tts"},{id:"tr",name:"Turkish",type:"tts"},{id:"uk",name:"Ukrainian",type:"tts"},{id:"ur",name:"Urdu",type:"tts"},{id:"vi",name:"Vietnamese",type:"tts"},{id:"zh-CN",name:"Chinese (Simplified)",type:"tts"},{id:"zh-TW",name:"Chinese (Traditional)",type:"tts"}],P={alloy:{id:"alloy",name:"Alloy"},ash:{id:"ash",name:"Ash"},ballad:{id:"ballad",name:"Ballad"},cedar:{id:"cedar",name:"Cedar"},coral:{id:"coral",name:"Coral"},echo:{id:"echo",name:"Echo"},fable:{id:"fable",name:"Fable"},marin:{id:"marin",name:"Marin"},nova:{id:"nova",name:"Nova"},onyx:{id:"onyx",name:"Onyx"},sage:{id:"sage",name:"Sage"},shimmer:{id:"shimmer",name:"Shimmer"},verse:{id:"verse",name:"Verse"}},_=(...e)=>e.map(e=>({...P[e],type:"tts"})),A=_("alloy","ash","coral","echo","fable","nova","onyx","sage","shimmer"),E=_("alloy","ash","ballad","cedar","coral","echo","fable","marin","nova","onyx","sage","shimmer","verse"),I=["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"].map(e=>({id:e,name:e,type:"tts"})),R={openai:{models:[{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"tts-1",name:"TTS-1",type:"tts"}],voices:{"gpt-4o-mini-tts":E,"tts-1":A,"tts-1-hd":A},allVoices:E},openrouter:{models:[{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"openai/tts-1",name:"TTS-1",type:"tts"}],voices:{"openai/gpt-4o-mini-tts":E,"openai/tts-1":A,"openai/tts-1-hd":A},allVoices:E},elevenlabs:{models:[{id:"eleven_flash_v2_5",name:"Flash v2.5 (Fastest)",type:"tts"},{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Fast)",type:"tts"},{id:"eleven_multilingual_v2",name:"Multilingual v2 (Quality)",type:"tts"},{id:"eleven_monolingual_v1",name:"Monolingual v1 (English)",type:"tts"}]},"edge-tts":{defaults:[{id:"en-US-AriaNeural",name:"Aria (en-US)",type:"tts"},{id:"en-US-GuyNeural",name:"Guy (en-US)",type:"tts"},{id:"en-GB-SoniaNeural",name:"Sonia (en-GB)",type:"tts"},{id:"vi-VN-HoaiMyNeural",name:"Hoai My (vi-VN)",type:"tts"},{id:"vi-VN-NamMinhNeural",name:"Nam Minh (vi-VN)",type:"tts"},{id:"zh-CN-XiaoxiaoNeural",name:"Xiaoxiao (zh-CN)",type:"tts"},{id:"zh-CN-YunxiNeural",name:"Yunxi (zh-CN)",type:"tts"},{id:"fr-FR-DeniseNeural",name:"Denise (fr-FR)",type:"tts"},{id:"de-DE-KatjaNeural",name:"Katja (de-DE)",type:"tts"},{id:"ja-JP-NanamiNeural",name:"Nanami (ja-JP)",type:"tts"},{id:"ko-KR-SunHiNeural",name:"SunHi (ko-KR)",type:"tts"}]},"local-device":{defaults:[{id:"default",name:"System Default Voice",type:"tts"}]},"google-tts":{defaults:T},gemini:{models:[{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",type:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",type:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",type:"tts"}],voices:{"gemini-3.1-flash-tts-preview":I,"gemini-2.5-flash-preview-tts":I,"gemini-2.5-pro-preview-tts":I},allVoices:I}};function M(e,t){let a=R[e];return a?.voices&&(a.voices[t]||a.allVoices)||null}let O=`// Audio will appear here after running.
37
- // Example JSON response (response_format=json):
38
- {
39
- "format": "mp3",
40
- "audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
41
- }`;function K({providerId:e}){let t,a,r=(0,c.wG)(e),n=$[e]||$["edge-tts"],[i,d]=(0,l.useState)(n.defaultVoiceId||""),[m,p]=(0,l.useState)(""),[u,x]=(0,l.useState)(n.defaultVoiceId||""),[h,b]=(0,l.useState)([]),[g,v]=(0,l.useState)(""),[j,w]=(0,l.useState)(()=>{let t=c.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(n.hasModelSelector&&n.modelKey){let e=(0,f.KC)(n.modelKey);return e?.[0]?.id||""}return""}),[k,S]=(0,l.useState)("Hello, this is a text to speech test."),[C,P]=(0,l.useState)(""),[_,A]=(0,l.useState)(!1),[E,I]=(0,l.useState)(""),[R,L]=(0,l.useState)(""),[B,D]=(0,l.useState)("mp3"),[U,F]=(0,l.useState)(""),[V,z]=(0,l.useState)(null),[q,J]=(0,l.useState)(!1),[H,G]=(0,l.useState)(""),[W,Y]=(0,l.useState)(null),{copied:Z,copy:X}=(0,y.C)(),[Q,ee]=(0,l.useState)(!1),[et,ea]=(0,l.useState)([]),[es,er]=(0,l.useState)(!1),[en,ei]=(0,l.useState)(""),[el,eo]=(0,l.useState)(""),[ed,ec]=(0,l.useState)({}),[em,ep]=(0,l.useState)("");(0,l.useEffect)(()=>{if(I(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{P((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&L(e.publicUrl)}).catch(()=>{}),"hardcoded"===n.voiceSource){let t=n.hasModelSelector&&n.modelKey&&(0,f.KC)(n.modelKey)?.[0]?.id||"",a=n.voicesPerModel&&t?M(e,t)||[]:(0,f.KC)(n.voiceKey||e).filter(e=>"tts"===(0,f.CP)(e));if(a.length)if(n.hasBrowseButton){let e=a.find(e=>"en"===e.id)||a[0];v(e.id),d(e.id),p(e.name),b([{id:e.id,name:e.name}])}else b(a),d(a[0].id),p(a[0].name||a[0].id)}},[e]),(0,l.useEffect)(()=>{if(!n.voicesPerModel||!j)return;let t=M(e,j)||[];b(t),t.length&&(d(t[0].id),p(t[0].name||t[0].id))},[j]);let eu=async()=>{if(ee(!0),ei(""),eo(""),!et.length){er(!0);try{if("hardcoded"===n.voiceSource){let t=n.voiceKey||e,a=(0,f.KC)(t).filter(e=>"tts"===(0,f.CP)(e)),s={};for(let e of a)s[e.id]||(s[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});ec(s),ea(Object.values(s).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=n.apiEndpoint?n.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,a=await fetch(t),s=await a.json();if(s.error)return void eo(s.error);ea(s.languages||[]),ec(s.byLang||{})}}catch(e){eo(e.message)}finally{er(!1)}}},ex=en?et.filter(e=>e.name.toLowerCase().includes(en.toLowerCase())||e.code.toLowerCase().includes(en.toLowerCase())):et,eh=_?R:E,eb=n.hasVoiceIdInput&&u||i,eg=n.hasModelSelector&&j&&eb?`${r}/${j}/${eb}`:n.hasModelSelector&&j?`${r}/${j}`:eb?`${r}/${eb}`:"",ef=(t={model:eg,input:k},n.hasLanguageHint&&em&&(t.language=em),t),ey=`curl -X POST ${eh}/v1/audio/speech${"json"===B?"?response_format=json":""} \\
42
- -H "Content-Type: application/json" \\
43
- -H "Authorization: Bearer ${C||"YOUR_KEY"}" \\
44
- -d '${JSON.stringify(ef)}' \\
45
- ${"json"===B?"":"--output speech.mp3"}`,ev=async()=>{if(!k.trim()||!eg)return;J(!0),G(""),F(""),z(null);let e=Date.now();try{let t={"Content-Type":"application/json"};C&&(t.Authorization=`Bearer ${C}`);let a=`/api/v1/audio/speech${"json"===B?"?response_format=json":""}`,s=await fetch(a,{method:"POST",headers:t,body:JSON.stringify({...ef,input:k.trim()})});if(Y(Date.now()-e),!s.ok){let e=await s.json().catch(()=>({}));G(e?.error?.message||e?.error||`HTTP ${s.status}`);return}if("json"===B){let e=await s.json();z(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());F(URL.createObjectURL(t))}else{let e=await s.blob();F(URL.createObjectURL(e))}}catch(e){G(e.message||"Network error")}finally{J(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(N,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[eh,"/v1/audio/speech"]}),R&&(0,s.jsxs)("button",{onClick:()=>A(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(N,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:C?`${C.slice(0,8)}${"•".repeat(Math.min(20,C.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),n.hasModelSelector&&(n.modelKey||(0,f.KC)(e).some(e=>"tts"===(0,f.CP)(e)))&&(0,s.jsx)(N,{label:"Model",children:(0,s.jsx)("select",{value:j,onChange:e=>w(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e))).length?a:(0,f.KC)(n.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),n.hasLanguageHint&&(0,s.jsx)(N,{label:"Language",children:(0,s.jsxs)("select",{value:em,onChange:e=>ep(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),T.map(e=>(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),n.hasBrowseButton&&(0,s.jsx)(N,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:eu,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:g?(0,s.jsx)("span",{className:"text-text-main",children:et.find(e=>e.code===g)?.name||g}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:eu,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,s.jsx)(N,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>{d(e.id),p(e.name),n.hasVoiceIdInput&&x(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${i===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),n.hasVoiceIdInput&&(0,s.jsx)(N,{label:"Voice ID",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:u,onChange:e=>{x(e.target.value),d(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),u&&(0,s.jsx)("button",{type:"button",onClick:()=>{x(""),d("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),n.hasLanguageDropdown&&(0,s.jsx)(N,{label:"Language",children:(0,s.jsx)("select",{value:i,onChange:t=>{let a=(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e)).find(e=>e.id===t.target.value);d(t.target.value),p(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(N,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:k,onChange:e=>S(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),k&&(0,s.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)(N,{label:"Output Format",children:(0,s.jsxs)("select",{value:B,onChange:e=>D(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>X(ey),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:Z?"check":"content_copy"}),Z?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:ev,disabled:q||!k.trim()||!eg,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:q?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),q?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ey})]}),H&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:H}),U?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",W&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",W,"ms"]})]}),(0,s.jsxs)("a",{href:U,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{controls:!0,src:U,className:"w-full"}),V&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:V.format,audio:V.audio?`${V.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:O})]})]})]}),Q&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>ee(!1),children:(0,s.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>ee(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,value:en,onChange:e=>ei(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[el&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:el}),es?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ex.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return ee(!1),v(e.code),void(b(t=ed[e.code]?.voices||[]),t.length&&(d(t[0].id),p(t[0].name),n.hasVoiceIdInput&&x(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${g===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),g===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ex.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let L="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function B(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function D({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a)===e?a:e,n=c.rj.find(e=>e.id===t),i=k[t],d=i||{},m=(0,f.KC)(e).filter(e=>(0,f.CP)(e)===t),p=new Set(["image","video","music","imageToText"]).has(t),u=p&&0===m.length,[x,h]=(0,l.useState)(m[0]?.id??""),b=m.find(e=>e.id===x),g=!!b?.capabilities?.includes("edit"),v=!!b?.capabilities?.includes("mask"),[j,w]=(0,l.useState)(d.defaultInput||""),[S,C]=(0,l.useState)(""),[$,T]=(0,l.useState)(""),[P,_]=(0,l.useState)(()=>(d.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[A,E]=(0,l.useState)(""),[I,R]=(0,l.useState)(!1),[M,O]=(0,l.useState)(""),[K,U]=(0,l.useState)(""),[F,V]=(0,l.useState)(null),[z,q]=(0,l.useState)(null),[J,H]=(0,l.useState)(null),[G,W]=(0,l.useState)("json"),[Y,Z]=(0,l.useState)(""),[X,Q]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(""),[ea,es]=(0,l.useState)([]),[er,en]=(0,l.useState)(""),{copied:ei,copy:el}=(0,y.C)(),{copied:eo,copy:ed}=(0,y.C)();if((0,l.useEffect)(()=>{O(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{E((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&U(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{es((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!n||!i)return null;let ec=I?K:M,em=n.endpoint.path,ep=p?x?`${r}/${x}`:u?"":r:r,eu="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===x?{image:L}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:L,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ex=S.trim()||eu.image||"",eh=$.trim()||eu.mask_image||"",eb=B(ex),eg=B(eh),ef=Object.entries(P).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),ey={model:ep,[i.bodyKey]:j,...i.extraBody,...ef,...g&&ex?{image:ex}:{},...v&&eh?{mask_image:eh}:{}},ev="image"===t&&"binary"===G,ej="image"===t&&"codex"===e&&!ev,ew=`${em}${ev?"?response_format=binary":""}`,eN=`-H "Content-Type: application/json" \\
46
- -H "Authorization: Bearer ${A||"YOUR_KEY"}"${er?` \\
47
- -H "x-connection-id: ${er}"`:""}${ej?` \\
48
- -H "Accept: text/event-stream"`:""}`,ek=`curl -X ${n.endpoint.method} ${ec}${ew} \\
49
- ${eN.replace(/\\\n /g,"\\\n ")} \\
50
- -d '${JSON.stringify(ey)}'${ev?" \\\n --output image.png":""}`,eS=async()=>{if(!j.trim()||!ep)return;if(Q(!0),et(""),V(null),q(null),H(null),Y){try{URL.revokeObjectURL(Y)}catch{}Z("")}let e=Date.now();try{let t={"Content-Type":"application/json"};A&&(t.Authorization=`Bearer ${A}`),er&&(t["x-connection-id"]=er),ej&&(t.Accept="text/event-stream");let a={...ey,model:ep},s=await fetch(`/api${ew}`,{method:n.endpoint.method,headers:t,body:JSON.stringify(a)});if(!s.ok){let e=await s.json().catch(()=>({}));et(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let r=s.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await s.blob(),a=URL.createObjectURL(t);Z(a),V({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&s.body){let t=s.body.getReader(),a=new TextDecoder,r="",n=null,i=null;for(;;){let e,{done:s,value:l}=await t.read();if(s)break;for(r+=a.decode(l,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let a=null,s="";for(let e of t.split("\n"))e.startsWith("event:")?a=e.slice(6).trim():e.startsWith("data:")&&(s+=e.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?q(e):"partial_image"===a?H(e):"done"===a?n=e:"error"===a&&(i=e?.message||"Stream error")}catch{}}}let l=Date.now()-e;if(i)return void et(i);n&&V({data:n,latencyMs:l})}else{let t=await s.json(),a=Date.now()-e;V({data:t,latencyMs:a})}}catch(e){et(e.message||"Network error")}finally{Q(!1)}},eC=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eC);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:eC(s);return t},e$=F?JSON.stringify(eC(F.data),null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,s.jsx)(N,{label:"Model",children:(0,s.jsx)("select",{value:x,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):u?(0,s.jsx)(N,{label:"Model",children:(0,s.jsx)("input",{value:x,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)(N,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ec,em]}),K&&(0,s.jsxs)("button",{onClick:()=>R(e=>!e),title:I?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${I?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(N,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:A?`${A.slice(0,8)}${"•".repeat(Math.min(20,A.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),ea.length>0&&(0,s.jsx)(N,{label:"Connection",children:(0,s.jsxs)("select",{value:er,onChange:e=>en(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),ea.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)(N,{label:i.inputLabel,children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:j,onChange:e=>w(e.target.value),placeholder:i.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),j&&(0,s.jsx)("button",{type:"button",onClick:()=>w(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),g&&(0,s.jsx)(N,{label:"Ref Image (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:S,onChange:e=>C(e.target.value),placeholder:eu.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),S&&(0,s.jsx)("button",{type:"button",onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eb&&(0,s.jsx)("img",{src:eb,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),v&&(0,s.jsx)(N,{label:"Mask (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:$,onChange:e=>T(e.target.value),placeholder:eu.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),$&&(0,s.jsx)("button",{type:"button",onClick:()=>T(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eg&&(0,s.jsx)("img",{src:eg,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(i.extraFields||[]).filter(e=>0===m.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,s.jsx)(N,{label:e.label,children:"select"===e.type?(0,s.jsx)("select",{value:P[e.key]??"",onChange:t=>_(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{type:"text",value:P[e.key]??"",placeholder:e.placeholder,onChange:t=>_(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{type:"number",value:P[e.key]??"",min:e.min,max:e.max,onChange:t=>_(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)(N,{label:"Output Format",children:(0,s.jsxs)("select",{value:G,onChange:e=>W(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>el(ek),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ei?"check":"content_copy"}),ei?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eS,disabled:X||!j.trim()||!ep,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:X?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),X?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ek})]}),(X||z)&&ej&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:X?{animation:"spin 1s linear infinite"}:void 0,children:X?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[z?.stage||"starting",!X&&z?.bytesReceived?` \xb7 ${(z.bytesReceived/1024).toFixed(1)} KB`:""]})]}),J?.b64_json&&!F&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)("img",{src:`data:image/png;base64,${J.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),ee&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:ee}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",F&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",F.latencyMs,"ms"]})]}),F&&(0,s.jsxs)("button",{onClick:()=>ed(e$),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eo?"check":"content_copy"}),eo?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:F?e$:i.defaultResponse}),"image"===t&&(Y||F?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:Y||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("img",{src:Y||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function U({providerId:e}){let t=(0,c.wG)(e),a=(0,f.KC)(e).filter(e=>"stt"===(0,f.CP)(e)),[r,n]=(0,l.useState)([]),i=[...a,...r],[d,m]=(0,l.useState)(a[0]?.id??""),p=i.find(e=>e.id===d),u=Array.isArray(p?.params)?p.params:[],[x,h]=(0,l.useState)(null),[b,g]=(0,l.useState)(""),[v,j]=(0,l.useState)(""),[w,k]=(0,l.useState)("json"),[S,C]=(0,l.useState)(""),[$,T]=(0,l.useState)(""),[P,_]=(0,l.useState)(!1),[A,E]=(0,l.useState)(""),[I,R]=(0,l.useState)(""),[M,O]=(0,l.useState)(null),[K,L]=(0,l.useState)(null),[B,D]=(0,l.useState)(!1),[F,V]=(0,l.useState)(""),{copied:z,copy:q}=(0,y.C)(),{copied:J,copy:H}=(0,y.C)();(0,l.useEffect)(()=>{E(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{T((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&R(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{n((e.models||[]).filter(e=>"stt"===(0,f.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let G=P?I:A,W=d?`${t}/${d}`:"",Y=`curl -X POST ${G}/v1/audio/transcriptions \\
51
- -H "Authorization: Bearer ${$||"YOUR_KEY"}" \\
52
- -F "file=@${x?.name||"audio.mp3"}" \\
53
- -F "model=${W}"${u.includes("language")&&b?` \\
54
- -F "language=${b}"`:""}${u.includes("response_format")?` \\
55
- -F "response_format=${w}"`:""}${u.includes("temperature")&&S?` \\
56
- -F "temperature=${S}"`:""}${u.includes("prompt")&&v?` \\
57
- -F "prompt=${v}"`:""}`,Z=async()=>{if(!x||!W)return;D(!0),V(""),O(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",W),u.includes("language")&&b&&t.append("language",b),u.includes("response_format")&&t.append("response_format",w),u.includes("temperature")&&S&&t.append("temperature",S),u.includes("prompt")&&v&&t.append("prompt",v);let a={};$&&(a.Authorization=`Bearer ${$}`);let s=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:a,body:t});L(Date.now()-e);let r=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();if(!s.ok)return void V(r?.error?.message||r?.error||r||`HTTP ${s.status}`);O(r)}catch(e){V(e.message||"Network error")}finally{D(!1)}},X="string"==typeof M?M:M?JSON.stringify(M,null,2):`{
58
- "text": "Hello world..."
59
- }`;return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[i.length>0?(0,s.jsx)(N,{label:"Model",children:(0,s.jsx)("select",{value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:i.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)(N,{label:"Model",children:(0,s.jsx)("input",{value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(N,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[G,"/v1/audio/transcriptions"]}),I&&(0,s.jsxs)("button",{onClick:()=>_(e=>!e),title:P?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${P?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(N,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,s.jsx)(N,{label:"Audio File",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),u.includes("language")&&(0,s.jsx)(N,{label:"Language",children:(0,s.jsx)("input",{value:b,onChange:e=>g(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),u.includes("prompt")&&(0,s.jsx)(N,{label:"Prompt",children:(0,s.jsx)("input",{value:v,onChange:e=>j(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),u.includes("temperature")&&(0,s.jsx)(N,{label:"Temperature",children:(0,s.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:S,onChange:e=>C(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),u.includes("response_format")&&(0,s.jsx)(N,{label:"Response Format",children:(0,s.jsxs)("select",{value:w,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>q(Y),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:z?"check":"content_copy"}),z?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:Z,disabled:B||!x||!W,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:B?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),B?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:Y})]}),F&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",M&&K&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",K,"ms"]})]}),M&&(0,s.jsxs)("button",{onClick:()=>H(X),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:X})]})]})]})}function F(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),n=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,p=async()=>{if(confirm("Delete this Custom Embedding node?"))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&a.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[u,x]=(0,l.useState)(null),[h,b]=(0,l.useState)(m),[f,y]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(x((a.nodes||[]).find(e=>e.id===t)||null),b(!1))}).catch(()=>{e||b(!1)}),()=>{e=!0}},[t,m]),!n)return(0,r.notFound)();let v=c.Q2[t],j=m?u?{id:t,name:u.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!h&&!u)return(0,r.notFound)();if(m&&h)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let N=m?["embedding"]:j.serviceKinds??["llm"];return m||N.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(i(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),n.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${j.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${j.id}.png`,alt:j.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:j.textIcon||j.id.slice(0,2).toUpperCase(),fallbackColor:j.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:j.name}),!m&&j.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:j.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[m&&(0,s.jsxs)(o.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",u?.prefix]}),N.map(t=>(0,s.jsx)(o.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),m&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:p,children:"Delete"})]})]})]}),!m&&j.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:j.kindNotice[e]})]}),!m&&j.notice?.text&&!j.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:j.notice.text}),j.notice.apiKeyUrl&&(0,s.jsx)("a",{href:j.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 →"})]}),!m&&j.noAuth?(0,s.jsx)(o.gw,{providerId:t}):(0,s.jsx)(g,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)(w,{providerId:t,kindFilter:e,providerAliasOverride:m?u?.prefix:void 0}),!m&&(j.searchConfig||j.fetchConfig||j.ttsConfig||j.sttConfig||j.embeddingConfig||j.searchViaChat)&&(0,s.jsx)(o.Wx,{config:"webFetch"===e?j.fetchConfig:"tts"===e?j.ttsConfig:"stt"===e?j.sttConfig:"embedding"===e?j.embeddingConfig:j.searchConfig||{mode:"chat-completions",defaultModel:j.searchViaChat?.defaultModel,pricingUrl:j.searchViaChat?.pricingUrl,freeTier:j.searchViaChat?.freeTier},provider:j,title:`${n.label} Config`}),"embedding"===e&&(0,s.jsx)(C,{providerId:t,customAlias:u?.prefix}),"tts"===e&&(0,s.jsx)(K,{providerId:t}),"stt"===e&&!m&&(0,s.jsx)(U,{providerId:t}),!m&&k[e]&&(0,s.jsx)(D,{providerId:t,kind:e}),m&&(0,s.jsx)(o.x0,{isOpen:f,node:u,onClose:()=>y(!1),onSaved:e=>{x(e),y(!1)}})]}):(0,r.notFound)()}}},e=>{e.O(0,[2574,3862,817,5280,1321,705,5497,8441,3794,7358],()=>e(e.s=53836)),_N_E=e.O()}]);