@sifxprime/krouter 0.5.146 → 0.5.147

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 (240) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +19 -19
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  43. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  44. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  45. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  46. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  47. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  48. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  49. package/app/.next-cli-build/server/app/api/import/route.js +1 -1
  50. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  51. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  52. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  53. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  54. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  55. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  56. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  57. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  58. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  59. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  60. package/app/.next-cli-build/server/app/api/settings/environment/route.js +1 -1
  61. package/app/.next-cli-build/server/app/api/settings/presidio/route.js +1 -1
  62. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  63. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  64. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  65. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  66. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  67. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  68. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  69. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/callback.html +1 -1
  71. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  72. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  73. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  74. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  75. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  76. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  77. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  78. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  79. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  80. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  82. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  83. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  84. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  85. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  86. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  87. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  88. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  89. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  90. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  91. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  92. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  93. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  94. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  95. package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
  96. package/app/.next-cli-build/server/app/dashboard/environment.rsc +6 -6
  97. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +6 -6
  98. package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +6 -6
  99. package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +2 -2
  100. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  101. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  102. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  103. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  104. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  105. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  106. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  107. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  108. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  109. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  110. package/app/.next-cli-build/server/app/dashboard/presidio.html +1 -1
  111. package/app/.next-cli-build/server/app/dashboard/presidio.rsc +6 -6
  112. package/app/.next-cli-build/server/app/dashboard/presidio.segments/!KGRhc2hib2FyZCk/dashboard/presidio/__PAGE__.segment.rsc +6 -6
  113. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_full.segment.rsc +6 -6
  114. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_tree.segment.rsc +2 -2
  115. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  116. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  117. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  118. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  119. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  120. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  121. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  122. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  123. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  124. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  125. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  126. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  127. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  128. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  129. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  130. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  131. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  132. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  133. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  134. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  135. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  136. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  137. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  138. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  139. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  140. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  141. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  142. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  143. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  144. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  145. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  146. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  147. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  149. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  150. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  151. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  152. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  153. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  154. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  155. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  156. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  157. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  158. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  159. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  160. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  161. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  162. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  163. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  164. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  165. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  166. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  167. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  168. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  169. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  170. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  171. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  172. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  173. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  174. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  175. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  176. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  177. package/app/.next-cli-build/server/app/index.html +1 -1
  178. package/app/.next-cli-build/server/app/index.rsc +4 -4
  179. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  180. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  181. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  182. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  183. package/app/.next-cli-build/server/app/landing.html +1 -1
  184. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  185. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  186. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  187. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  188. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  189. package/app/.next-cli-build/server/app/login.html +1 -1
  190. package/app/.next-cli-build/server/app/login.rsc +5 -5
  191. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  192. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  193. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  194. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  195. package/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  196. package/app/.next-cli-build/server/chunks/192.js +9 -0
  197. package/app/.next-cli-build/server/chunks/2365.js +1 -1
  198. package/app/.next-cli-build/server/chunks/2722.js +1 -1
  199. package/app/.next-cli-build/server/chunks/412.js +2 -2
  200. package/app/.next-cli-build/server/chunks/4884.js +2 -2
  201. package/app/.next-cli-build/server/chunks/523.js +1 -0
  202. package/app/.next-cli-build/server/chunks/5718.js +1 -1
  203. package/app/.next-cli-build/server/chunks/6200.js +2 -2
  204. package/app/.next-cli-build/server/chunks/706.js +4 -3
  205. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  206. package/app/.next-cli-build/server/chunks/7276.js +1 -1
  207. package/app/.next-cli-build/server/chunks/7833.js +9 -0
  208. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  209. package/app/.next-cli-build/server/chunks/8782.js +1 -0
  210. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  211. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  212. package/app/.next-cli-build/server/middleware.js +2 -2
  213. package/app/.next-cli-build/server/pages/404.html +1 -1
  214. package/app/.next-cli-build/server/pages/500.html +1 -1
  215. package/app/.next-cli-build/static/chunks/{1321-6c49a954d60cdf8d.js → 1321-59a8def10db84b86.js} +1 -1
  216. package/app/.next-cli-build/static/chunks/5497-d4a2fb8d25696366.js +7 -0
  217. package/app/.next-cli-build/static/chunks/{6069-dd3d88032deffd6b.js → 6069-db27e074bc47d5fe.js} +1 -1
  218. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-783b478197298c31.js → page-1c13f46a5c077d38.js} +1 -1
  219. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-81f0e1ae55f87925.js +1 -0
  220. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/presidio/{page-d99bb3a54c3dbb50.js → page-99353b884e6df533.js} +1 -1
  221. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-f52892e5e4b5f25b.js → page-b92667a32e2aeffa.js} +2 -2
  222. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-69f5c1cd75191fc4.js +1 -0
  223. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-97596f6b0ed5c791.js → page-719a6bedc7b221df.js} +1 -1
  224. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-625fde09367a7c35.js +1 -0
  225. package/app/.next-cli-build/static/css/{ec08ba27b16d57e9.css → 8e737cade791a545.css} +1 -1
  226. package/app/cli/package.json +1 -1
  227. package/app/package.json +1 -1
  228. package/app/src/lib/db/backup.js +35 -0
  229. package/cli.js +211 -106
  230. package/package.json +1 -1
  231. package/src/cli/tray/tray.ps1 +38 -14
  232. package/src/cli/utils/input.js +13 -1
  233. package/app/.next-cli-build/server/chunks/4055.js +0 -9
  234. package/app/.next-cli-build/server/chunks/5217.js +0 -9
  235. package/app/.next-cli-build/static/chunks/5497-df084be192db340d.js +0 -7
  236. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-6c89f0a1ddd99c41.js +0 -1
  237. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-b1182e42595e08ba.js +0 -1
  238. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-045957f92dd4e66b.js +0 -1
  239. /package/app/.next-cli-build/static/{alT51K3CdFyFBv27IY7wb → hKWRNoH4_Oex2Thy4DZQc}/_buildManifest.js +0 -0
  240. /package/app/.next-cli-build/static/{alT51K3CdFyFBv27IY7wb → hKWRNoH4_Oex2Thy4DZQc}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{18160:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(90620),c=s(52679),m=s(98500),p=s.n(m);function x(){let[e,t]=(0,a.useState)({status:"idle"}),[s,l]=(0,a.useState)(!1),i=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/providers/zenith",{cache:"no-store"}),s=await e.json();s.success?t({status:"ok",count:s.count,leaderboard:s.leaderboard,winner:s.winner}):t({status:"error",error:s.error})}catch{t({status:"error",error:"network"})}},[]);if((0,a.useEffect)(()=>{i();let e=setInterval(i,15e3);return()=>clearInterval(e)},[i]),"ok"!==e.status||!e.leaderboard?.length)return null;let o=e.leaderboard[0],d=e.leaderboard[e.leaderboard.length-1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-xl border border-primary/20 bg-gradient-to-r from-primary/[0.06] via-primary/[0.02] to-transparent px-4 py-2.5 text-sm",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-medium text-primary",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:"bolt"}),"Zenith"]}),(0,r.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-text-main",children:[e.count," active"]}),(0,r.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-text-main",children:["best ",(0,r.jsx)("span",{className:"font-mono text-green-600 dark:text-green-400",children:o.finalScore})," (",o.name,")"]}),e.count>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-text-main",children:["worst ",(0,r.jsx)("span",{className:`font-mono ${d.finalScore<400?"text-red-500":"text-amber-500"}`,children:d.finalScore})," (",d.name,")"]})]}),(0,r.jsx)("div",{className:"ml-auto",children:(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>l(!0),children:"Leaderboard"})})]}),(0,r.jsx)(n.aF,{isOpen:s,title:"Zenith Leaderboard",onClose:()=>l(!1),children:(0,r.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"sticky top-0 bg-bg text-text-muted",children:(0,r.jsxs)("tr",{className:"text-left text-xs",children:[(0,r.jsx)("th",{className:"py-2 pr-2",children:"#"}),(0,r.jsx)("th",{className:"py-2 pr-2",children:"Connection"}),(0,r.jsx)("th",{className:"py-2 pr-2 text-right",children:"Health"}),(0,r.jsx)("th",{className:"py-2 pr-2 text-right",children:"Quota"}),(0,r.jsx)("th",{className:"py-2 pr-2 text-right",children:"Priority"}),(0,r.jsx)("th",{className:"py-2 pl-2 text-right",children:"Zenith"})]})}),(0,r.jsx)("tbody",{children:e.leaderboard.map(e=>(0,r.jsxs)("tr",{className:"border-t border-border/50",children:[(0,r.jsx)("td",{className:"py-1.5 pr-2 text-text-muted",children:e.rank}),(0,r.jsxs)("td",{className:"py-1.5 pr-2",children:[(0,r.jsx)("div",{className:"font-medium",children:e.name}),(0,r.jsx)("div",{className:"text-[10px] text-text-muted",children:e.provider})]}),(0,r.jsx)("td",{className:"py-1.5 pr-2 text-right font-mono text-xs",children:e.healthScore}),(0,r.jsxs)("td",{className:"py-1.5 pr-2 text-right font-mono text-xs",children:["\xd7",e.quotaFactor,null!=e.quotaRemainingPct&&(0,r.jsxs)("span",{className:"ml-1 text-text-muted",children:["(",e.quotaRemainingPct,"%)"]})]}),(0,r.jsxs)("td",{className:"py-1.5 pr-2 text-right font-mono text-xs",children:["+",e.priorityBonus]}),(0,r.jsx)("td",{className:"py-1.5 pl-2 text-right",children:(0,r.jsx)("span",{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 font-mono text-[11px] ${e.finalScore>=750?"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/30":e.finalScore>=400?"bg-amber-500/10 text-amber-700 dark:text-amber-400 border-amber-500/30":"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/30"}`,children:e.finalScore})})]},e.connectionId))})]})})})]})}var h=s(65921),u=s(38003);let f={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function g(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),m=(0,a.useRef)(null),p=(0,h.i)(),x=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{x();let e=setInterval(x,3e4);return()=>clearInterval(e)},[x]),(0,a.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let u=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(p.success(`Cooldown cleared for ${t}`),await x()):p.error("Failed to clear cooldown")}catch{p.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),v={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:m,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:x,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>u(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}function b(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function v(){let e,t,[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[m,p]=(0,a.useState)(!0),[f,b]=(0,a.useState)(!1),[v,C]=(0,a.useState)(!1),[T,A]=(0,a.useState)(!1),[S,I]=(0,a.useState)(null),[$,E]=(0,a.useState)(null),R=(0,h.i)(),O=(0,u.C)(e=>e.query),U=(0,u.C)(e=>e.register),P=(0,u.C)(e=>e.unregister);(0,a.useEffect)(()=>(U("Search providers..."),()=>P()),[U,P]);let _=e=>!O.trim()||e.toLowerCase().includes(O.trim().toLowerCase());(0,a.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),s=await e.json(),r=await t.json();e.ok&&l(s.connections||[]),t.ok&&o(r.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{p(!1)}})()},[]);let q=(e,t)=>{let r=s.filter(s=>s.provider===e&&s.authType===t),a=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},z=async(e,t,r)=>{let a=s.filter(s=>s.provider===e&&s.authType===t);l(s=>s.map(s=>s.provider===e&&s.authType===t?{...s,isActive:r}:s)),await Promise.allSettled(a.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})))},D=async(e,t=null)=>{if(!S){I("provider"===e?t:e),E(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(E(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?R.success(`All ${s} tests passed`):R.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){E({error:"Test request failed"}),R.error("Provider test failed")}finally{I(null)}}},F=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>_(e.name)),M=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>_(e.name)),L=Object.entries(d.zN).filter(([,e])=>!e.hidden&&_(e.name)),K=Object.entries(c.IS).filter(([,e])=>!e.hidden&&_(e.name)),J=Object.entries(c.nJ).filter(([,e])=>!e.hidden&&_(e.name)),W=(e=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&_(e.name)),t="apikey",[...e].sort(([e,s],[r,a])=>{let l=q(e,t),i=q(r,t),n=+(l.connected>0),o=+(i.connected>0);return n!==o?o-n:(s.name||"").localeCompare(a.name||"")})),H=!!O.trim(),Z=H||f?W:W.slice(0,20),B=W.length-20;if(m)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let Q=L.length>0||K.length>0||J.length>0||W.length>0||F.length>0||M.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,r.jsx)(x,{}),!Q&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-[17px] sm:text-lg font-semibold leading-tight tracking-[-0.01em]",children:"Custom Providers"}),(0,r.jsx)("p",{className:"text-[13px] leading-5 text-text-muted/80 mt-0.5",children:"OpenAI or Anthropic compatible endpoints"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto sm:shrink-0",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>A(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>C(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Add OpenAI Compatible"})]})]}),0===F.length&&0===M.length?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,r.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...F,...M].map(e=>(0,r.jsx)(y,{providerId:e.id,provider:e,stats:q(e.id,"apikey"),authType:"compatible",onToggle:t=>z(e.id,"apikey",t)},e.id))})]}),L.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(g,{}),(0,r.jsxs)("button",{onClick:()=>D("oauth"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===S?" animate-spin":""}`,children:"play_arrow"}),"oauth"===S?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:L.map(([e,t])=>(0,r.jsx)(j,{providerId:e,provider:t,stats:q(e,"oauth"),authType:"oauth",onToggle:t=>z(e,"oauth",t)},e))})]}),(K.length>0||J.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>D("free"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===S?" animate-spin":""}`,children:"play_arrow"}),"free"===S?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[K.map(([e,t])=>(0,r.jsx)(j,{providerId:e,provider:t,stats:q(e,"oauth"),authType:"free",onToggle:t=>z(e,"oauth",t)},e)),J.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:q(e,"apikey"),authType:"apikey",onToggle:t=>z(e,"apikey",t)},e))]})]}),W.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>D("apikey"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===S?" animate-spin":""}`,children:"play_arrow"}),"apikey"===S?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:Z.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:q(e,"apikey"),authType:"apikey",onToggle:t=>z(e,"apikey",t)},e))}),!H&&!f&&B>0&&(0,r.jsxs)("button",{onClick:()=>b(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",W.length," providers"]})]}),(0,r.jsx)(N,{isOpen:v,onClose:()=>C(!1),onCreated:e=>{o(t=>[...t,e]),C(!1)}}),(0,r.jsx)(w,{isOpen:T,onClose:()=>A(!1),onCreated:e=>{o(t=>[...t,e]),A(!1)}}),$&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>E(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>E(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(k,{results:$})})]})]})]})}function j({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:m,allDisabled:x}=s,h=!!t.noAuth;return(0,r.jsx)(p(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):h?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[b(i,d,c),m&&(0,r.jsx)("span",{className:"text-text-muted",children:m})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function y({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:m,errorTime:x,allDisabled:h}=s,u=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,r.jsx)(p(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:u?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[b(i,d,m),u&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function N({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(""),[h,u]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),m(""),g(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},v=async()=>{u(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible",modelId:p.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{u(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:p,onChange:e=>x(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||h||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:h?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(""),[h,u]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(g(null),m(""),x(""))},[e]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),m(""),g(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{u(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:p.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{u(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:p,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||h||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:h?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function k({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}j.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},y.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},N.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},k.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},69343:(e,t,s)=>{Promise.resolve().then(s.bind(s,18160))}},e=>{e.O(0,[7504,1321,5497,8441,3794,7358],()=>e(e.s=69343)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7370],{31474:(e,t,s)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}s.d(t,{cn:()=>r})},58299:(e,t,s)=>{Promise.resolve().then(s.bind(s,87304))},73321:(e,t,s)=>{"use strict";var r=s(74645);s.o(r,"notFound")&&s.d(t,{notFound:function(){return r.notFound}}),s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},84588:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var r=s(95155),a=s(31474);let i={primary:"bg-surface border border-border-subtle rounded-[16px] shadow-[var(--shadow-elev)]",default:"bg-surface border border-border-subtle rounded-[14px] shadow-[var(--shadow-soft)]",inline:"bg-bg border border-border-subtle rounded-[12px]"};function n({children:e,title:t,subtitle:s,icon:l,action:d,padding:c="md",hover:o=!1,elev:x=!1,variant:u,className:m,...h}){let p=i[u]||(x?i.primary:i.default);return(0,r.jsxs)("div",{className:(0,a.cn)(p,o&&"hover:shadow-[var(--shadow-warm)] hover:border-brand-500/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[c],m),...h,children:[(t||d)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,r.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-[15px] leading-5 text-text-main font-semibold tracking-[-0.01em]",children:t}),s&&(0,r.jsx)("p",{className:"text-[13px] leading-5 text-text-muted/80 mt-0.5",children:s})]})]}),d]}),e]})}n.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",t),...s,children:e})},n.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",t),...s,children:e})},n.ListItem=function({children:e,actions:t,className:s,...i}){return(0,r.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50 transition-colors",s),...i,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},87304:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var r=s(95155),a=s(12115),i=s(73321),n=s(84588);let l={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}}};function d({isOpen:e,onClose:t,onSave:s}){let[i,n]=(0,a.useState)({}),[c,o]=(0,a.useState)(!0),[x,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&m()},[e]);let m=async()=>{o(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();n(t)}else n(l)}catch(e){console.error("Failed to load pricing:",e),n(l)}finally{o(!1)}},h=async()=>{u(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)s?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{u(!1)}},p=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&n(l)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let b=Object.keys(i).sort(),j=["input","output","cached","reasoning","cache_creation"];return(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,r.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,r.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,r.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto p-4",children:c?(0,r.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,r.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,r.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,r.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),b.map(e=>{let t=Object.keys(i[e]).sort();return(0,r.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,r.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,r.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),j.map(s=>(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][s]||0,onChange:r=>{let a;!isNaN(a=parseFloat(r.target.value))&&!(a<0)&&n(r=>{let i={...r};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][s]=a,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},s))]},t))})]})})]},e)}),0===b.length&&(0,r.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,r.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,r.jsx)("button",{onClick:p,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:x,children:"Reset to Defaults"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:x,children:"Cancel"}),(0,r.jsx)("button",{onClick:h,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:x,children:x?"Saving...":"Save Changes"})]})]})]})})}function c(){(0,i.useRouter)();let[e,t]=(0,a.useState)(!1),[s,l]=(0,a.useState)(null),[c,o]=(0,a.useState)(!0);(0,a.useEffect)(()=>{x()},[]);let x=async()=>{o(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();l(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{o(!1)}};return(0,r.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-3xl font-bold",children:"Pricing Settings"}),(0,r.jsx)("p",{className:"text-text-muted mt-1",children:"Configure pricing rates for cost tracking and calculations"})]}),(0,r.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:"Edit Pricing"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsxs)(n.default,{className:"p-4",children:[(0,r.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Models"}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:c?"...":(()=>{if(!s)return 0;let e=0;for(let t in s)e+=Object.keys(s[t]).length;return e})()})]}),(0,r.jsxs)(n.default,{className:"p-4",children:[(0,r.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Providers"}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:c?"...":(!s?[]:Object.keys(s).sort()).length})]}),(0,r.jsxs)(n.default,{className:"p-4",children:[(0,r.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Status"}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:c?"...":"Active"})]})]}),(0,r.jsxs)(n.default,{className:"p-6",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"How Pricing Works"}),(0,r.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Cost Calculation:"})," Costs are calculated based on token usage and pricing rates. Each request's cost is determined by: (input_tokens \xd7 input_rate) + (output_tokens \xd7 output_rate) + (cached_tokens \xd7 cached_rate)"]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Pricing Format:"})," All rates are in ",(0,r.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: An input rate of 2.50 means $2.50 per 1,000,000 input tokens."]}),(0,r.jsx)("p",{children:(0,r.jsx)("strong",{children:"Token Types:"})}),(0,r.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Input:"})," Standard prompt tokens"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Output:"})," Completion/response tokens"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Cached:"})," Cached input tokens (typically 50% of input rate)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Reasoning:"})," Special reasoning/thinking tokens (fallback to output rate)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Cache Creation:"})," Tokens used to create cache entries (fallback to input rate)"]})]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Custom Pricing:"})," You can override default pricing for specific models. Reset to defaults anytime to restore standard rates."]})]})]}),(0,r.jsxs)(n.default,{className:"p-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Current Pricing Overview"}),(0,r.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:"View Full Details"})]}),c?(0,r.jsx)("div",{className:"text-center py-4 text-text-muted",children:"Loading pricing data..."}):s?(0,r.jsxs)("div",{className:"space-y-3",children:[Object.keys(s).slice(0,5).map(e=>(0,r.jsxs)("div",{className:"text-sm",children:[(0,r.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,r.jsxs)("span",{className:"text-text-muted",children:[Object.keys(s[e]).length," models"]})]},e)),Object.keys(s).length>5&&(0,r.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",Object.keys(s).length-5," more providers"]})]}):(0,r.jsx)("div",{className:"text-text-muted",children:"No pricing data available"})]}),e&&(0,r.jsx)(d,{isOpen:e,onClose:()=>t(!1),onSave:()=>{x()}})]})}}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=58299)),_N_E=e.O()}]);