9router-proxy 0.5.82 → 0.5.83

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 (774) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +27 -27
  5. package/app/.next-cli-build/required-server-files.json +5 -5
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  76. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  88. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  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 +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route_client-reference-manifest.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/start/route_client-reference-manifest.js +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/test/route_client-reference-manifest.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/reset-password/route_client-reference-manifest.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/saml/acs/route_client-reference-manifest.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route_client-reference-manifest.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/saml/start/route_client-reference-manifest.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/saml/test/route_client-reference-manifest.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/status/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  125. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route_client-reference-manifest.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  128. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  137. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route_client-reference-manifest.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  155. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route_client-reference-manifest.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route_client-reference-manifest.js +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route_client-reference-manifest.js +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  167. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route_client-reference-manifest.js +1 -1
  169. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  170. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route_client-reference-manifest.js +1 -1
  172. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  173. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  175. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  176. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  178. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  179. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  181. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  184. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/combos/route_client-reference-manifest.js +1 -1
  187. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/headroom/extras/route_client-reference-manifest.js +1 -1
  190. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route_client-reference-manifest.js +1 -1
  193. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/headroom/restart/route_client-reference-manifest.js +1 -1
  196. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/headroom/start/route_client-reference-manifest.js +1 -1
  199. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/headroom/status/route_client-reference-manifest.js +1 -1
  202. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/headroom/stop/route_client-reference-manifest.js +1 -1
  205. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/health/route_client-reference-manifest.js +1 -1
  208. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/init/route_client-reference-manifest.js +1 -1
  211. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  214. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/keys/route_client-reference-manifest.js +1 -1
  217. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/locale/route_client-reference-manifest.js +1 -1
  220. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route_client-reference-manifest.js +1 -1
  223. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  224. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route_client-reference-manifest.js +1 -1
  226. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route_client-reference-manifest.js +1 -1
  229. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route_client-reference-manifest.js +1 -1
  232. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route_client-reference-manifest.js +1 -1
  235. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route_client-reference-manifest.js +1 -1
  238. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route_client-reference-manifest.js +1 -1
  241. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  244. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  247. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/models/catalog-sync/route_client-reference-manifest.js +1 -1
  250. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/models/custom/route_client-reference-manifest.js +1 -1
  253. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/models/disabled/route_client-reference-manifest.js +1 -1
  256. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/models/route_client-reference-manifest.js +1 -1
  259. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route_client-reference-manifest.js +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route_client-reference-manifest.js +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  274. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  277. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route_client-reference-manifest.js +1 -1
  280. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route_client-reference-manifest.js +1 -1
  283. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
  286. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route_client-reference-manifest.js +1 -1
  289. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  292. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  295. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route_client-reference-manifest.js +1 -1
  298. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  301. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  304. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route_client-reference-manifest.js +1 -1
  307. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  308. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route_client-reference-manifest.js +1 -1
  310. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  313. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  316. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  319. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  337. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route_client-reference-manifest.js +1 -1
  340. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/providers/route_client-reference-manifest.js +1 -1
  343. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/providers/suggested-models/route_client-reference-manifest.js +1 -1
  346. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  349. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  352. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route_client-reference-manifest.js +1 -1
  355. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route_client-reference-manifest.js +1 -1
  358. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  359. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route_client-reference-manifest.js +1 -1
  361. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  362. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route_client-reference-manifest.js +1 -1
  364. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/proxy-pools/route_client-reference-manifest.js +1 -1
  367. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  368. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route_client-reference-manifest.js +1 -1
  370. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  371. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/pxpipe/health/route_client-reference-manifest.js +1 -1
  373. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  374. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/pxpipe/install/route_client-reference-manifest.js +1 -1
  376. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/pxpipe/logs/route_client-reference-manifest.js +1 -1
  379. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  380. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/pxpipe/restart/route_client-reference-manifest.js +1 -1
  382. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  383. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/pxpipe/start/route_client-reference-manifest.js +1 -1
  385. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  386. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/pxpipe/stats/route_client-reference-manifest.js +1 -1
  388. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  389. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/pxpipe/status/route_client-reference-manifest.js +1 -1
  391. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  392. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/pxpipe/stop/route_client-reference-manifest.js +1 -1
  394. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  397. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  400. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  403. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/settings/route_client-reference-manifest.js +1 -1
  406. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  409. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/tags/route_client-reference-manifest.js +1 -1
  412. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  415. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  418. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  421. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  424. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  427. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  430. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  431. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  433. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  436. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  437. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  439. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route_client-reference-manifest.js +1 -1
  442. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  443. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  444. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route_client-reference-manifest.js +1 -1
  445. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  446. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  447. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route_client-reference-manifest.js +1 -1
  448. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  449. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route_client-reference-manifest.js +1 -1
  451. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  452. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  453. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route_client-reference-manifest.js +1 -1
  454. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  455. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  456. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  457. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  458. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  460. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  461. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  462. package/app/.next-cli-build/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  463. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  464. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  465. package/app/.next-cli-build/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  466. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  467. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  468. package/app/.next-cli-build/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  469. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  472. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  473. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  475. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  476. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
  478. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  479. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  481. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  482. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  484. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  485. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  486. package/app/.next-cli-build/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  487. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  488. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  489. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  490. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  491. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -1
  493. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  494. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  496. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  497. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  498. package/app/.next-cli-build/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  499. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  500. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  501. package/app/.next-cli-build/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  502. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  503. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  504. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  505. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  506. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  507. package/app/.next-cli-build/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  508. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  509. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  510. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route_client-reference-manifest.js +1 -1
  511. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  512. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  513. package/app/.next-cli-build/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -1
  514. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  515. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  516. package/app/.next-cli-build/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  517. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  518. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  519. package/app/.next-cli-build/server/app/api/v1/responses/compact/route_client-reference-manifest.js +1 -1
  520. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  521. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  522. package/app/.next-cli-build/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  523. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  524. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  525. package/app/.next-cli-build/server/app/api/v1/route_client-reference-manifest.js +1 -1
  526. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  527. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  528. package/app/.next-cli-build/server/app/api/v1/search/route_client-reference-manifest.js +1 -1
  529. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  530. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  531. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route_client-reference-manifest.js +1 -1
  532. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  533. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  534. package/app/.next-cli-build/server/app/api/v1/videos/edits/route_client-reference-manifest.js +1 -1
  535. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  536. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  537. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route_client-reference-manifest.js +1 -1
  538. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  539. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  540. package/app/.next-cli-build/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
  541. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  542. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  543. package/app/.next-cli-build/server/app/api/v1/web/fetch/route_client-reference-manifest.js +1 -1
  544. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  545. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  546. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  547. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  548. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  549. package/app/.next-cli-build/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  550. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  551. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  552. package/app/.next-cli-build/server/app/api/version/route_client-reference-manifest.js +1 -1
  553. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  554. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  555. package/app/.next-cli-build/server/app/api/version/shutdown/route_client-reference-manifest.js +1 -1
  556. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  557. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  558. package/app/.next-cli-build/server/app/api/version/update/route_client-reference-manifest.js +1 -1
  559. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  560. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  561. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  562. package/app/.next-cli-build/server/app/callback.html +1 -1
  563. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  564. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  565. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  567. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  568. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  569. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  570. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  571. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  573. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  574. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  575. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  576. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  578. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  579. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  580. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  581. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  582. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  583. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  584. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  585. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  586. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  588. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  589. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  590. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  591. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  592. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  593. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  594. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  595. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  596. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  597. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  598. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  599. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  600. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  601. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  602. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  603. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  604. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  605. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  606. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  607. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  608. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  609. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  610. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  611. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  612. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  613. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  614. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  615. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  616. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  617. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  618. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  619. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  620. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  621. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  622. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  623. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  624. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  625. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  626. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  627. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  628. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  629. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  630. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  631. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  632. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  633. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  634. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  635. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  636. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  637. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  638. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  639. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  640. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  641. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  642. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  643. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  644. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  645. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  646. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  647. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  648. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  649. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  650. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  651. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  652. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  653. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  654. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  655. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  656. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  657. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  658. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  659. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  660. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  661. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  662. package/app/.next-cli-build/server/app/index.html +1 -1
  663. package/app/.next-cli-build/server/app/index.rsc +4 -4
  664. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  665. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  666. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  667. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  668. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  669. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  670. package/app/.next-cli-build/server/app/landing.html +1 -1
  671. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  672. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  673. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  674. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  675. package/app/.next-cli-build/server/app/login/page.js +1 -1
  676. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  677. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  678. package/app/.next-cli-build/server/app/login.html +1 -1
  679. package/app/.next-cli-build/server/app/login.rsc +5 -5
  680. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  681. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  682. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  683. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  684. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  685. package/app/.next-cli-build/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  686. package/app/.next-cli-build/server/app/page.js +1 -1
  687. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  688. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  689. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  690. package/app/.next-cli-build/server/chunks/1220.js +1 -1
  691. package/app/.next-cli-build/server/chunks/1478.js +1 -1
  692. package/app/.next-cli-build/server/chunks/2214.js +3 -0
  693. package/app/.next-cli-build/server/chunks/2430.js +4 -4
  694. package/app/.next-cli-build/server/chunks/2751.js +1 -0
  695. package/app/.next-cli-build/server/chunks/2870.js +1 -0
  696. package/app/.next-cli-build/server/chunks/3459.js +1 -1
  697. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  698. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  699. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  700. package/app/.next-cli-build/server/chunks/4572.js +1 -1
  701. package/app/.next-cli-build/server/chunks/4730.js +1 -1
  702. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  703. package/app/.next-cli-build/server/chunks/869.js +1 -1
  704. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  705. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  706. package/app/.next-cli-build/server/middleware.js +3 -3
  707. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  708. package/app/.next-cli-build/server/next-font-manifest.js +1 -1
  709. package/app/.next-cli-build/server/next-font-manifest.json +1 -1
  710. package/app/.next-cli-build/server/pages/404.html +1 -1
  711. package/app/.next-cli-build/server/pages/500.html +1 -1
  712. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  713. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  714. package/app/.next-cli-build/static/chunks/{1321-91f49ecab7e31497.js → 1321-338ffabac587d51a.js} +1 -1
  715. package/app/.next-cli-build/static/chunks/809-c530a61052bf57d9.js +3 -0
  716. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-6d5c472d92ad4d7b.js → page-bf62957e6bf0c9b6.js} +1 -1
  717. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-aedc4da9b1e64ba1.js → page-e9094f6397e3db32.js} +1 -1
  718. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-6d9baf555ca7e1a9.js → page-49227e9571ca75ee.js} +1 -1
  719. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-f16f14e3708413c6.js → page-22d499936f64e70d.js} +1 -1
  720. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-fc64937433e2052b.js → page-5ce7e708e65d7ed2.js} +1 -1
  721. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-cf249feaa9108a4e.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-634c7c6009db3c9a.js → page-452f4c039beb1ff0.js} +2 -2
  723. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-fe79c701b0256560.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-b97c67f4e942cd35.js → page-c20828e9f181b48c.js} +1 -1
  725. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-6b5e415f16f2015e.js → page-1eaf569d16f5fc95.js} +1 -1
  726. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-f5773f327357e5c0.js → page-991110e90ac5b7ca.js} +1 -1
  727. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-b52bdd6de15807fc.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-60112f6b6217c23d.js → page-1707a43605025629.js} +1 -1
  729. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-61c471f2f094e671.js → page-a1a8249b040b3fc5.js} +1 -1
  730. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-b74f96b9d4217a63.js → page-378e16c550d6670d.js} +1 -1
  731. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-534cf66a5d57f5da.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-74f7c8a6eae89546.js → page-9afa902610df6eda.js} +2 -2
  733. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-50ca788a79bff514.js → page-930edc3414aefb99.js} +1 -1
  734. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f3e8f3d109886a92.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-a30b31b2fab6e55f.js → page-ff4999c854469b73.js} +1 -1
  736. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-a5ed9cd2ec340299.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-6e1bf9615b110473.js → page-074f26128db0c704.js} +1 -1
  738. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-a802ce8ca6fa34c3.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-235aa653589384de.js → layout-1e553b4323bf7053.js} +1 -1
  740. package/app/.next-cli-build/static/chunks/app/_not-found/page-9cb0ac70ab60eba2.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/callback/page-ee5f77ef69dd466f.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-363940edf26f7293.js → page-afccf4209692aa6f.js} +1 -1
  743. package/app/.next-cli-build/static/chunks/app/landing/{page-258585580e004f81.js → page-0185c25e389af607.js} +1 -1
  744. package/app/.next-cli-build/static/chunks/app/layout-00c8624593ca90e2.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/login/{page-f028d26bd6d12748.js → page-c72141d109a846b7.js} +1 -1
  746. package/app/.next-cli-build/static/chunks/main-app-6b83f9262ea4869d.js +1 -0
  747. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-fc979617952f596f.js +1 -0
  748. package/app/package.json +1 -1
  749. package/app/server.js +1 -1
  750. package/package.json +2 -2
  751. package/app/.next-cli-build/server/chunks/3332.js +0 -1
  752. package/app/.next-cli-build/server/chunks/3956.js +0 -3
  753. package/app/.next-cli-build/server/chunks/9667.js +0 -1
  754. package/app/.next-cli-build/static/chunks/9246-3416a4e77c91f76c.js +0 -3
  755. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-bb4b4646897cd2e7.js +0 -1
  756. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-c613f178fca0d7cb.js +0 -1
  757. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-334ec5a4985a3bb1.js +0 -1
  758. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-6cbb5af377c79574.js +0 -1
  759. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-8a4858aa4d4c0d42.js +0 -1
  760. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-14c66e5844bef120.js +0 -1
  761. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-88424527e5a39243.js +0 -1
  762. package/app/.next-cli-build/static/chunks/app/_not-found/page-5b9d4fc0a96993f8.js +0 -1
  763. package/app/.next-cli-build/static/chunks/app/callback/page-4ab401c9515d534f.js +0 -1
  764. package/app/.next-cli-build/static/chunks/app/layout-0afb71a399c4e37f.js +0 -1
  765. package/app/.next-cli-build/static/chunks/main-app-f80e368a7022c830.js +0 -1
  766. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-a07eb5f6e9f351cd.js +0 -1
  767. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  768. package/app/cli/.build-home/.9router/db/data.sqlite-shm +0 -0
  769. package/app/cli/.build-home/.9router/db/data.sqlite-wal +0 -0
  770. package/app/cli/.build-home/.9router/jwt-secret +0 -1
  771. package/app/cli/.build-home/.9router/machine-id +0 -1
  772. package/app/cli/.build-home/Library/Preferences/nextjs-nodejs/config.json +0 -7
  773. /package/app/.next-cli-build/static/{k0r09uWkmSpifXbwK-mnO → 3C7TjBE-6n_cSjwJbMKkM}/_buildManifest.js +0 -0
  774. /package/app/.next-cli-build/static/{k0r09uWkmSpifXbwK-mnO → 3C7TjBE-6n_cSjwJbMKkM}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[809],{809:(e,t,s)=>{Promise.resolve().then(s.bind(s,20242))},15536:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>r,Hx:()=>n,Iv:()=>d,Nv:()=>u,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>a,oX:()=>l,t6:()=>o});let a=["zh-CN","zh-TW"],l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],n=2e3,r=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],u=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},20242:(e,t,s)=>{"use strict";s.d(t,{default:()=>y});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059),c=s(15536);async function d(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(c.Iv)})).ok}catch{return!1}}async function m(...e){let t=e.filter(Boolean).map(d);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}function u({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function x({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function h({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function p({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}function y({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[b,g]=(0,l.useState)(!1),[f,j]=(0,l.useState)(""),[k,w]=(0,l.useState)(null),[v,N]=(0,l.useState)(null),[C,S]=(0,l.useState)(!1),[T,P]=(0,l.useState)(!0),[_,E]=(0,l.useState)(!0),[$,A]=(0,l.useState)(!1),[I,O]=(0,l.useState)(!0),[U,D]=(0,l.useState)(!1),[F,R]=(0,l.useState)(!1),[L,W]=(0,l.useState)(""),[q,K]=(0,l.useState)(""),[z,H]=(0,l.useState)(!1),[J,B]=(0,l.useState)(""),[M,Q]=(0,l.useState)(null),[X,Z]=(0,l.useState)(!1),[G,V]=(0,l.useState)(!1),[Y,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(""),[en,er]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)(null),[em,eu]=(0,l.useState)(""),[ex,eh]=(0,l.useState)(""),[ep,ey]=(0,l.useState)(null),[eb,eg]=(0,l.useState)(!1),[ef,ej]=(0,l.useState)([]),[ek,ew]=(0,l.useState)(""),[ev,eN]=(0,l.useState)(!1),[eC,eS]=(0,l.useState)(!1),[eT,eP]=(0,l.useState)(!1),e_=(0,l.useRef)(null),eE=(0,l.useRef)(0),e$=(0,l.useRef)(0),eA=(0,l.useRef)(!1),eI=(0,l.useRef)(!1),eO=(0,l.useRef)(!1),eU=(0,l.useRef)(!1),[eD,eF]=(0,l.useState)(!1),[eR,eL]=(0,l.useState)(!1),[eW,eq]=(0,l.useState)(new Set),[eK,ez]=(0,l.useState)(!1);(0,l.useEffect)(()=>{ez(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]);let{copied:eH,copy:eJ}=(0,o.C)(),eB=!T||!_,eM=T?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{e_.current&&(e_.current.scrollTop=e_.current.scrollHeight)},[ef]),(0,l.useEffect)(()=>{eY(),eZ()},[]),(0,l.useEffect)(()=>{if(!(U||Y))return;let e=!U||F,t=!Y||et,s=()=>{document.hidden||eX()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||eX()},c.fl);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[U,Y,F,et]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(U&&(L||q)){let e=await m(q,L);eA.current=e,e?(eE.current=0,R(!0),eO.current||(eO.current=!0,eF(!0))):(eE.current+=1,eE.current>=c.t6&&R(!1))}else eA.current=!1;if(Y&&ea){let e=await d(ea);eI.current=e,e?(e$.current=0,es(!0),eU.current||(eU.current=!0,eL(!0))):(e$.current+=1,e$.current>=c.t6&&es(!1))}else eI.current=!1}};if(!(U&&(L||q)||Y&&ea))return;e();let t=!Y||et;if((!U||F)&&t)return;let s=setInterval(e,c.RL);return()=>clearInterval(s)},[U,L,q,Y,ea,F,et]);let eQ=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=c.t6&&a(!1))},[]),eX=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";W(a),K(t.tunnel?.publicUrl||""),D(s),eQ(null,eA,eE,R,eO,eF);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";el(n),ee(l),eQ(null,eI,e$,es,eU,eL)}catch{}},eZ=async()=>{O(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();S(t.requireApiKey||!1),P(!1!==t.requireLogin),E(t.hasPassword||!1),A(t.tunnelDashboardAccess||!1)}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";W(a),K(e.tunnel?.publicUrl||""),D(s),eQ(null,eA,eE,R,eO,eF);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";el(n),ee(l),eQ(null,eI,e$,es,eU,eL)}}catch(e){console.log("Error loading settings:",e)}finally{O(!1)}},eG=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&A(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eV=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&S(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eY=async()=>{try{let e=async()=>{let e=await fetch("/api/keys");return e.ok&&(await e.json()).keys||[]},t=await e();if(0===t.length)try{(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok&&(t=await e())}catch{}s(t)}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},e0=async(...e)=>{H(!0),B("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<c.Cp;){if(await new Promise(e=>setTimeout(e,c.Hx)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return D(!0),H(!1),B(""),!0;if((Date.now()-s)%1e4<c.Hx)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return Q({type:"error",message:"Tunnel process stopped unexpectedly."}),H(!1),B(""),!1}}catch{}}return Q({type:"error",message:"Tunnel created but not reachable. Please try again."}),H(!1),B(""),!1},e1=async()=>{Z(!1),H(!0),Q(null),B("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?B(`Downloading cloudflared... ${s.download.progress}%`):e&&B("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void Q({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void Q({type:"error",message:"No tunnel URL returned"});W(a),K(s.publicUrl||""),await e0(s.publicUrl,a)}catch(e){Q({type:"error",message:e.message})}finally{e=!1,H(!1),B("")}},e5=async()=>{H(!0),Q(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(D(!1),W(""),V(!1),Q({type:"success",message:"Tunnel disabled"})):Q({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){Q({type:"error",message:e.message})}finally{H(!1)}},e2=async()=>{ey(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return ey(t.installed),t}}catch{}return ey(!1),{installed:!1}},e4=async()=>{eg(!0),ed(null),ej([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:ek})});ew("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ej(e=>[...e.slice(-50),a.message]);else if("done"===s){ey(!0),eg(!1),eS(!1),e9();return}else"error"===s&&ed({type:"error",message:a.error||"Install failed"})}}}catch(e){ed({type:"error",message:e.message})}finally{eg(!1)}},e3=async e=>{eo("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<c.Cp;){await new Promise(e=>setTimeout(e,c.Hx));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},e8=(e,t)=>{eu(e),eh(t)},e6=()=>{eu(""),eh("")},e9=async()=>{eS(!1),eN(!0),er(!0),ed(null),eo("Connecting..."),e6();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){el(t.tunnelUrl||"");let e=await e3(t.tunnelUrl);ee(!0),ed(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){e8(t.authUrl,"Open Login Page"),eo('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){e6(),eo("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){el(t.tunnelUrl||"");let e=await e3(t.tunnelUrl);ee(!0),ed(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await e7(t.enableUrl):ed({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}e6(),ed({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await e7(t.enableUrl);ed({type:"error",message:t.error||"Failed to connect"})}catch(e){ed({type:"error",message:e.message})}finally{er(!1),eN(!1),eo(""),e6()}},e7=async e=>{e8(e,"Open Funnel Settings"),eo('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e6(),el(t.tunnelUrl||"");let e=await e3(t.tunnelUrl);ee(!0),ed(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){e6(),ed({type:"error",message:t.error});return}}catch{}}e6(),ed({type:"error",message:"Timed out waiting for Funnel to be enabled."})},te=async()=>{er(!0),ed(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(ee(!1),el(""),eP(!1),ed({type:"success",message:"Tailscale disabled"})):ed({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){ed({type:"error",message:e.message})}finally{er(!1)}},tt=async()=>{ed(null),ej([]);let e=await e2();e?.installed&&e?.hasCachedPassword?e9():eS(!0)},ts=async()=>{if(f.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f})}),t=await e.json();e.ok&&(w(t.key),await eY(),j(""),g(!1))}catch(e){console.log("Error creating key:",e)}},ta=async e=>{N({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{N(null);try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),eq(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}}})},tl=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[tn,tr]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{tr(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(u,{label:"Local",url:tn,copyId:"local_url",copied:eH,onCopy:eJ}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${U?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),U&&!z&&F?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${q||L}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eJ(`${q||L}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eH?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>V(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!U||z||F?z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),J||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{H(!1),B("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):M?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),M.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>Z(!0),children:"Enable"})]}):I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>O(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{eB?Q({type:"error",message:`Security required: ${eM}`}):C?Z(!0):Q({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eD?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>V(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${Y?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),Y&&!en&&et?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${ea}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eJ(`${ea}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eH?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eP(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Y||en||et?en||ev?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ei||"Connecting..."]}),em&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(em,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:ex||"Open"}),(0,a.jsx)("button",{onClick:()=>{er(!1),eN(!1),eo(""),e6()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ec?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ec.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:tt,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{eB?ed({type:"error",message:`Security required: ${eM}`}):tt()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eR?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>eP(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),eB&&!U&&!Y&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(p,{message:eM,action:{label:"Open settings",href:"/dashboard/profile"}})}),(U||Y)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!C&&(0,a.jsx)(p,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!T||!_)&&(0,a.jsx)(p,{message:T?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:T?"Change password":"Enable",href:"/dashboard/profile"}})]}),(U||Y)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:$,onChange:()=>eG(!$)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(h,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>g(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:C,onChange:()=>eV(!C)})]}),eK&&!C&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(p,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>g(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:eW.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void eq(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:eW.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eW.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>eJ(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eH===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?N({title:"Pause API Key",message:`Pause API key "${e.name}"?
2
+
3
+ This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{N(null),tl(e.id,t)}}):tl(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>ta(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:b,title:"Create API Key",onClose:()=>{g(!1),j("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:f,onChange:e=>j(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:ts,fullWidth:!0,disabled:!f.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{g(!1),j("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!k,title:"API Key Created",onClose:()=>w(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:k||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eH?"check":"content_copy",onClick:()=>eJ(k,"created_key"),children:"created_key"===eH?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>w(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:X,title:"Enable Tunnel",onClose:()=>Z(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:c.oX.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e1,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>Z(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:G,title:"Disable Tunnel",onClose:()=>!z&&V(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e5,fullWidth:!0,disabled:z,variant:"danger",children:z?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>V(!1),variant:"ghost",fullWidth:!0,disabled:z,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eC,title:"Tailscale Funnel",onClose:()=>{eb||(eS(!1),ew(""),ed(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ep&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ep&&!eb&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e4,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eS(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eb&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),ef.length>0&&(0,a.jsx)("div",{ref:e_,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:ef.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ep&&!eb&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>e9(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eS(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ec&&(0,a.jsx)(x,{status:ec})]})}),(0,a.jsx)(i.aF,{isOpen:eT,title:"Disable Tailscale",onClose:()=>!en&&eP(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:te,fullWidth:!0,disabled:en,variant:"danger",children:en?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eP(!1),variant:"ghost",fullWidth:!0,disabled:en,children:"Cancel"})]})]})}),(0,a.jsx)(i.uo,{isOpen:!!v,onClose:()=>N(null),onConfirm:v?.onConfirm,title:v?.title||"Confirm",message:v?.message,variant:"danger"})]})}y.propTypes={machineId:r().string.isRequired}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{58005:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(88105);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover",loading:"lazy",decoding:"async"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=58005)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{21600:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(88105);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover",loading:"lazy",decoding:"async"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=21600)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{11520:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))},85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),i=a(98500),r=a.n(i),d=a(35497),o=a(3534),n=a(28777),c=a(23683);let u=a(41463).env.NEXT_PUBLIC_CLOUD_URL;function x({toolId:e,machineId:t}){let a=o.dM[e],[i,v]=(0,s.useState)([]),[m,h]=(0,s.useState)(!0),[p,f]=(0,s.useState)({}),[b,E]=(0,s.useState)(!1),[j,P]=(0,s.useState)(!1),[g,w]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[S,_]=(0,s.useState)(""),[y,A]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,l,s]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();v(e.connections||[])}if(a.ok){let e=await a.json();E(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),_(e.tailscale?.tunnelUrl||"")}if(s.ok){let e=await s.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let C=()=>i.filter(e=>!1!==e.isActive),M=(0,s.useCallback)((e,t,a)=>{f(l=>l[e]?.[t]===a?l:{...l,[e]:{...l[e],[t]:a}})},[]);return a?(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),m?(0,l.jsx)(d.Qv,{}):(()=>{let t,s,i,r=(t=C(),s=[],i=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider,a=(0,n.KC)(e.provider);if(a.forEach(a=>{let l=`${t}/${a.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))}),0===a.length){let a=e.providerSpecificData?.prefix||t,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(t=>t.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${a}/model-id`}),l.forEach(t=>{let l=`${a}/${t.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${a}/${t.id}`,provider:e.provider,alias:a,connectionName:e.name,modelId:t.id}))})}}),s).length>0,d={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:j&&g?g:b&&u?u:window.location.origin,apiKeys:y,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S};switch(e){case"claude":return(0,l.jsx)(c.Tk,{...d,activeProviders:C(),modelMappings:p[e]||{},onModelMappingChange:(t,a)=>M(e,t,a),hasActiveProviders:r,cloudEnabled:b});case"codex":return(0,l.jsx)(c.Ah,{...d,activeProviders:C(),cloudEnabled:b});case"opencode":return(0,l.jsx)(c.qO,{...d,activeProviders:C(),cloudEnabled:b});case"cowork":return(0,l.jsx)(c.Q6,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b,cloudUrl:u,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S});case"droid":return(0,l.jsx)(c.ZM,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"openclaw":return(0,l.jsx)(c.yZ,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"hermes":return(0,l.jsx)(c.RF,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"cline":return(0,l.jsx)(c.aG,{...d,activeProviders:C(),cloudEnabled:b});case"kilo":return(0,l.jsx)(c.c9,{...d,activeProviders:C(),cloudEnabled:b});case"deepseek-tui":return(0,l.jsx)(c.lF,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"jcode":return(0,l.jsx)(c.mW,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"grok-build":return(0,l.jsx)(c.E_,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});default:return(0,l.jsx)(c.a7,{toolId:e,...d,activeProviders:C(),cloudEnabled:b,tunnelEnabled:j})}})()]}):(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=11520)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{48527:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))},85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),i=a(98500),r=a.n(i),d=a(35497),o=a(3534),n=a(28777),c=a(23683);let u=a(41463).env.NEXT_PUBLIC_CLOUD_URL;function x({toolId:e,machineId:t}){let a=o.dM[e],[i,v]=(0,s.useState)([]),[m,h]=(0,s.useState)(!0),[p,f]=(0,s.useState)({}),[b,E]=(0,s.useState)(!1),[j,P]=(0,s.useState)(!1),[g,w]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[S,_]=(0,s.useState)(""),[y,A]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,l,s]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();v(e.connections||[])}if(a.ok){let e=await a.json();E(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),_(e.tailscale?.tunnelUrl||"")}if(s.ok){let e=await s.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let C=()=>i.filter(e=>!1!==e.isActive),M=(0,s.useCallback)((e,t,a)=>{f(l=>l[e]?.[t]===a?l:{...l,[e]:{...l[e],[t]:a}})},[]);return a?(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),m?(0,l.jsx)(d.Qv,{}):(()=>{let t,s,i,r=(t=C(),s=[],i=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider,a=(0,n.KC)(e.provider);if(a.forEach(a=>{let l=`${t}/${a.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))}),0===a.length){let a=e.providerSpecificData?.prefix||t,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(t=>t.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${a}/model-id`}),l.forEach(t=>{let l=`${a}/${t.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${a}/${t.id}`,provider:e.provider,alias:a,connectionName:e.name,modelId:t.id}))})}}),s).length>0,d={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:j&&g?g:b&&u?u:window.location.origin,apiKeys:y,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S};switch(e){case"claude":return(0,l.jsx)(c.Tk,{...d,activeProviders:C(),modelMappings:p[e]||{},onModelMappingChange:(t,a)=>M(e,t,a),hasActiveProviders:r,cloudEnabled:b});case"codex":return(0,l.jsx)(c.Ah,{...d,activeProviders:C(),cloudEnabled:b});case"opencode":return(0,l.jsx)(c.qO,{...d,activeProviders:C(),cloudEnabled:b});case"cowork":return(0,l.jsx)(c.Q6,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b,cloudUrl:u,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S});case"droid":return(0,l.jsx)(c.ZM,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"openclaw":return(0,l.jsx)(c.yZ,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"hermes":return(0,l.jsx)(c.RF,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"cline":return(0,l.jsx)(c.aG,{...d,activeProviders:C(),cloudEnabled:b});case"kilo":return(0,l.jsx)(c.c9,{...d,activeProviders:C(),cloudEnabled:b});case"deepseek-tui":return(0,l.jsx)(c.lF,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"jcode":return(0,l.jsx)(c.mW,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});case"grok-build":return(0,l.jsx)(c.E_,{...d,activeProviders:C(),hasActiveProviders:r,cloudEnabled:b});default:return(0,l.jsx)(c.a7,{toolId:e,...d,activeProviders:C(),cloudEnabled:b,tunnelEnabled:j})}})()]}):(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=48527)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{50189:(e,s,l)=>{Promise.resolve().then(l.bind(l,75882))},75882:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),i=l(35497),r=l(3534),c=l(23683),n=l(98500),o=l.n(n),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.has9Router?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(i.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{})]});let d=Object.entries(r.dM),g=Object.entries(r.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:n[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,t.jsx)(c.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=50189)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{47048:(e,s,l)=>{Promise.resolve().then(l.bind(l,75882))},75882:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),i=l(35497),r=l(3534),c=l(23683),n=l(98500),o=l.n(n),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.has9Router?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(i.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{})]});let d=Object.entries(r.dM),g=Object.entries(r.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:n[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,t.jsx)(c.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=47048)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{76463:(e,t,s)=>{Promise.resolve().then(s.bind(s,80191))},80191:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var l=s(95155),a=s(12115),i=s(44923),n=s(87256),r=s(39768),o=s(5020),d=s(35497),c=s(11059),m=s(929);s(88105);let x=/^[a-zA-Z0-9_.\-]+$/,p=[{key:"vision",label:"Vision",icon:"visibility",desc:"Images"},{key:"audioInput",label:"Audio",icon:"graphic_eq",desc:"Audio input"}],u={enabled:!0,roundRobin:!1,models:[]},h={vision:{...u},pdf:{...u},audioInput:{...u},videoInput:{...u}};function b(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[n,r]=(0,a.useState)(!1),[o,x]=(0,a.useState)(null),[b,f]=(0,a.useState)([]),[y,v]=(0,a.useState)({}),[w,k]=(0,a.useState)(h),{getCaps:C}=(0,m.y)(),[S,$]=(0,a.useState)(null),{copied:M,copy:A}=(0,c.C)();(0,a.useEffect)(()=>{E()},[]);let E=async()=>{try{let[s,l,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),i=await s.json(),n=await l.json(),r=a.ok?await a.json():{};s.ok&&t((i.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),l.ok&&f(n.connections||[]),v(r.comboStrategies||{});let o=r.capacityAdapter||{},d={};for(let t of p){var e;d[t.key]=(e=o[t.key],Array.isArray(e)?{enabled:!0,roundRobin:!1,models:e.map(e=>e?.model||e).filter(Boolean)}:e&&"object"==typeof e?{enabled:!1!==e.enabled,roundRobin:!!e.roundRobin,models:Array.isArray(e.models)?e.models.filter(Boolean):[]}:{...u})}k(d)}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},O=async e=>{k(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({capacityAdapter:e})})}catch(e){console.log("Error updating capacity adapter:",e)}},P=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await E(),r(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},F=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await E(),x(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},R=async s=>{$({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{$(null);try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}}})},_=async(e,t)=>{try{let s={...y},l={...s[e]||{},...t};l.fallbackStrategy&&"fallback"!==l.fallbackStrategy?s[e]=l:delete s[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})}),v(s)}catch(e){console.log("Error updating combo strategy:",e)}};return s?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(d.Qv,{}),(0,l.jsx)(d.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Group models under one name, then pick a strategy per combo:"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fallback"})," — tries models in order (next on failure)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Round Robin"})," — rotates models across requests to spread load"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fusion"})," — queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]})]})]}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Create Combo"})]}),0===e.length?(0,l.jsx)(d.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,l.jsx)(g,{combo:e,getCaps:C,activeProviders:b,copied:M,onCopy:A,onEdit:()=>x(e),onDelete:()=>R(e.id),strategy:y[e.name]||{},onSetStrategy:t=>_(e.name,t)},e.id))}),(0,l.jsx)(j,{capacityAdapter:w,onChange:O,activeProviders:b,getCaps:C}),n&&(0,l.jsx)(N,{isOpen:n,onClose:()=>r(!1),onSave:P,activeProviders:b},"create"),o&&(0,l.jsx)(N,{isOpen:!!o,combo:o,onClose:()=>x(null),onSave:e=>F(o.id,e),activeProviders:b},o.id),(0,l.jsx)(d.uo,{isOpen:!!S,onClose:()=>$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}let f=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function g({combo:e,getCaps:t,activeProviders:s=[],copied:i,onCopy:n,onEdit:r,onDelete:o,strategy:c={},onSetStrategy:m}){let[x,p]=(0,a.useState)(!1),u=c.fallbackStrategy||"fallback",h=c.judgeModel||"";return(0,l.jsxs)(d.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,s)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:t?.(e)})]},s)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),"fusion"===u&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>p(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:h||`Auto — ${e.models[0]||"first model"}`})]}),h&&(0,l.jsx)("button",{onClick:()=>m({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,l.jsx)(d.l6,{options:f,value:u,onChange:e=>m({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:r,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),x&&(0,l.jsx)(d.rq,{isOpen:x,onClose:()=>p(!1),onSelect:e=>{m({judgeModel:e?.value||""}),p(!1)},activeProviders:s,title:"Select Judge Model",addedModelValues:h?[h]:[],closeOnSelect:!0})]})}function j({capacityAdapter:e,onChange:t,activeProviders:s,getCaps:a}){return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"Vision Adapter"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Your model can't read image/audio? Auto-switches to a model in the pool below."}),(0,l.jsxs)("ul",{className:"mt-1.5 text-[11px] text-text-muted flex flex-col gap-0.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Vision"})," — images (png, jpg, webp, …)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Audio"})," — audio input"]})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:p.map(i=>(0,l.jsx)(y,{cap:i,entry:e[i.key]||u,onChange:s=>t({...e,[i.key]:s}),activeProviders:s,getCaps:a},i.key))})]})}function y({cap:e,entry:t,onChange:s,activeProviders:i,getCaps:n}){let[r,o]=(0,a.useState)(!1),{enabled:c,roundRobin:m,models:x}=t,p=e=>s({...t,...e}),u=(e,t)=>{let s=e+t;if(s<0||s>=x.length)return;let l=[...x];[l[e],l[s]]=[l[s],l[e]],p({models:l})};return(0,l.jsxs)(d.Zp,{padding:"sm",className:`group ${!c?"opacity-50":""}`,children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[(0,l.jsx)(d.lM,{checked:c,onChange:e=>p({enabled:e}),"aria-label":`Enable ${e.label} adapter`}),(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:e.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"font-mono text-sm font-medium",children:e.label}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["— ",e.desc]})]}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===x.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):x.slice(0,3).map((e,t)=>(0,l.jsxs)("code",{className:"group/chip inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:n?.(e)}),(0,l.jsx)("button",{onClick:()=>u(t,-1),disabled:0===t,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:()=>u(t,1),disabled:t===x.length-1,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${t===x.length-1?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})}),(0,l.jsx)("button",{onClick:()=>{let e;p({models:0===(e=x.filter((e,s)=>s!==t)).length?["oc/mimo-v2.5-free"]:e})},className:"leading-none opacity-0 group-hover/chip:opacity-100 text-text-muted hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e}-${t}`)),x.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",x.length-3," more"]})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer select-none",children:[(0,l.jsx)(d.lM,{checked:m,onChange:e=>p({roundRobin:e}),disabled:!c,"aria-label":`Round-robin ${e.label} adapter`}),(0,l.jsx)("span",{children:"Round"})]}),(0,l.jsx)(d.$n,{icon:"add",variant:"ghost",size:"sm",onClick:()=>o(!0),disabled:!c,title:`Add ${e.label} model`,children:"Add Model"})]})]}),r&&(0,l.jsx)(d.rq,{isOpen:r,onClose:()=>o(!1),onSelect:e=>{x.includes(e.value)||p({models:[...x,e.value]})},activeProviders:i,title:`Add ${e.label} Model`,addedModelValues:x,capFilter:e.key,closeOnSelect:!1})]})}function v({id:e,index:t,model:s,isFirst:i,isLast:o,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:x}){let{attributes:p,listeners:u,setNodeRef:h,transform:b,isDragging:f}=(0,n.gl)({id:e}),g={transform:r.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[j,y]=(0,a.useState)(!1),[N,w]=(0,a.useState)(s),k=()=>{let e=N.trim();e&&e!==s?d(e):w(s),y(!1)};return(0,l.jsxs)("div",{ref:h,style:g,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...p,...u,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),j?(0,l.jsx)("input",{autoFocus:!0,value:N,onChange:e=>w(e.target.value),onBlur:k,onKeyDown:e=>{"Enter"===e.key&&k(),"Escape"===e.key&&(w(s),y(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>y(!0),title:"Click to edit",children:s}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:c,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function N({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:c,kindFilter:m=null}){let[p,u]=(0,a.useState)(t?.name||""),[h,b]=(0,a.useState)(t?.models||[]),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[C,S]=(0,a.useState)({}),$=(0,i.FR)((0,i.MS)(i.AN,{activationConstraint:{distance:5}}),(0,i.MS)(i.uN,{coordinateGetter:n.JR})),M=h.map((e,t)=>({uid:`item-${t}`,model:e})),A=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();S(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,a.useEffect)(()=>{e&&A()},[e]);let E=e=>e.trim()?x.test(e)?(k(""),!0):(k("Only letters, numbers, -, _ and . allowed"),!1):(k("Name is required"),!1),O=async()=>{E(p)&&(y(!0),await r({name:p.trim(),models:h}),y(!1))},P=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.aF,{isOpen:e,onClose:s,title:P?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.pd,{label:"Combo Name",value:p,onChange:e=>{let t=e.target.value;u(t),t?E(t):k("")},placeholder:"my-combo",error:w}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===h.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(i.Mp,{sensors:$,collisionDetection:i.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=M.findIndex(e=>e.uid===t.id),l=M.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&b(t=>(0,n.be)(t,e,l))}},modifiers:[o.FN,o.gj],children:(0,l.jsx)(n.gB,{items:M.map(e=>e.uid),strategy:n._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:t},s)=>(0,l.jsx)(v,{id:e,index:s,model:t,isFirst:0===s,isLast:s===M.length-1,onEdit:e=>{let t=[...h];t[s]=e,b(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...h];[t[e-1],t[e]]=[t[e],t[e-1]],b(t)})(s),onMoveDown:()=>(e=>{if(e===h.length-1)return;let t=[...h];[t[e],t[e+1]]=[t[e+1],t[e]],b(t)})(s),onRemove:()=>{b(h.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>g(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(d.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(d.$n,{onClick:O,fullWidth:!0,size:"sm",disabled:!p.trim()||!!w||j,children:j?"Saving...":P?"Save":"Create"})]})]})}),f&&(0,l.jsx)(d.rq,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{h.includes(e.value)||b([...h,e.value])},onDeselect:e=>{b(h.filter(t=>t!==e.value))},activeProviders:c,modelAliases:C,title:"Add Model to Combo",kindFilter:m,addedModelValues:h,closeOnSelect:!1})]})}},84680:(e,t,s)=>{"use strict";s.d(t,{PM:()=>l.PM,Sj:()=>l.Sj,Vy:()=>l.Vy,fF:()=>l.fF,sl:()=>l.sl,vL:()=>l.vL,y$:()=>l.y$,zM:()=>l.zM});var l=s(44923)}},e=>{e.O(0,[4614,5353,1321,705,5497,8441,3794,7358],()=>e(e.s=76463)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{45606:(e,t,s)=>{Promise.resolve().then(s.bind(s,80191))},80191:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var l=s(95155),a=s(12115),i=s(44923),n=s(87256),r=s(39768),o=s(5020),d=s(35497),c=s(11059),m=s(929);s(88105);let x=/^[a-zA-Z0-9_.\-]+$/,p=[{key:"vision",label:"Vision",icon:"visibility",desc:"Images"},{key:"audioInput",label:"Audio",icon:"graphic_eq",desc:"Audio input"}],u={enabled:!0,roundRobin:!1,models:[]},h={vision:{...u},pdf:{...u},audioInput:{...u},videoInput:{...u}};function b(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[n,r]=(0,a.useState)(!1),[o,x]=(0,a.useState)(null),[b,f]=(0,a.useState)([]),[y,v]=(0,a.useState)({}),[w,k]=(0,a.useState)(h),{getCaps:C}=(0,m.y)(),[S,$]=(0,a.useState)(null),{copied:M,copy:A}=(0,c.C)();(0,a.useEffect)(()=>{E()},[]);let E=async()=>{try{let[s,l,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),i=await s.json(),n=await l.json(),r=a.ok?await a.json():{};s.ok&&t((i.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),l.ok&&f(n.connections||[]),v(r.comboStrategies||{});let o=r.capacityAdapter||{},d={};for(let t of p){var e;d[t.key]=(e=o[t.key],Array.isArray(e)?{enabled:!0,roundRobin:!1,models:e.map(e=>e?.model||e).filter(Boolean)}:e&&"object"==typeof e?{enabled:!1!==e.enabled,roundRobin:!!e.roundRobin,models:Array.isArray(e.models)?e.models.filter(Boolean):[]}:{...u})}k(d)}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},O=async e=>{k(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({capacityAdapter:e})})}catch(e){console.log("Error updating capacity adapter:",e)}},P=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await E(),r(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},F=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await E(),x(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},R=async s=>{$({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{$(null);try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}}})},_=async(e,t)=>{try{let s={...y},l={...s[e]||{},...t};l.fallbackStrategy&&"fallback"!==l.fallbackStrategy?s[e]=l:delete s[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})}),v(s)}catch(e){console.log("Error updating combo strategy:",e)}};return s?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(d.Qv,{}),(0,l.jsx)(d.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Group models under one name, then pick a strategy per combo:"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fallback"})," — tries models in order (next on failure)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Round Robin"})," — rotates models across requests to spread load"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fusion"})," — queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]})]})]}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Create Combo"})]}),0===e.length?(0,l.jsx)(d.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,l.jsx)(g,{combo:e,getCaps:C,activeProviders:b,copied:M,onCopy:A,onEdit:()=>x(e),onDelete:()=>R(e.id),strategy:y[e.name]||{},onSetStrategy:t=>_(e.name,t)},e.id))}),(0,l.jsx)(j,{capacityAdapter:w,onChange:O,activeProviders:b,getCaps:C}),n&&(0,l.jsx)(N,{isOpen:n,onClose:()=>r(!1),onSave:P,activeProviders:b},"create"),o&&(0,l.jsx)(N,{isOpen:!!o,combo:o,onClose:()=>x(null),onSave:e=>F(o.id,e),activeProviders:b},o.id),(0,l.jsx)(d.uo,{isOpen:!!S,onClose:()=>$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}let f=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function g({combo:e,getCaps:t,activeProviders:s=[],copied:i,onCopy:n,onEdit:r,onDelete:o,strategy:c={},onSetStrategy:m}){let[x,p]=(0,a.useState)(!1),u=c.fallbackStrategy||"fallback",h=c.judgeModel||"";return(0,l.jsxs)(d.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,s)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:t?.(e)})]},s)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),"fusion"===u&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>p(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:h||`Auto — ${e.models[0]||"first model"}`})]}),h&&(0,l.jsx)("button",{onClick:()=>m({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,l.jsx)(d.l6,{options:f,value:u,onChange:e=>m({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:r,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),x&&(0,l.jsx)(d.rq,{isOpen:x,onClose:()=>p(!1),onSelect:e=>{m({judgeModel:e?.value||""}),p(!1)},activeProviders:s,title:"Select Judge Model",addedModelValues:h?[h]:[],closeOnSelect:!0})]})}function j({capacityAdapter:e,onChange:t,activeProviders:s,getCaps:a}){return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"Vision Adapter"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Your model can't read image/audio? Auto-switches to a model in the pool below."}),(0,l.jsxs)("ul",{className:"mt-1.5 text-[11px] text-text-muted flex flex-col gap-0.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Vision"})," — images (png, jpg, webp, …)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Audio"})," — audio input"]})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:p.map(i=>(0,l.jsx)(y,{cap:i,entry:e[i.key]||u,onChange:s=>t({...e,[i.key]:s}),activeProviders:s,getCaps:a},i.key))})]})}function y({cap:e,entry:t,onChange:s,activeProviders:i,getCaps:n}){let[r,o]=(0,a.useState)(!1),{enabled:c,roundRobin:m,models:x}=t,p=e=>s({...t,...e}),u=(e,t)=>{let s=e+t;if(s<0||s>=x.length)return;let l=[...x];[l[e],l[s]]=[l[s],l[e]],p({models:l})};return(0,l.jsxs)(d.Zp,{padding:"sm",className:`group ${!c?"opacity-50":""}`,children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[(0,l.jsx)(d.lM,{checked:c,onChange:e=>p({enabled:e}),"aria-label":`Enable ${e.label} adapter`}),(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:e.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"font-mono text-sm font-medium",children:e.label}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["— ",e.desc]})]}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===x.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):x.slice(0,3).map((e,t)=>(0,l.jsxs)("code",{className:"group/chip inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:n?.(e)}),(0,l.jsx)("button",{onClick:()=>u(t,-1),disabled:0===t,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:()=>u(t,1),disabled:t===x.length-1,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${t===x.length-1?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})}),(0,l.jsx)("button",{onClick:()=>{let e;p({models:0===(e=x.filter((e,s)=>s!==t)).length?["oc/mimo-v2.5-free"]:e})},className:"leading-none opacity-0 group-hover/chip:opacity-100 text-text-muted hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e}-${t}`)),x.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",x.length-3," more"]})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer select-none",children:[(0,l.jsx)(d.lM,{checked:m,onChange:e=>p({roundRobin:e}),disabled:!c,"aria-label":`Round-robin ${e.label} adapter`}),(0,l.jsx)("span",{children:"Round"})]}),(0,l.jsx)(d.$n,{icon:"add",variant:"ghost",size:"sm",onClick:()=>o(!0),disabled:!c,title:`Add ${e.label} model`,children:"Add Model"})]})]}),r&&(0,l.jsx)(d.rq,{isOpen:r,onClose:()=>o(!1),onSelect:e=>{x.includes(e.value)||p({models:[...x,e.value]})},activeProviders:i,title:`Add ${e.label} Model`,addedModelValues:x,capFilter:e.key,closeOnSelect:!1})]})}function v({id:e,index:t,model:s,isFirst:i,isLast:o,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:x}){let{attributes:p,listeners:u,setNodeRef:h,transform:b,isDragging:f}=(0,n.gl)({id:e}),g={transform:r.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[j,y]=(0,a.useState)(!1),[N,w]=(0,a.useState)(s),k=()=>{let e=N.trim();e&&e!==s?d(e):w(s),y(!1)};return(0,l.jsxs)("div",{ref:h,style:g,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...p,...u,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),j?(0,l.jsx)("input",{autoFocus:!0,value:N,onChange:e=>w(e.target.value),onBlur:k,onKeyDown:e=>{"Enter"===e.key&&k(),"Escape"===e.key&&(w(s),y(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>y(!0),title:"Click to edit",children:s}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:c,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function N({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:c,kindFilter:m=null}){let[p,u]=(0,a.useState)(t?.name||""),[h,b]=(0,a.useState)(t?.models||[]),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[C,S]=(0,a.useState)({}),$=(0,i.FR)((0,i.MS)(i.AN,{activationConstraint:{distance:5}}),(0,i.MS)(i.uN,{coordinateGetter:n.JR})),M=h.map((e,t)=>({uid:`item-${t}`,model:e})),A=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();S(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,a.useEffect)(()=>{e&&A()},[e]);let E=e=>e.trim()?x.test(e)?(k(""),!0):(k("Only letters, numbers, -, _ and . allowed"),!1):(k("Name is required"),!1),O=async()=>{E(p)&&(y(!0),await r({name:p.trim(),models:h}),y(!1))},P=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.aF,{isOpen:e,onClose:s,title:P?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.pd,{label:"Combo Name",value:p,onChange:e=>{let t=e.target.value;u(t),t?E(t):k("")},placeholder:"my-combo",error:w}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===h.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(i.Mp,{sensors:$,collisionDetection:i.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=M.findIndex(e=>e.uid===t.id),l=M.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&b(t=>(0,n.be)(t,e,l))}},modifiers:[o.FN,o.gj],children:(0,l.jsx)(n.gB,{items:M.map(e=>e.uid),strategy:n._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:t},s)=>(0,l.jsx)(v,{id:e,index:s,model:t,isFirst:0===s,isLast:s===M.length-1,onEdit:e=>{let t=[...h];t[s]=e,b(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...h];[t[e-1],t[e]]=[t[e],t[e-1]],b(t)})(s),onMoveDown:()=>(e=>{if(e===h.length-1)return;let t=[...h];[t[e],t[e+1]]=[t[e+1],t[e]],b(t)})(s),onRemove:()=>{b(h.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>g(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(d.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(d.$n,{onClick:O,fullWidth:!0,size:"sm",disabled:!p.trim()||!!w||j,children:j?"Saving...":P?"Save":"Create"})]})]})}),f&&(0,l.jsx)(d.rq,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{h.includes(e.value)||b([...h,e.value])},onDeselect:e=>{b(h.filter(t=>t!==e.value))},activeProviders:c,modelAliases:C,title:"Add Model to Combo",kindFilter:m,addedModelValues:h,closeOnSelect:!1})]})}},84680:(e,t,s)=>{"use strict";s.d(t,{PM:()=>l.PM,Sj:()=>l.Sj,Vy:()=>l.Vy,fF:()=>l.fF,sl:()=>l.sl,vL:()=>l.vL,y$:()=>l.y$,zM:()=>l.zM});var l=s(44923)}},e=>{e.O(0,[4614,5353,1321,705,5497,8441,3794,7358],()=>e(e.s=45606)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"lines"===l.type?t(e=>{let t=[...e,...l.lines];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},59668:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=59668)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"lines"===l.type?t(e=>{let t=[...e,...l.lines];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},93073:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[4614,1321,705,5497,8441,3794,7358],()=>e(e.s=93073)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[4614,1321,705,5497,809,8441,3794,7358],()=>_(_.s=809)),_N_E=_.O()}]);