@hilbras/omnihilbras 2.9.3 → 2.9.4

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 (507) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +21 -21
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +1 -1
  5. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  87. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  88. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  89. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/models/chat/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/models/chat/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/models/test-batch/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/models/test-batch/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/settings/route.js +2 -2
  240. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  245. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/usage/rate-limit/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/usage/rate-limit/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  288. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  329. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  331. package/app/.next-cli-build/server/app/callback.html +1 -1
  332. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  333. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  334. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  335. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  336. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
  338. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
  339. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
  340. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
  343. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
  344. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
  345. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
  348. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
  349. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
  350. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
  353. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  354. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
  355. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
  358. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
  359. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
  360. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
  363. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
  364. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
  365. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
  368. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
  369. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
  370. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
  373. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
  374. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
  375. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
  378. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
  379. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
  380. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
  383. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
  384. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
  385. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
  388. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
  389. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
  390. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/quota.rsc +4 -4
  393. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +4 -4
  394. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +4 -4
  395. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  401. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  402. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  404. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
  406. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
  407. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
  408. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
  411. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
  412. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
  413. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
  416. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
  417. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
  418. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
  421. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
  422. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
  423. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  425. package/app/.next-cli-build/server/app/dashboard.rsc +3 -3
  426. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
  427. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
  428. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/index.html +1 -1
  431. package/app/.next-cli-build/server/app/index.rsc +3 -3
  432. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  433. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  434. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  436. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  438. package/app/.next-cli-build/server/app/landing.html +1 -1
  439. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  440. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  441. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  443. package/app/.next-cli-build/server/app/login/page.js +1 -1
  444. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  445. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  446. package/app/.next-cli-build/server/app/login.html +1 -1
  447. package/app/.next-cli-build/server/app/login.rsc +3 -3
  448. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  449. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  451. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  452. package/app/.next-cli-build/server/app/page.js +1 -1
  453. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  455. package/app/.next-cli-build/server/app-paths-manifest.json +21 -21
  456. package/app/.next-cli-build/server/chunks/1159.js +1 -1
  457. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  458. package/app/.next-cli-build/server/chunks/1640.js +1 -1
  459. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  460. package/app/.next-cli-build/server/chunks/2617.js +1 -1
  461. package/app/.next-cli-build/server/chunks/2881.js +1 -1
  462. package/app/.next-cli-build/server/chunks/3118.js +1 -1
  463. package/app/.next-cli-build/server/chunks/412.js +1 -1
  464. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  465. package/app/.next-cli-build/server/chunks/4199.js +1 -1
  466. package/app/.next-cli-build/server/chunks/4217.js +1 -1
  467. package/app/.next-cli-build/server/chunks/436.js +1 -1
  468. package/app/.next-cli-build/server/chunks/4693.js +46 -46
  469. package/app/.next-cli-build/server/chunks/5908.js +1 -1
  470. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  471. package/app/.next-cli-build/server/chunks/615.js +1 -1
  472. package/app/.next-cli-build/server/chunks/6503.js +1 -1
  473. package/app/.next-cli-build/server/chunks/6723.js +1 -1
  474. package/app/.next-cli-build/server/chunks/7068.js +1 -1
  475. package/app/.next-cli-build/server/chunks/7073.js +1 -1
  476. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  477. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  478. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  479. package/app/.next-cli-build/server/chunks/7914.js +1 -1
  480. package/app/.next-cli-build/server/chunks/7971.js +1 -1
  481. package/app/.next-cli-build/server/chunks/7992.js +1 -0
  482. package/app/.next-cli-build/server/chunks/820.js +1 -1
  483. package/app/.next-cli-build/server/chunks/8251.js +1 -1
  484. package/app/.next-cli-build/server/chunks/8287.js +1 -1
  485. package/app/.next-cli-build/server/chunks/8525.js +1 -1
  486. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  487. package/app/.next-cli-build/server/chunks/9617.js +1 -0
  488. package/app/.next-cli-build/server/instrumentation.js +1 -1
  489. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  490. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  491. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  492. package/app/.next-cli-build/server/middleware.js +2 -2
  493. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  494. package/app/.next-cli-build/server/pages/404.html +1 -1
  495. package/app/.next-cli-build/server/pages/500.html +1 -1
  496. package/app/.next-cli-build/static/chunks/{2723-162ff7c284698fd5.js → 2723-8def0af25f7b656c.js} +1 -1
  497. package/app/.next-cli-build/static/chunks/{5497-ed5ffabb85a19716.js → 5497-27e3c950b5d97d41.js} +1 -1
  498. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a2334bcea51abcc8.js +1 -0
  499. package/app/.next-cli-build/static/chunks/{webpack-a0202fae312024d7.js → webpack-782105d317e211e2.js} +1 -1
  500. package/app/package.json +1 -1
  501. package/app/public/providers/kiraai.svg +8 -0
  502. package/package.json +1 -1
  503. package/app/.next-cli-build/server/chunks/3817.js +0 -1
  504. package/app/.next-cli-build/server/chunks/8913.js +0 -1
  505. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2f6a4a085c8dd9a3.js +0 -1
  506. /package/app/.next-cli-build/static/{PjqleVLTs4em65uMZGgAe → CLokmNR1eeMLVVvsXga7b}/_buildManifest.js +0 -0
  507. /package/app/.next-cli-build/static/{PjqleVLTs4em65uMZGgAe → CLokmNR1eeMLVVvsXga7b}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,a)=>{a.d(t,{default:()=>s});var n=a(95155),r=a(31474);function s({label:e,options:t=[],value:a,onChange:i,placeholder:o="Select an option",error:l,hint:d,disabled:c=!1,required:u=!1,className:m,selectClassName:p,...x}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",m),children:[e&&(0,n.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,u&&(0,n.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("select",{value:a,onChange:i,disabled:c,className:(0,r.cn)("w-full py-2.5 px-3 pr-10 text-sm text-text-main","bg-surface-2 border border-transparent rounded-[10px] appearance-none","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",l&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...x,children:[(0,n.jsx)("option",{value:"",disabled:!0,children:o}),t.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,n.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),l&&(0,n.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),l]}),d&&!l&&(0,n.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},929:(e,t,a)=>{a.d(t,{y:()=>u});var n=a(12115),r=a(67899),s=a(88105);let i=null,o=null,l=0,d=new Set;function c(){if(i)return Promise.resolve(i);if(o)return o;let e=++l,t=fetch("/api/models").then(async t=>{if(!t.ok)throw Error(`models ${t.status}`);let a=function(e){let t={},a={};for(let n of e||[])n.caps&&(n.fullModel&&(t[n.fullModel]=n.caps),n.routedModel&&(t[n.routedModel]=n.caps),n.model&&(a[n.model]=n.caps));return{byFull:t,byId:a}}((await t.json()).models);return e===l&&(i=a),a}).catch(()=>({byFull:{},byId:{}})).finally(()=>{o===t&&(o=null)});return o=t,t}function u(){let[e,t]=(0,n.useState)(()=>i?.byFull||{}),[a,o]=(0,n.useState)(()=>i?.byId||{});return(0,n.useEffect)(()=>{let e=!0,a=a=>{e&&(t(a.byFull),o(a.byId))};return d.add(a),i?a(i):c().then(a),()=>{e=!1,d.delete(a)}},[]),{getCaps:(0,n.useCallback)(t=>(function(e,t,a){if(!a)return null;if(e[a])return e[a];let n=a.includes("/")?a.slice(a.indexOf("/")+1):a;if(t[n])return t[n];let i=a.includes("/")?a.slice(0,a.indexOf("/")):null,o=i?s.js[i]||i:null,l=(0,r.nl)(o,n);return{vision:l.vision,search:l.search,reasoning:l.reasoning,contextWindow:l.contextWindow,maxOutput:l.maxOutput}})(e,a,t),[e,a])}}window.addEventListener("customModelChanged",()=>{(i=null,o=null,c()).then(e=>{for(let t of d)t(e)})})},1620:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(12115),r=a(22723);function s(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function o(){return!1}function l(){let{theme:e,setTheme:t,toggleTheme:a,initTheme:l}=(0,r.A)(),d=(0,n.useSyncExternalStore)(s,i,o);(0,n.useEffect)(()=>{l()},[l]),(0,n.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>l();return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,l]);let c="dark"===e||"system"===e&&d;return{theme:e,setTheme:t,toggleTheme:a,isDark:c}}},4823:(e,t,a)=>{a.d(t,{default:()=>m});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(84588),l=a(98),d=a(56061);let c="__none__",u=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round-robin"},{value:"random",label:"Random"}];function m({providerId:e}){let[t,a]=(0,r.useState)([]),[s,i]=(0,r.useState)(c),[p,x]=(0,r.useState)("none"),[h,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let t=!1;return Promise.all([fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.ok?e.json():{proxyPools:[]}),fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{})]).then(([n,r])=>{if(t)return;a(n.proxyPools||[]);let s=(r.providerStrategies||{})[e]||{};i(s.proxyPoolId||c),x(s.rotateStrategy||"none")}).catch(()=>{}),()=>{t=!0}},[e]);let v=(0,r.useCallback)(async(t,a)=>{g(!0);try{let n=await fetch("/api/settings",{cache:"no-store"}),r=(n.ok?await n.json():{}).providerStrategies||{},s={...r[e]||{}};t===c?delete s.proxyPoolId:s.proxyPoolId=t,"none"===a?delete s.rotateStrategy:s.rotateStrategy=a;let i={...r};0===Object.keys(s).length?delete i[e]:i[e]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})}),b(!0),setTimeout(()=>b(!1),1500)}catch(e){console.log("Save proxy config error:",e)}finally{g(!1)}},[e]),y=t.length>=2,k="none"!==p;return(0,n.jsxs)(o.default,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),f&&(0,n.jsx)(d.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,n.jsx)(l.default,{label:"Proxy Pool",value:s,onChange:e=>{var t;i(t=e.target.value),v(t,p)},disabled:h||k,options:[{value:c,label:"None (direct)"},...t.map(e=>({value:e.id,label:e.name}))],hint:k?"Pool selector is ignored when rotation is active — all active pools are used.":void 0}),(0,n.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Rotation Strategy"}),(0,n.jsx)("select",{value:p,onChange:e=>{var t;x(t=e.target.value),v(s,t)},disabled:h,className:"py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all disabled:opacity-50",children:u.map(e=>(0,n.jsx)("option",{value:e.value,disabled:"none"!==e.value&&!y,children:e.label},e.value))}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:y?k?"round-robin"===p?`Rotating through all ${t.length} active pools in order. State is in-memory (resets on restart).`:`Picking a random pool from ${t.length} active pools each request.`:"Uses the selected pool above. Set to Round-robin or Random to rotate across all active pools.":"Need at least 2 active proxy pools for rotation."})]})]})}m.propTypes={providerId:i().string.isRequired}},5293:(e,t,a)=>{a.d(t,{C:()=>s});var n=a(12115);async function r(e){try{let t="u">typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0;let a="u">typeof document?document:null;if(!a?.body)return!1;let n=a.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",a.body.appendChild(n),n.select();let r=a.execCommand("copy");return a.body.removeChild(n),!1!==r}catch{return!1}}function s(e=2e3){let[t,a]=(0,n.useState)(null),i=(0,n.useRef)(null);return{copied:t,copy:(0,n.useCallback)(async(t,n="default")=>!!await r(t)&&(a(n),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{a(null)},e),!0),[e])}}},7648:(e,t,a)=>{a.d(t,{default:()=>h});var n=a(95155),r=a(12115),s=a(73321),i=a(65921),o=a(92622),l=a(24747);let d="omnihilbras-sidebar-collapsed",c=new Set;function u(e){return c.add(e),()=>c.delete(e)}function m(){try{return"true"===localStorage.getItem(d)}catch{return!1}}function p(){return!1}function x(){let e=!m();try{localStorage.setItem(d,String(e))}catch{}for(let e of c)e()}function h({children:e}){let[t,d]=(0,r.useState)(!1),c=(0,r.useSyncExternalStore)(u,m,p),g=(0,s.usePathname)(),f=(0,i.i)(e=>e.notifications),b=(0,i.i)(e=>e.removeNotification);return(0,r.useEffect)(()=>{let e=()=>{a.e(6808).then(a.bind(a,6808)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(1649),a.e(124)]).then(a.bind(a,10124)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(8569),a.e(2435)]).then(a.bind(a,82435)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(8569),a.e(5462)]).then(a.bind(a,65462)).catch(()=>{})};{if("requestIdleCallback"in window){let t=window.requestIdleCallback(e,{timeout:4e3});return()=>window.cancelIdleCallback(t)}let t=setTimeout(e,2500);return()=>clearTimeout(t)}},[]),(0,n.jsxs)("div",{className:"dashboard-shell flex h-screen w-full overflow-hidden bg-bg text-text",children:[(0,n.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:f.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-success/30 bg-success/10 text-success",icon:"check_circle"}:"error"===t?{wrapper:"border-danger/30 bg-danger/10 text-danger",icon:"error"}:"warning"===t?{wrapper:"border-warning/30 bg-warning/10 text-warning",icon:"warning"}:{wrapper:"border-info/30 bg-info/10 text-info",icon:"info"};return(0,n.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-elev ${a.wrapper}`,children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,n.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,n.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,n.jsx)("button",{type:"button",onClick:()=>b(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,n.jsx)("div",{className:"fixed inset-0 z-40 bg-black/45 lg:hidden",onClick:()=>d(!1),"aria-label":"Close dashboard navigation"}),(0,n.jsx)("div",{className:"hidden lg:flex",children:(0,n.jsx)(o.default,{collapsed:c,onToggleCollapse:x})}),(0,n.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-200 ease-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,n.jsx)(o.default,{onClose:()=>d(!1)})}),(0,n.jsx)("main",{className:"dashboard-grid-bg flex flex-col flex-1 h-full min-w-0 relative isolate overflow-hidden",children:(0,n.jsxs)("div",{className:"dashboard-content relative z-10 flex flex-col flex-1 min-h-0 mx-auto w-full max-w-[1440px]",children:[(0,n.jsx)(l.default,{onMenuClick:()=>d(!0)}),(0,n.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===g?"":"p-4 sm:p-6 lg:p-8"} ${"/dashboard/basic-chat"===g?"flex flex-col overflow-hidden":""}`,children:(0,n.jsx)("div",{className:`${"/dashboard/basic-chat"===g?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:e})})]})})]})}},8247:(e,t,a)=>{a.d(t,{HY:()=>o,Kw:()=>l});let n={"perplexity-agent":"perplexity","gitlab-duo":"gitlab","vercel-ai-gateway":"vercel","ollama-search":"ollama","minimax-code":"minimax","minimax-code-global":"minimax","duckduckgo-web":"duckai"},r={"nara-router":"bynara-logo-icon-light.svg",tiarina:"Tirina.webp",xkiro:"xkiro-logo.svg","chatgpt-web":"chatgpt.svg","deepseek-web":"deepseek.svg","gemini-web":"gemini.svg","qwen-web":"qwen.svg","tokenharbor-web":"tokenharbor.svg"},s=new Set;function i(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function o(e){let t=i(e);if(!t||s.has(t))return null;let a=r[t];if(a)return`/providers/${a}`;let o=function(e){let t=i(e);if(!t||s.has(t))return"";let a=n[t]||t;return s.has(a)?"":a}(t);return o?`/providers/${o}.png`:null}function l(e){let t=i(e);t&&s.add(t);let a=n[t];a&&s.add(a)}},11910:(e,t,a)=>{a.d(t,{default:()=>s});var n=a(95155),r=a(31474);function s({label:e,type:t="text",placeholder:a,value:i,onChange:o,error:l,hint:d,icon:c,disabled:u=!1,required:m=!1,className:p,inputClassName:x,...h}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",p),children:[e&&(0,n.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,m&&(0,n.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,n.jsxs)("div",{className:"relative",children:[c&&(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,n.jsx)("input",{type:t,placeholder:a,value:i,onChange:o,disabled:u,className:(0,r.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",l&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",x),...h})]}),l&&(0,n.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),l]}),d&&!l&&(0,n.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},21110:(e,t,a)=>{a.d(t,{ThemeProvider:()=>i});var n=a(95155),r=a(12115),s=a(22723);function i({children:e}){let{initTheme:t}=(0,s.A)();return(0,r.useEffect)(()=>{t()},[t]),(0,n.jsx)(n.Fragment,{children:e})}},21931:(e,t,a)=>{a.d(t,{default:()=>d});var n=a(95155),r=a(12115),s=a(47650),i=a(93308),o=a(73006);let l=e=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},km:{name:"ខ្មែរ",flag:"\uD83C\uDDF0\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"},fa:{name:"فارسی",flag:"\uD83C\uDDEE\uD83C\uDDF7"}})[e]||{name:e,flag:"\uD83C\uDF10"};function d({className:e="",isOpen:t,onClose:a,hideTrigger:c=!1}){let[u,m]=(0,r.useState)("en"),[p,x]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),f=(0,r.useRef)(null),b="boolean"==typeof t,v=b?t:h,y=(e,t=u)=>{b?!e&&a&&a(t):g(e)};(0,r.useEffect)(()=>{m(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[]),(0,r.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&y(!1)}if(v)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]);let k=async e=>{if(e!==u&&!p){x(!0);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,o.wn)(),m(e),y(!1,e)}catch(e){console.error("Failed to set locale:",e)}finally{x(!1)}}};return(0,n.jsxs)("div",{className:e,children:[!c&&(0,n.jsxs)("button",{onClick:()=>y(!v),disabled:p,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,n.jsx)("span",{className:"text-sm font-medium",children:l(u).name}),(0,n.jsx)("span",{className:"text-lg",children:l(u).flag})]}),v&&(0,s.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>y(!1)}),(0,n.jsxs)("div",{ref:f,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,n.jsx)("button",{onClick:()=>y(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,n.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,n.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:i.YZ.map(e=>{let t=u===e,a=l(e);return(0,n.jsxs)("button",{onClick:()=>k(e),disabled:p,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${t?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${p?"opacity-70 cursor-wait":""}`,title:a.name,children:[(0,n.jsx)("span",{className:"text-2xl",children:a.flag}),(0,n.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:a.name}),t&&(0,n.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},e)})})})]})]}),document.body)]})}},23308:(e,t,a)=>{a.d(t,{default:()=>l});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);function l({isOpen:e,providerInfo:t,onSuccess:a,onClose:s}){let[i,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),[y,k]=(0,r.useState)(null),j=(0,r.useRef)(null),w=()=>{try{j.current?.close()}catch{}d(null),u(""),p(""),f(null),h(!1),v(""),k(null),s()},N=async()=>{f(null),h(!0);try{let e=`${window.location.origin}/callback`,t=await fetch(`/api/oauth/tokenharbor/authorize?redirect_uri=${encodeURIComponent(e)}`),a=await t.json();if(!t.ok)throw Error(a.error||"Could not start the login");k(a),j.current=window.open(a.authUrl,"tokenharbor_login","width=600,height=700"),j.current||f("The login window was blocked. Allow popups for this site and try again.")}catch(e){f(e.message)}finally{h(!1)}},C=async()=>{if(!b.trim())return void f("Paste the URL shown in the login window");h(!0),f(null);try{let e=await fetch("/api/oauth/tokenharbor/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:b.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Could not complete the login");a?.(),w()}catch(e){f(e.message)}finally{h(!1)}},S=async()=>{if(!c.trim()||!m)return void f("Email and password are required");h(!0),f(null);try{let e=await fetch("/api/oauth/tokenharbor/password-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c.trim(),password:m})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");p(""),a?.(),w()}catch(e){f(e.message)}finally{h(!1)}};return e?(0,n.jsx)(o.aF,{isOpen:e,title:"Connect Token Harbor",onClose:w,size:"lg",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[!i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Sign in to read your Token Harbor wallet balance in the Quota Tracker."}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("button",{onClick:()=>d("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Sign in with Google"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Opens Token Harbor's own login page"})]})]}),(0,n.jsxs)("button",{onClick:()=>d("password"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Email & password"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"For accounts using a password"})]})]})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Your model API key is set separately — this login only reads your wallet."})]}),"oauth"===i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"A login window opens on Token Harbor's site. After signing in with Google, GitHub or email, the page shows a plain address — copy that whole URL and paste it below to finish connecting."}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(o.$n,{onClick:N,fullWidth:!0,disabled:x,loading:x,children:y?"Open login again":"Sign in with Google"}),(0,n.jsx)(o.$n,{onClick:()=>{d(null),f(null)},variant:"ghost",fullWidth:!0,children:"Back"})]}),(0,n.jsx)(o.pd,{label:"Paste the URL from the login window",value:b,onChange:e=>v(e.target.value),placeholder:"https://tokenharbor.ai/robots.txt?code=...",hint:"The address bar of the login window — copy the whole thing, including ?code=...",inputClassName:"font-mono text-xs"}),g&&(0,n.jsx)("p",{className:"text-sm text-red-500",children:g}),(0,n.jsx)(o.$n,{onClick:C,fullWidth:!0,disabled:!b.trim()||x,loading:x,children:"Connect"})]}),"password"===i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Use the email and password of your Token Harbor account."}),(0,n.jsx)(o.pd,{label:"Email",type:"email",value:c,onChange:e=>u(e.target.value),placeholder:"you@example.com",autoComplete:"username"}),(0,n.jsx)(o.pd,{label:"Password",type:"password",value:m,onChange:e=>p(e.target.value),placeholder:"Your Token Harbor password",autoComplete:"current-password"}),g&&(0,n.jsx)("p",{className:"text-sm text-red-500",children:g}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(o.$n,{onClick:S,fullWidth:!0,disabled:!c.trim()||!m||x,loading:x,children:"Connect"}),(0,n.jsx)(o.$n,{onClick:()=>{d(null),f(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}l.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},23615:(e,t,a)=>{a.d(t,{default:()=>i});var n=a(95155),r=a(12115),s=a(84588);function i(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[o,l]=(0,r.useState)(!0);(0,r.useEffect)(()=>{d()},[]),(0,r.useEffect)(()=>{let e;return o&&(e=setInterval(()=>{("u"<typeof document||!document.hidden)&&d(!1)},3e3)),()=>clearInterval(e)},[o]);let d=async(e=!0)=>{e&&i(!0);try{let e=await fetch("/api/usage/request-logs");if(e.ok){let a=await e.json();t(a)}}catch(e){console.error("Failed to fetch logs:",e)}finally{e&&i(!1)}};return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,n.jsx)("span",{children:"Auto Refresh (3s)"}),(0,n.jsx)("div",{onClick:()=>l(!o),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${o?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,n.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${o?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,n.jsx)(s.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,n.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:a&&0===e.length?(0,n.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,n.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,n.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,n.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,n.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let a=e.split(" | ");if(a.length<7)return null;let r=a[6],s=r.includes("PENDING"),i=r.includes("FAILED"),o=r.includes("OK");return(0,n.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${s?"bg-primary/5":""}`,children:[(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:a[0]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:a[1]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,n.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:a[2]})}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:a[3],children:a[3]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:a[4]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:a[5]}),(0,n.jsx)("td",{className:`px-3 py-1.5 font-bold ${o?"text-success":i?"text-error":"text-primary animate-pulse"}`,children:r})]},t)})})]})})}),(0,n.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},23936:(e,t,a)=>{a.d(t,{default:()=>l});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);function l({isOpen:e,onSuccess:t,onClose:a}){let[s,i]=(0,r.useState)(""),[d,c]=(0,r.useState)(!1),[u,m]=(0,r.useState)(null),[p,x]=(0,r.useState)(!1),h=async()=>{if(!s.trim())return void m("Please paste your cookie");c(!0),m(null);try{let e=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:s.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"Authentication failed");x(!0),setTimeout(()=>{t?.(),g()},1500)}catch(e){m(e.message)}finally{c(!1)}},g=()=>{i(""),m(null),x(!1),a?.()};return(0,n.jsx)(o.aF,{isOpen:e,onClose:g,title:"iFlow Cookie Authentication",children:(0,n.jsx)("div",{className:"space-y-4",children:p?(0,n.jsxs)("div",{className:"text-center py-8",children:[(0,n.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,n.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,n.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,n.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,n.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,n.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,n.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,n.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,n.jsx)("li",{children:"Login to your account"}),(0,n.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,n.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,n.jsx)("li",{children:"Paste it below"})]})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,n.jsx)("textarea",{value:s,onChange:e=>i(e.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:d})]}),u&&(0,n.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,n.jsx)("p",{className:"text-sm text-error",children:u})}),(0,n.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,n.jsx)(o.$n,{variant:"secondary",onClick:g,disabled:d,fullWidth:!0,children:"Cancel"}),(0,n.jsx)(o.$n,{onClick:h,loading:d,fullWidth:!0,children:"Authenticate"})]})]})})})}l.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func}},24747:(e,t,a)=>{a.d(t,{default:()=>S});var n=a(95155),r=a(12115),s=a(73321),i=a(98500),o=a.n(i),l=a(14051),d=a.n(l),c=a(57250),u=a(80752),m=a(93308),p=a(38202),x=a(21931);function h(){let[e,t]=(0,r.useState)(!1),[a,s]=(0,r.useState)("en");return(0,r.useEffect)(()=>{s(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${m.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,m.QC)(t)}())},[e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>t(!0),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Language","data-i18n-skip":"true",children:(0,n.jsx)("span",{className:"text-lg leading-none",children:p.h[a]||"\uD83C\uDF10"})}),(0,n.jsx)(x.default,{hideTrigger:!0,isOpen:e,onClose:e=>{t(!1),s(e)}})]})}var g=a(38587),f=a(47650),b=a(90620);function v({isOpen:e,onClose:t}){let[a,s]=(0,r.useState)(null),[i,o]=(0,r.useState)(!1),[l,d]=(0,r.useState)(""),c=(0,r.useRef)(null);return((0,r.useEffect)(()=>{e&&!a&&(o(!0),d(""),fetch(b.Nu.donateUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>s(e)).catch(e=>d(e.message||"Failed to load")).finally(()=>o(!1)))},[e,a]),(0,r.useEffect)(()=>{let a=e=>{c.current&&!c.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,f.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,n.jsxs)("div",{ref:c,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,n.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-pink-500",children:"volunteer_activism"}),a?.title||"Support OmniHilbras"]}),(0,n.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,n.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[i&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),l&&(0,n.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load donate info: ",l]}),!i&&!l&&a&&(0,n.jsxs)(n.Fragment,{children:[a.message&&(0,n.jsx)("p",{className:"text-text-muted text-sm mb-6 text-center",children:a.message}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:a.channels?.map(e=>(0,n.jsx)(y,{channel:e},e.id))})]})]})]})]}),document.body)}function y({channel:e}){let{label:t,description:a,icon:r,color:s,url:i,qr:o}=e,l=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:`${s}20`,color:s},children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:r})}),(0,n.jsx)("div",{className:"font-semibold text-text-main mb-1",children:t}),a&&(0,n.jsx)("div",{className:"text-xs text-text-muted mb-3 text-center",children:a}),o&&(0,n.jsx)("img",{src:o,alt:`${t} QR`,className:"w-full max-w-[180px] aspect-square object-contain rounded-lg bg-white p-1",loading:"lazy",decoding:"async"})]});return(0,n.jsxs)("div",{className:"flex flex-col items-center p-4 rounded-xl border border-black/10 dark:border-white/10 bg-surface/50 hover:border-pink-500/40 transition-colors",children:[l,i&&(0,n.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium text-white hover:opacity-90 transition-opacity",style:{backgroundColor:s},children:["Open",(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"})]})]})}v.propTypes={isOpen:d().bool.isRequired,onClose:d().func.isRequired};var k=a(38003),j=a(65921),w=a(88105),N=a(8247),C=a(73006);function S({onMenuClick:e,showMenuButton:t=!0}){let a=(0,s.usePathname)(),[i,l]=(0,r.useState)(""),[d,m]=(0,r.useState)(""),[p,x]=(0,r.useState)(!1),f=(0,j.i)(),{title:y,description:k,icon:W,breadcrumbs:T}=(0,r.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(t){let e=t[1],a=t[2];if("combo"===e)return{title:"Combo",description:"",breadcrumbs:[{label:"Combos",href:"/dashboard/combos"},{label:"Combo"}]};let n=w.rj.find(t=>t.id===e),r=w.Q2[a];return{title:r?.name||a,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:n?.label||e,href:`/dashboard/media-providers/${e}`},{label:r?.name||a,image:(0,N.HY)(a)}]}}let a=e.match(/\/media-providers\/([^/]+)$/);if(a){let e=a[1];if("web"===e)return{title:"Web Fetch & Search",description:"Manage your web fetch and search providers",icon:"travel_explore",breadcrumbs:[]};let t=w.rj.find(t=>t.id===e);return{title:t?.label||e,description:`Manage your ${t?.label||e} providers`,icon:t?.icon||"perm_media",breadcrumbs:[]}}let n=e.match(/\/providers\/([^/]+)$/);if(n){let e=n[1],t=b.zN[e]||b.fg[e];if(t)return{title:t.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:t.name,image:(0,N.HY)(t.id)}]}}return e.includes("/providers")&&!e.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:e.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:e.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:e.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through OmniHilbras",icon:"security",breadcrumbs:[]}:e.includes("/token-saver")?{title:"Token Saver",description:"Compress prompts and outputs to save tokens",icon:"savings",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:e.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:e.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use OmniHilbras — no install needed",icon:"extension",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(a),[a]);(0,r.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let a=await t.json();e||(l(a?.displayName||a?.samlName||a?.samlEmail||a?.oidcName||a?.oidcEmail||""),m(a?.loginMethod||""))}catch{e||(l(""),m(""))}}(),()=>{e=!0}},[]);let F=async()=>{try{if((await fetch("/api/auth/logout",{method:"POST"})).ok)return void window.location.assign("/login");f.error("Logout failed. Please try again.")}catch(e){console.error("Failed to logout:",e),f.error("Logout failed. Please try again.")}};return(0,n.jsxs)("header",{className:"dashboard-header shrink-0 flex items-center justify-between gap-3 px-4 sm:px-6 lg:px-8 min-h-[64px] border-b border-border bg-bg z-20",children:[(0,n.jsx)("div",{className:"flex items-center gap-3 lg:hidden shrink-0",children:t&&(0,n.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,n.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,n.jsx)("div",{className:"flex flex-col min-w-0 flex-1",children:T.length>0?(0,n.jsx)("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:T.map((e,t)=>(0,n.jsxs)("div",{className:`items-center gap-1.5 sm:gap-2 min-w-0 ${t<T.length-1?"hidden sm:flex shrink-0":"flex flex-1"}`,children:[t>0&&(0,n.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base hidden sm:inline",children:"chevron_right"}),e.href?(0,n.jsx)(o(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors truncate",children:e.label}):(0,n.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:[e.image&&(0,n.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[24px] max-h-[24px] sm:max-w-[28px] sm:max-h-[28px] shrink-0",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,n.jsx)("h1",{className:"text-base lg:text-2xl font-semibold text-text-main tracking-tight truncate",children:(0,C.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):y?(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[W&&(0,n.jsx)("span",{className:"material-symbols-outlined text-primary text-xl lg:text-2xl",children:W}),(0,n.jsx)("h1",{className:"text-base lg:text-2xl font-semibold tracking-tight truncate",children:(0,C.Tl)(y)})]}),k&&(0,n.jsx)("p",{className:"hidden lg:block text-sm text-text-muted truncate",children:(0,C.Tl)(k)})]}):null}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[i&&("OIDC"===d||"SAML"===d)&&(0,n.jsxs)("div",{className:"hidden sm:flex items-center max-w-[220px] px-3 py-1.5 rounded-full border border-border bg-surface/70 text-xs text-text-muted truncate",title:i,children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1.5 text-primary",children:"person"}),(0,n.jsx)("span",{className:"truncate",children:i}),(0,n.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:d})]}),(0,n.jsx)(O,{}),!1,(0,n.jsx)(g.default,{}),(0,n.jsx)(h,{}),(0,n.jsx)(u.default,{onLogout:F})]}),(0,n.jsx)(v,{isOpen:p,onClose:()=>x(!1)})]})}function O(){let e=(0,k.C)(e=>e.visible),t=(0,k.C)(e=>e.query),a=(0,k.C)(e=>e.placeholder),r=(0,k.C)(e=>e.setQuery);return e?(0,n.jsxs)("div",{className:"relative w-[160px] sm:w-[220px]",children:[(0,n.jsx)("span",{className:"material-symbols-outlined absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[16px] pointer-events-none",children:"search"}),(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),placeholder:a,className:"w-full h-8 pl-7 pr-7 rounded-lg border border-border bg-surface/60 text-sm focus:outline-none focus:border-primary/50 transition-colors"}),t&&(0,n.jsx)("button",{type:"button",onClick:()=>r(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded","aria-label":"Clear search",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}):null}S.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},25086:(e,t,a)=>{a.d(t,{CardSkeleton:()=>i,Skeleton:()=>s});var n=a(95155),r=a(31474);function s({className:e,...t}){return(0,n.jsx)("div",{className:(0,r.cn)("animate-pulse rounded-[10px] bg-surface-2",e),...t})}function i(){return(0,n.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)(s,{className:"h-4 w-24"}),(0,n.jsx)(s,{className:"size-10 rounded-[10px]"})]}),(0,n.jsx)(s,{className:"h-8 w-16 mb-2"}),(0,n.jsx)(s,{className:"h-3 w-20"})]})}},27932:(e,t,a)=>{a.d(t,{default:()=>c});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);let l={"chatgpt-web":{id:"chatgpt-web",name:"ChatGPT Web",website:"https://chatgpt.com",credentialName:"__Secure-next-auth.session-token",extractionSteps:[{label:"Copy the header",body:"With chatgpt.com open and signed in: F12 → Network → reload → click any request to chatgpt.com → Headers → Request Headers → Cookie. Copy that entire line and paste it here. Do not use the Console — the session cookie is HttpOnly, so no console command can read it."},{label:"Or the Application panel",body:"F12 → Application → Storage → Cookies → https://chatgpt.com. Copy the whole value of `__Secure-next-auth.session-token`. If it is split into numbered rows, join them in order with no separator."},{label:"Or run this in the console",body:"Copies what the page can see and tells you whether you are signed in. The session cookie itself is HttpOnly, so **no** console command can read it — the line says so and points at the Network tab.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.some(x => x.startsWith('__Secure-next-auth.callback-url=')) ? 'You are signed in. The session cookie is HttpOnly, so the console cannot copy it — use the Network tab (F12 → Network → reload → a request to chatgpt.com → Request Headers → Cookie) and copy that whole line.' : 'No sign-in cookie here — sign in at chatgpt.com first.'); copy(c.join('; ')); })()"}],paste:{field:"storageState",placeholder:"__Secure-next-auth.session-token=…; oai-did=…",supportsFreeOnly:!0,sectionLabel:"Or paste a session cookie instead",fieldLabel:"Session cookie"},planNote:"Only chatgpt.com and openai.com cookies are kept. Anything else in the export is dropped before it is stored."},"qwen-web":{id:"qwen-web",name:"Qwen Web",website:"https://chat.qwen.ai",credentialName:"Cookie header from auth.qwen.ai",extractionSteps:[{label:"Copy the auth cookie",body:"Sign in at chat.qwen.ai. Then: F12 → Application → Storage → Cookies → **https://auth.qwen.ai**, and copy the cookies for that host. If you would rather use the Network tab, reload, click a request to auth.qwen.ai, and copy its **Request Headers → Cookie** value. The session cookie is HttpOnly, so no console command can read it — the Application panel is the way."},{label:"Or run this on the auth page",body:"Open **auth.qwen.ai** (the origin the cookie belongs to) and run this there. It copies the cookies that origin can see and says whether the session cookie is among them.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.length ? 'Copied the cookies this origin can see. If the check still refuses them, the session cookie is HttpOnly — copy it from F12 → Application → Storage → Cookies → https://auth.qwen.ai.' : 'Nothing readable here — the session cookie is HttpOnly. Copy it from F12 → Application → Storage → Cookies → https://auth.qwen.ai.'); copy(c.join('; ')); })()"},{label:"What happens next",body:"OmniHilbras asks three questions and shows you the answers: whether the credential means anything to auth.qwen.ai, what models Qwen serves, and whether a turn is actually served. Qwen refuses bot-protected requests with **HTTP 200 and a refusal in the body**, so the probe reads the body rather than the status code — nothing is saved either way until a turn really works."}],paste:{field:"cookieHeader",placeholder:"name=value; name2=value2",sectionLabel:"Or paste a cookie header instead",fieldLabel:"Cookie header"},planNote:"Qwen serves its models to guests, so the catalog is real even when a turn is not. The card says which of the two you are looking at."},"deepseek-web":{id:"deepseek-web",name:"DeepSeek Web",website:"https://chat.deepseek.com",credentialName:"userToken",extractionSteps:[{label:"Fastest",body:"With chat.deepseek.com signed in, open the developer tools (F12) → Console, paste this line and press Enter. It copies the userToken.",snippet:"copy(JSON.parse(localStorage.userToken).value)"},{label:"If the copied value is empty",body:'`{"value":null}` means the page has no session, so you are signed out. Sign in at chat.deepseek.com first, then copy it again.'}],paste:{field:"userToken",placeholder:'userToken value, or {"value":"…"}',sectionLabel:"Or paste a userToken instead",fieldLabel:"userToken"},planNote:"DeepSeek Web serves the same models to every account, so there is no plan to read and nothing is narrowed."},"tokenharbor-web":{id:"tokenharbor-web",name:"Token Harbor Web",website:"https://tokenharbor.ai/chat",credentialName:"sb-auth-auth-token",extractionSteps:[{label:"Copy the Cookie header",body:"With tokenharbor.ai open and signed in: F12 → Network → reload → click any request to tokenharbor.ai → Headers → Request Headers → Cookie. Copy that entire line and paste it here. It carries the Cloudflare clearance alongside the session, and both are wanted."},{label:"Or the Application panel",body:"F12 → Application → Storage → Cookies → https://tokenharbor.ai, and copy the value of `sb-auth-auth-token`. If it is split into numbered rows (`.0`, `.1`), copy them all — they are rejoined in order for you."},{label:"Or the console",body:"With tokenharbor.ai open and signed in, open F12 → Console, paste this line and press Enter. It copies the session cookies (the chunks in order, plus cf_clearance) to your clipboard. This only works when the cookie is not HttpOnly; if nothing is copied, use one of the steps above.",snippet:"copy(document.cookie.split('; ').filter((c) => c.startsWith('sb-auth-auth-token') || c.startsWith('cf_clearance')).sort((a, b) => a.localeCompare(b, undefined, { numeric: true })).join('; '))"},{label:"What happens next",body:"Check asks tokenharbor.ai whether the session is accepted, by reading your profile. Nothing is stored unless you press Save, and the check is a credential check — whether a model can answer is only known by sending a turn."}],paste:{field:"cookieHeader",placeholder:"sb-auth-auth-token=base64-...; cf_clearance=...",supportsFreeOnly:!0,sectionLabel:"Or paste a session cookie instead",fieldLabel:"Cookie header or session cookie"},planNote:'Token Harbor serves its catalog to every account; the ":free" models are the ones that never bill.'},"gemini-web":{id:"gemini-web",name:"Gemini Web",website:"https://gemini.google.com",credentialName:"__Secure-1PSID",extractionSteps:[{label:"The two cookies",body:"With gemini.google.com open and signed in: F12 → Application → Storage → Cookies → **https://gemini.google.com**. Copy the values of `__Secure-1PSID` and `__Secure-1PSIDTS` and paste them here as `__Secure-1PSID=...; __Secure-1PSIDTS=...`. Do not use the Console — `__Secure-1PSID` is HttpOnly, so no console command can read it."},{label:"Or the request header",body:"F12 → Network → reload → click any request to gemini.google.com → Headers → Request Headers → Cookie. Copy that entire line."},{label:"Or run this in the console",body:"Copies the cookies the page can see. `__Secure-1PSID` is HttpOnly, so the console cannot read it — the line says so and points at the Application panel.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.some(x => x.startsWith('__Secure-1PSID')) ? 'Copied. If the check still refuses them, __Secure-1PSID is HttpOnly — copy it from F12 → Application → Storage → Cookies → https://gemini.google.com.' : '__Secure-1PSID is HttpOnly — the console cannot read it. Copy it from F12 → Application → Storage → Cookies → https://gemini.google.com.'); copy(c.join('; ')); })()"},{label:"What happens next",body:"Check opens gemini.google.com in a browser on this machine and reports whether the session is signed in — cookie presence and expiry are local checks and neither can tell a working session from one Google has revoked. Nothing is stored unless you press Save. A turn is sent by driving the page: it is slower than an API and there is a browser in the path by design."}],paste:{field:"cookieHeader",placeholder:"__Secure-1PSID=...; __Secure-1PSIDTS=...",sectionLabel:"Or paste the cookies instead",fieldLabel:"Cookie header, or the __Secure-1PSID value"},planNote:"Gemini Web drives the page, so the model list is the modes the page offers (3.1 Pro, 3.7 Flash, 3.1 Flash-Lite), not Google's API model ids."},"duckduckgo-web":{id:"duckduckgo-web",name:"Duck.ai",website:"https://duck.ai",credentialName:"Nothing — no cookie is required",extractionSteps:[{label:"Nothing to export",body:"Duck.ai answers signed-out visitors, so there is no cookie to copy. You can press Check and then Save with the field below empty, and the connection will work."},{label:"If you would rather send your browser session",body:"With duck.ai open: F12 → Network → reload → click any request to duck.ai → Headers → Request Headers → Cookie. Copy that entire line and paste it here. OmniHilbras does not read it — the service does not either — so it cannot tell you whether the cookie is valid, and Check will say so rather than claiming otherwise.",snippet:"copy(document.cookie)"},{label:"What happens next",body:"Check asks duck.ai for its anti-bot challenge and solves it here, then reports the free models it offers. What it proves is that the endpoint answered and served a solvable challenge — not that a turn will always succeed. A refusal carrying HTTP 418 is a rate limit rather than a broken key: the same request was measured failing 43 seconds after a success and working 4.9 minutes later, so back off rather than retrying."}],optionalCredential:!0,paste:{field:"cookieHeader",placeholder:"Leave empty — or paste the whole Cookie: line from duck.ai",sectionLabel:"Or paste a cookie you would rather send along",fieldLabel:"Cookie header"},planNote:"Only the free lineup is served without a subscription. The list is read from each model's own `accessTier` and changes with duck.ai, so it is reported at connect time rather than written on the card."}};var d=a(5293);function c({isOpen:e,providerId:t,onSuccess:a,onClose:s}){let[i,u]=(0,r.useState)(""),[m,p]=(0,r.useState)(!1),[x,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),y=t&&l[t]||null,{copied:k,copy:j}=(0,d.C)(),w=()=>{u(""),f(null),v(null),p(!1),h(!1),s?.()},N=async e=>{let a=await fetch(`/api/providers/web-session/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,credential:i.trim()})}),n=await a.json().catch(()=>({}));if(!a.ok)throw Error(n.error||"Request failed");return n},C=async()=>{p(!0),f(null);try{let e=await N("check");v(e),!1===e.ok&&e.error&&f(e.error)}catch(e){f(e.message)}finally{p(!1)}},S=async()=>{h(!0),f(null);try{await N("connect"),a?.(),w()}catch(e){f(e.message)}finally{h(!1)}};if(!e||!y)return null;let O=y.optionalCredential||i.trim().length>0,W=m||x;return(0,n.jsx)(o.aF,{isOpen:e,onClose:w,title:`Connect ${y.name}`,size:"lg",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:[y.name," is reached with a session your browser already holds, not with an API key. Sign in at"," ",(0,n.jsx)("a",{href:y.website,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:y.website})," ","first, then copy the credential below."]}),(0,n.jsx)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-3",children:y.extractionSteps.map((e,t)=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("p",{className:"font-medium text-text-primary",children:[t+1,". ",e.label]}),(0,n.jsx)("p",{className:"text-text-muted",children:e.body}),e.snippet&&(0,n.jsx)("button",{type:"button",onClick:()=>j(e.snippet,e.snippet),title:"Copy this line, then paste it in the browser console",className:"block w-full overflow-x-auto rounded border border-line bg-sidebar px-2 py-1 text-left font-mono text-[11px] text-text-primary transition-colors hover:border-gold/50",children:k===e.snippet?"Copied — paste it in the console":e.snippet})]},e.label))}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:y.paste?.fieldLabel||y.credentialName}),(0,n.jsx)("textarea",{value:i,onChange:e=>{u(e.target.value),v(null)},placeholder:y.paste?.placeholder||y.credentialName,className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:W}),(0,n.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Needs: ",y.credentialName]})]}),b&&(0,n.jsxs)("div",{className:`p-3 rounded-lg border text-sm ${b.ok?"bg-success/10 border-success/20 text-text-primary":"bg-error/10 border-error/20 text-error"}`,children:[(0,n.jsx)("p",{children:b.detail||(b.ok?"The credential works.":"The provider refused the credential.")}),Array.isArray(b.models)&&b.models.length>0&&(0,n.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Models available: ",b.models.slice(0,12).join(", "),b.models.length>12?` +${b.models.length-12} more`:""]})]}),g&&(0,n.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,n.jsx)("p",{className:"text-sm text-error",children:g})}),y.planNote&&(0,n.jsx)("p",{className:"text-[11px] text-text-muted",children:y.planNote}),(0,n.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,n.jsx)(o.$n,{variant:"secondary",onClick:w,disabled:W,fullWidth:!0,children:"Cancel"}),(0,n.jsx)(o.$n,{variant:"secondary",onClick:C,disabled:!O||W,loading:m,fullWidth:!0,children:"Check"}),(0,n.jsx)(o.$n,{onClick:S,disabled:!O||W,loading:x,fullWidth:!0,children:"Save"})]})]})})}c.propTypes={isOpen:i().bool.isRequired,providerId:i().string,onSuccess:i().func,onClose:i().func}},28011:(e,t,a)=>{a.d(t,{default:()=>y});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(81127),l=a(57250),d=a(29366),c=a(929),u=a(28777),m=a(88105);function p(e){if(!e||"string"!=typeof e)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};let t=e.trim();if(!t)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};if(t.startsWith("/")){let e=t.match(/^\/(.+)\/([a-z]*)$/i);if(e)try{let a=e[2]||"i",n=new RegExp(e[1],a);return{raw:t,isEmpty:!1,isRegex:!0,regex:n,positiveTerms:[],negativeTerms:[]}}catch{}else if(t.length>1)try{let e=RegExp(t.slice(1),"i");return{raw:t,isEmpty:!1,isRegex:!0,regex:e,positiveTerms:[],negativeTerms:[]}}catch{}}let a=t.split(/\s+/),n=[],r=[];for(let e of a)e&&((e.startsWith("!")||e.startsWith("-"))&&e.length>1?r.push(e.slice(1).toLowerCase()):n.push(e.toLowerCase()));return{raw:t,isEmpty:0===n.length&&0===r.length,isRegex:!1,regex:null,positiveTerms:n,negativeTerms:r}}function x(e,t){let a="string"!=typeof t&&t?t:p(t);if(a.isEmpty)return!0;let n=[];if("string"==typeof e?n=[e]:Array.isArray(e)?n=e.filter(e=>"string"==typeof e):e&&"object"==typeof e&&(n=[e.name,e.id,e.value,e.alias,e.provider].filter(e=>"string"==typeof e)),0===n.length)return!1;if(a.isRegex&&a.regex){let e=n.join(" ");return/\(\?!|\(\?<!/.test(a.raw)?a.regex.test(e):n.some(e=>a.regex.test(e))||a.regex.test(e)}let r=n.map(e=>e.toLowerCase());if(a.negativeTerms.length>0){for(let e of a.negativeTerms)if(r.some(t=>t.includes(e)))return!1}if(a.positiveTerms.length>0){for(let e of a.positiveTerms)if(!r.some(t=>t.includes(e)))return!1}return!0}var h=a(70217);let g=[...Object.keys(m.zN),...Object.keys(m.IS),...Object.keys(m.nJ),...Object.keys(m.fg)],f=Object.keys(m.IS).filter(e=>m.IS[e].noAuth),b=["cursor","cline","clinepass","zed"];function v(e,t,a){let[n,s]=(0,r.useState)([]),i=(t??[]).join("|");return(0,r.useEffect)(()=>{let t=i?i.split("|"):[];if(!e||0===t.length)return void s([]);let n=!1;return Promise.all(t.map(async e=>{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let a=await t.json();return Array.isArray(a.models)?a.models:[]})).then(e=>{if(n)return;let t=new Set;s(e.flat().filter(e=>!(!e?.id||t.has(e.id))&&(t.add(e.id),!0)))}).catch(e=>{console.warn(`Unable to load ${a} models for selector:`,e),n||s([])}),()=>{n=!0}},[e,i,a]),n}function y({isOpen:e,onClose:t,onSelect:a,onDeselect:s,onSelectBatch:i,onDeselectBatch:k,selectedModel:j,activeProviders:w=[],title:N="Select Model",size:C="lg",modelAliases:S={},kindFilter:O=null,capFilter:W=null,addedModelValues:T=[],closeOnSelect:F=!0,allowProviderWildcard:I=!1}){let[_,P]=(0,r.useState)(null),$=async()=>{try{let e=await fetch("/api/providers");if(!e.ok)throw Error(`Failed to fetch providers: ${e.status}`);let t=await e.json();P(t.connections||[])}catch(e){console.error("Error fetching providers in ModelSelectModal:",e),P([])}};(0,r.useEffect)(()=>{e&&$()},[e]);let E=(0,r.useMemo)(()=>null!==_?_:w||[],[_,w]),A=(0,r.useMemo)(()=>{let e=E.filter(e=>e&&!1!==e.isActive);return O?e.filter(e=>{let t=m.Q2[e.provider];return(t?.serviceKinds||["llm"]).includes(O)}):e},[E,O]),R=(0,r.useMemo)(()=>(0,h.i)(E),[E]),{getCaps:D}=(0,c.y)(),[z,q]=(0,r.useState)(""),[M,L]=(0,r.useState)([]),[U,K]=(0,r.useState)([]),[H,V]=(0,r.useState)([]),[J,B]=(0,r.useState)({}),G=(0,r.useMemo)(()=>{let e=Object.fromEntries(b.map(e=>[e,[]]));for(let t of A)t?.id&&Object.prototype.hasOwnProperty.call(e,t.provider)&&e[t.provider].push(t.id);return e},[A]),Q=G.cursor,Y=G.cline,X=G.clinepass,Z=G.zed,ee=v(e,Q,"Cursor"),et=v(e,Y,"Cline"),ea=v(e,X,"ClinePass"),en=v(e,Z,"Zed"),er=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();L(t.combos||[])}catch(e){console.error("Error fetching combos:",e),L([])}};(0,r.useEffect)(()=>{e&&er()},[e]);let es=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();K(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),K([])}};(0,r.useEffect)(()=>{e&&es()},[e]);let ei=async()=>{try{let e=await fetch("/api/models/custom");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();V(t.models||[])}catch(e){console.error("Error fetching custom models:",e),V([])}};(0,r.useEffect)(()=>{e&&ei()},[e]);let eo=async()=>{try{let e=await fetch("/api/models/disabled");if(!e.ok)throw Error(`Failed to fetch disabled models: ${e.status}`);let t=await e.json();B(t.disabled||{})}catch(e){console.error("Error fetching disabled models:",e),B({})}};(0,r.useEffect)(()=>{e&&eo()},[e]);let el=(0,r.useMemo)(()=>({...m.zN,...m.IS,...m.nJ,...m.fg}),[]),ed=(0,r.useMemo)(()=>{let e={},t=new Set(["webSearch","webFetch"]),a=new Set(["image","tts","stt","embedding","imageToText"]),n=new Set(["tts","image","webFetch"]),r=A.map(e=>e.provider),s=(O?f.filter(e=>(m.Q2[e]?.serviceKinds||["llm"]).includes(O)):f).filter(e=>!R.has(e)),i=new Set((U||[]).map(e=>e?.id).filter(Boolean));return[...new Set([...r,...s,...O?[]:H.map(e=>e.providerAlias).filter(e=>((0,m.mq)(e)||(0,m.gb)(e))&&i.has(e)&&!R.has(e))].filter(e=>!R.has(e)))].sort((e,t)=>{let a=g.indexOf(e),n=g.indexOf(t);return(-1===a?999:a)-(-1===n?999:n)}).forEach(r=>{let s=(0,m.wG)(r),i=el[r]||{name:r,color:"#666"},o=(0,m.mq)(r)||(0,m.gb)(r);if(O&&t.has(O)){e[r]={name:i.name,alias:s,color:i.color,models:[{id:r,name:i.name,value:r}]};return}if(i.passthroughModels){let t=Object.entries(S).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t})),o=H.filter(e=>e.providerAlias===s).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,kind:(0,u.CP)(e),isCustom:!0})),l=t;if(O&&a.has(O)){let e=o.filter(e=>(0,u.CP)(e)===O);0===(l=[...e,...(0,u.KC)(r).filter(e=>(0,u.CP)(e)===O).map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})).filter(t=>!e.some(e=>e.value===t.value))]).length&&n.has(O)&&(i.serviceKinds||["llm"]).includes(O)&&(l=[{id:r,name:i.name,value:s}])}else{let e=o.filter(e=>!(0,u.CP)(e)||"llm"===(0,u.CP)(e)),a=new Set([...t,...e].map(e=>e.value)),n=(0,u.KC)(r).filter(e=>!(0,u.CP)(e)||"llm"===(0,u.CP)(e)).map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})).filter(e=>!a.has(e.value));l=[...e,...t.filter(t=>!e.some(e=>e.value===t.value)),...n]}if(l.length>0){let t=U.find(e=>e.id===r),a=t?.name||i.name;e[r]={name:a,alias:s,color:i.color,models:l}}}else if(o){if(O&&a.has(O))return;let t=A.find(e=>e.provider===r)||E.find(e=>e.provider===r),n=U.find(e=>e.id===r),s=n?.name||t?.name||i.name,o=t?.providerSpecificData?.prefix||n?.prefix||r,l=Object.entries(S).filter(([,e])=>e.startsWith(`${r}/`)).map(([e,t])=>({id:t.replace(`${r}/`,""),name:e,value:`${o}/${t.replace(`${r}/`,"")}`})),d=H.filter(e=>e.providerAlias===r).map(e=>({id:e.id,name:e.name||e.id,value:`${o}/${e.id}`,isCustom:!0})),c=new Set(l.map(e=>e.value)),u=[...l,...d.filter(e=>!c.has(e.value))],m=u.length>0?u:[{id:`__placeholder__${r}`,name:`${o}/model-id`,value:`${o}/model-id`,isPlaceholder:!0}];e[r]={name:s,alias:o,color:i.color,models:m,isCustom:!0,hasModels:u.length>0}}else{var l;let t="cursor"===r?ee:"cline"===r?et:"clinepass"===r?ea:"zed"===r?en:[],o=t.length>0?t:(0,u.KC)(r),d=new Set(o.map(e=>e.id)),c=o.length>0,m=Object.entries(S).filter(([e,t])=>t.startsWith(`${s}/`)&&(!c||e===t.replace(`${s}/`,""))&&!d.has(t.replace(`${s}/`,""))).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t,isCustom:!0})),p=new Set(m.map(e=>e.id)),x=H.filter(e=>e.providerAlias===s&&!d.has(e.id)&&!p.has(e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,isCustom:!0})),h=[...o.map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})),...m,...x],g=new Set,f=(l=h.filter(e=>!g.has(e.value)&&(g.add(e.value),!0)),O?a.has(O)?l.filter(e=>e.isPlaceholder||(0,u.CP)(e)===O):l:l.filter(e=>e.isPlaceholder||e.isCustom||!(0,u.CP)(e)||"llm"===(0,u.CP)(e)));0===f.length&&O&&n.has(O)&&(i.serviceKinds||["llm"]).includes(O)&&(f=[{id:r,name:i.name,value:s}]),f.length>0&&(e[r]={name:i.name,alias:s,color:i.color,models:f})}}),Object.entries(e).forEach(([t,a])=>{let n=new Set([...J[(0,m.wG)(t)]||[],...J[t]||[]]);0!==n.size&&(a.models=a.models.filter(e=>!n.has(e.id)),0===a.models.length&&delete e[t])}),Object.entries(e).forEach(([t,a])=>{let n=A.filter(e=>e.provider===t),r=[];for(let e of n)Array.isArray(e.providerSpecificData?.enabledModels)&&e.providerSpecificData.enabledModels.length>0&&r.push(...e.providerSpecificData.enabledModels);if(r.length>0){let n=new Set(r),s=a.alias||(0,m.wG)(t)||t;a.models=a.models.filter(e=>n.has(e.id)||n.has(e.value)||n.has(`${s}/${e.id}`)||e.value&&n.has(e.value.replace(`${s}/`,""))),0===a.models.length&&delete e[t]}}),e},[A,S,el,U,H,J,O,E,R,ee,et,ea,en]),ec=(0,r.useMemo)(()=>p(z),[z]),eu=(0,r.useMemo)(()=>O||W?[]:ec.isEmpty?M:M.filter(e=>x(e.name,ec)),[M,ec,O,W]),em=(0,r.useMemo)(()=>{let e={};return Object.entries(ed).forEach(([t,a])=>{var n;let r=a.models;if(!W||0!==(r=r.filter(e=>D(e.value)?.[W]===!0)).length){if(!ec.isEmpty){let e=x(a.name,ec),n=I&&(a.alias&&x(a.alias,ec)||t&&x(t,ec)||x(`${a.alias}/*`,ec));if(0===(r=r.filter(t=>!!x(t,ec)||(!!e||!!n)&&(!(ec.negativeTerms.length>0)||x(t,{...ec,positiveTerms:[]})))).length)return}e[t]={...a,models:[...(n=r).filter(e=>T.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name)),...n.filter(e=>!T.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name))]}}}),e},[ed,ec,T,I]),ep=(0,r.useMemo)(()=>{let e=[];return Object.values(em).forEach(t=>{t.models.forEach(t=>{t.isPlaceholder||e.push(t)})}),e},[em]),ex=(0,r.useMemo)(()=>ep.filter(e=>!T.includes(e.value)),[ep,T]),eh=(0,r.useMemo)(()=>ep.filter(e=>T.includes(e.value)),[ep,T]),eg=e=>{let n=e?.value||e?.name||e;T.includes(n)&&s?s(e):a(e),F&&(t(),q(""))};return(0,n.jsxs)(o.default,{isOpen:e,onClose:()=>{t(),q("")},title:N,size:C,className:"p-4!",footer:null,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,n.jsx)("span",{children:I?"Click to add/remove a model, or click a provider name for wildcard (e.g. provider/*). Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/).":"Click to add, click again to remove. Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/)."})]}),(0,n.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,n.jsx)("input",{type:"text",placeholder:I?"Search models (e.g. claude -haiku, oc/*, /regex/)...":"Search models (e.g. claude -haiku, !embed, /regex/)...",value:z,onChange:e=>q(e.target.value),className:"w-full pl-8 pr-20 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,n.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[ec.isRegex&&(0,n.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-primary/10 text-primary font-mono font-medium",children:"regex"}),ec.negativeTerms.length>0&&!ec.isRegex&&(0,n.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-amber-500/10 text-amber-500 font-mono font-medium",children:"!exclude"}),z&&(0,n.jsx)("button",{type:"button",onClick:()=>q(""),className:"text-text-muted hover:text-text-main cursor-pointer p-0.5 rounded",title:"Clear search",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px] leading-none",children:"close"})})]})]}),!F&&ep.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-1 text-[11px] text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("span",{children:[ep.length," models"]}),T.length>0&&(0,n.jsxs)("span",{className:"text-primary font-medium",children:["(",T.length," selected)"]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[ex.length>0&&(0,n.jsxs)("button",{type:"button",onClick:()=>{0!==ex.length&&(i?i(ex):ex.forEach(e=>a(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors cursor-pointer",title:"Select all filtered models",children:["Select All (",ex.length,")"]}),eh.length>0&&(0,n.jsxs)("button",{type:"button",onClick:()=>{0!==eh.length&&(k?k(eh):s&&eh.forEach(e=>s(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-border/40 text-text-muted hover:text-text-main hover:bg-border/60 transition-colors cursor-pointer",title:"Deselect all filtered models",children:["Deselect All (",eh.length,")"]})]})]})]}),(0,n.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[eu.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,n.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,n.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",eu.length,")"]})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eu.map(e=>{let t=j===e.name;return(0,n.jsxs)("button",{onClick:()=>eg({id:e.name,name:e.name,value:e.name}),className:`
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,a)=>{a.d(t,{default:()=>s});var n=a(95155),r=a(31474);function s({label:e,options:t=[],value:a,onChange:i,placeholder:o="Select an option",error:l,hint:d,disabled:c=!1,required:u=!1,className:m,selectClassName:p,...x}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",m),children:[e&&(0,n.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,u&&(0,n.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("select",{value:a,onChange:i,disabled:c,className:(0,r.cn)("w-full py-2.5 px-3 pr-10 text-sm text-text-main","bg-surface-2 border border-transparent rounded-[10px] appearance-none","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",l&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...x,children:[(0,n.jsx)("option",{value:"",disabled:!0,children:o}),t.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,n.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),l&&(0,n.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),l]}),d&&!l&&(0,n.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},929:(e,t,a)=>{a.d(t,{y:()=>u});var n=a(12115),r=a(67899),s=a(88105);let i=null,o=null,l=0,d=new Set;function c(){if(i)return Promise.resolve(i);if(o)return o;let e=++l,t=fetch("/api/models").then(async t=>{if(!t.ok)throw Error(`models ${t.status}`);let a=function(e){let t={},a={};for(let n of e||[])n.caps&&(n.fullModel&&(t[n.fullModel]=n.caps),n.routedModel&&(t[n.routedModel]=n.caps),n.model&&(a[n.model]=n.caps));return{byFull:t,byId:a}}((await t.json()).models);return e===l&&(i=a),a}).catch(()=>({byFull:{},byId:{}})).finally(()=>{o===t&&(o=null)});return o=t,t}function u(){let[e,t]=(0,n.useState)(()=>i?.byFull||{}),[a,o]=(0,n.useState)(()=>i?.byId||{});return(0,n.useEffect)(()=>{let e=!0,a=a=>{e&&(t(a.byFull),o(a.byId))};return d.add(a),i?a(i):c().then(a),()=>{e=!1,d.delete(a)}},[]),{getCaps:(0,n.useCallback)(t=>(function(e,t,a){if(!a)return null;if(e[a])return e[a];let n=a.includes("/")?a.slice(a.indexOf("/")+1):a;if(t[n])return t[n];let i=a.includes("/")?a.slice(0,a.indexOf("/")):null,o=i?s.js[i]||i:null,l=(0,r.nl)(o,n);return{vision:l.vision,search:l.search,reasoning:l.reasoning,contextWindow:l.contextWindow,maxOutput:l.maxOutput}})(e,a,t),[e,a])}}window.addEventListener("customModelChanged",()=>{(i=null,o=null,c()).then(e=>{for(let t of d)t(e)})})},1620:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(12115),r=a(22723);function s(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function o(){return!1}function l(){let{theme:e,setTheme:t,toggleTheme:a,initTheme:l}=(0,r.A)(),d=(0,n.useSyncExternalStore)(s,i,o);(0,n.useEffect)(()=>{l()},[l]),(0,n.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>l();return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,l]);let c="dark"===e||"system"===e&&d;return{theme:e,setTheme:t,toggleTheme:a,isDark:c}}},4823:(e,t,a)=>{a.d(t,{default:()=>m});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(84588),l=a(98),d=a(56061);let c="__none__",u=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round-robin"},{value:"random",label:"Random"}];function m({providerId:e}){let[t,a]=(0,r.useState)([]),[s,i]=(0,r.useState)(c),[p,x]=(0,r.useState)("none"),[h,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let t=!1;return Promise.all([fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.ok?e.json():{proxyPools:[]}),fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{})]).then(([n,r])=>{if(t)return;a(n.proxyPools||[]);let s=(r.providerStrategies||{})[e]||{};i(s.proxyPoolId||c),x(s.rotateStrategy||"none")}).catch(()=>{}),()=>{t=!0}},[e]);let v=(0,r.useCallback)(async(t,a)=>{g(!0);try{let n=await fetch("/api/settings",{cache:"no-store"}),r=(n.ok?await n.json():{}).providerStrategies||{},s={...r[e]||{}};t===c?delete s.proxyPoolId:s.proxyPoolId=t,"none"===a?delete s.rotateStrategy:s.rotateStrategy=a;let i={...r};0===Object.keys(s).length?delete i[e]:i[e]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})}),b(!0),setTimeout(()=>b(!1),1500)}catch(e){console.log("Save proxy config error:",e)}finally{g(!1)}},[e]),y=t.length>=2,k="none"!==p;return(0,n.jsxs)(o.default,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),f&&(0,n.jsx)(d.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,n.jsx)(l.default,{label:"Proxy Pool",value:s,onChange:e=>{var t;i(t=e.target.value),v(t,p)},disabled:h||k,options:[{value:c,label:"None (direct)"},...t.map(e=>({value:e.id,label:e.name}))],hint:k?"Pool selector is ignored when rotation is active — all active pools are used.":void 0}),(0,n.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Rotation Strategy"}),(0,n.jsx)("select",{value:p,onChange:e=>{var t;x(t=e.target.value),v(s,t)},disabled:h,className:"py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all disabled:opacity-50",children:u.map(e=>(0,n.jsx)("option",{value:e.value,disabled:"none"!==e.value&&!y,children:e.label},e.value))}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:y?k?"round-robin"===p?`Rotating through all ${t.length} active pools in order. State is in-memory (resets on restart).`:`Picking a random pool from ${t.length} active pools each request.`:"Uses the selected pool above. Set to Round-robin or Random to rotate across all active pools.":"Need at least 2 active proxy pools for rotation."})]})]})}m.propTypes={providerId:i().string.isRequired}},5293:(e,t,a)=>{a.d(t,{C:()=>s});var n=a(12115);async function r(e){try{let t="u">typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0;let a="u">typeof document?document:null;if(!a?.body)return!1;let n=a.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",a.body.appendChild(n),n.select();let r=a.execCommand("copy");return a.body.removeChild(n),!1!==r}catch{return!1}}function s(e=2e3){let[t,a]=(0,n.useState)(null),i=(0,n.useRef)(null);return{copied:t,copy:(0,n.useCallback)(async(t,n="default")=>!!await r(t)&&(a(n),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{a(null)},e),!0),[e])}}},7648:(e,t,a)=>{a.d(t,{default:()=>h});var n=a(95155),r=a(12115),s=a(73321),i=a(65921),o=a(92622),l=a(24747);let d="omnihilbras-sidebar-collapsed",c=new Set;function u(e){return c.add(e),()=>c.delete(e)}function m(){try{return"true"===localStorage.getItem(d)}catch{return!1}}function p(){return!1}function x(){let e=!m();try{localStorage.setItem(d,String(e))}catch{}for(let e of c)e()}function h({children:e}){let[t,d]=(0,r.useState)(!1),c=(0,r.useSyncExternalStore)(u,m,p),g=(0,s.usePathname)(),f=(0,i.i)(e=>e.notifications),b=(0,i.i)(e=>e.removeNotification);return(0,r.useEffect)(()=>{let e=()=>{a.e(6808).then(a.bind(a,6808)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(1649),a.e(124)]).then(a.bind(a,10124)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(8569),a.e(2435)]).then(a.bind(a,82435)).catch(()=>{}),Promise.all([a.e(3842),a.e(5815),a.e(8569),a.e(5462)]).then(a.bind(a,65462)).catch(()=>{})};{if("requestIdleCallback"in window){let t=window.requestIdleCallback(e,{timeout:4e3});return()=>window.cancelIdleCallback(t)}let t=setTimeout(e,2500);return()=>clearTimeout(t)}},[]),(0,n.jsxs)("div",{className:"dashboard-shell flex h-screen w-full overflow-hidden bg-bg text-text",children:[(0,n.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:f.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-success/30 bg-success/10 text-success",icon:"check_circle"}:"error"===t?{wrapper:"border-danger/30 bg-danger/10 text-danger",icon:"error"}:"warning"===t?{wrapper:"border-warning/30 bg-warning/10 text-warning",icon:"warning"}:{wrapper:"border-info/30 bg-info/10 text-info",icon:"info"};return(0,n.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-elev ${a.wrapper}`,children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,n.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,n.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,n.jsx)("button",{type:"button",onClick:()=>b(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,n.jsx)("div",{className:"fixed inset-0 z-40 bg-black/45 lg:hidden",onClick:()=>d(!1),"aria-label":"Close dashboard navigation"}),(0,n.jsx)("div",{className:"hidden lg:flex",children:(0,n.jsx)(o.default,{collapsed:c,onToggleCollapse:x})}),(0,n.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-200 ease-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,n.jsx)(o.default,{onClose:()=>d(!1)})}),(0,n.jsx)("main",{className:"dashboard-grid-bg flex flex-col flex-1 h-full min-w-0 relative isolate overflow-hidden",children:(0,n.jsxs)("div",{className:"dashboard-content relative z-10 flex flex-col flex-1 min-h-0 mx-auto w-full max-w-[1440px]",children:[(0,n.jsx)(l.default,{onMenuClick:()=>d(!0)}),(0,n.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===g?"":"p-4 sm:p-6 lg:p-8"} ${"/dashboard/basic-chat"===g?"flex flex-col overflow-hidden":""}`,children:(0,n.jsx)("div",{className:`${"/dashboard/basic-chat"===g?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:e})})]})})]})}},8247:(e,t,a)=>{a.d(t,{HY:()=>o,Kw:()=>l});let n={"perplexity-agent":"perplexity","gitlab-duo":"gitlab","vercel-ai-gateway":"vercel","ollama-search":"ollama","minimax-code":"minimax","minimax-code-global":"minimax","duckduckgo-web":"duckai"},r={"nara-router":"bynara-logo-icon-light.svg",tiarina:"Tirina.webp",xkiro:"xkiro-logo.svg","chatgpt-web":"chatgpt.svg","deepseek-web":"deepseek.svg","gemini-web":"gemini.svg","qwen-web":"qwen.svg","tokenharbor-web":"tokenharbor.svg",kiraai:"kiraai.svg"},s=new Set;function i(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function o(e){let t=i(e);if(!t||s.has(t))return null;let a=r[t];if(a)return`/providers/${a}`;let o=function(e){let t=i(e);if(!t||s.has(t))return"";let a=n[t]||t;return s.has(a)?"":a}(t);return o?`/providers/${o}.png`:null}function l(e){let t=i(e);t&&s.add(t);let a=n[t];a&&s.add(a)}},11910:(e,t,a)=>{a.d(t,{default:()=>s});var n=a(95155),r=a(31474);function s({label:e,type:t="text",placeholder:a,value:i,onChange:o,error:l,hint:d,icon:c,disabled:u=!1,required:m=!1,className:p,inputClassName:x,...h}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",p),children:[e&&(0,n.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,m&&(0,n.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,n.jsxs)("div",{className:"relative",children:[c&&(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,n.jsx)("input",{type:t,placeholder:a,value:i,onChange:o,disabled:u,className:(0,r.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",l&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",x),...h})]}),l&&(0,n.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),l]}),d&&!l&&(0,n.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},21110:(e,t,a)=>{a.d(t,{ThemeProvider:()=>i});var n=a(95155),r=a(12115),s=a(22723);function i({children:e}){let{initTheme:t}=(0,s.A)();return(0,r.useEffect)(()=>{t()},[t]),(0,n.jsx)(n.Fragment,{children:e})}},21931:(e,t,a)=>{a.d(t,{default:()=>d});var n=a(95155),r=a(12115),s=a(47650),i=a(93308),o=a(73006);let l=e=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},km:{name:"ខ្មែរ",flag:"\uD83C\uDDF0\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"},fa:{name:"فارسی",flag:"\uD83C\uDDEE\uD83C\uDDF7"}})[e]||{name:e,flag:"\uD83C\uDF10"};function d({className:e="",isOpen:t,onClose:a,hideTrigger:c=!1}){let[u,m]=(0,r.useState)("en"),[p,x]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),f=(0,r.useRef)(null),b="boolean"==typeof t,v=b?t:h,y=(e,t=u)=>{b?!e&&a&&a(t):g(e)};(0,r.useEffect)(()=>{m(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[]),(0,r.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&y(!1)}if(v)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]);let k=async e=>{if(e!==u&&!p){x(!0);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,o.wn)(),m(e),y(!1,e)}catch(e){console.error("Failed to set locale:",e)}finally{x(!1)}}};return(0,n.jsxs)("div",{className:e,children:[!c&&(0,n.jsxs)("button",{onClick:()=>y(!v),disabled:p,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,n.jsx)("span",{className:"text-sm font-medium",children:l(u).name}),(0,n.jsx)("span",{className:"text-lg",children:l(u).flag})]}),v&&(0,s.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>y(!1)}),(0,n.jsxs)("div",{ref:f,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,n.jsx)("button",{onClick:()=>y(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,n.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,n.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:i.YZ.map(e=>{let t=u===e,a=l(e);return(0,n.jsxs)("button",{onClick:()=>k(e),disabled:p,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${t?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${p?"opacity-70 cursor-wait":""}`,title:a.name,children:[(0,n.jsx)("span",{className:"text-2xl",children:a.flag}),(0,n.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:a.name}),t&&(0,n.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},e)})})})]})]}),document.body)]})}},23308:(e,t,a)=>{a.d(t,{default:()=>l});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);function l({isOpen:e,providerInfo:t,onSuccess:a,onClose:s}){let[i,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),[y,k]=(0,r.useState)(null),j=(0,r.useRef)(null),w=()=>{try{j.current?.close()}catch{}d(null),u(""),p(""),f(null),h(!1),v(""),k(null),s()},N=async()=>{f(null),h(!0);try{let e=`${window.location.origin}/callback`,t=await fetch(`/api/oauth/tokenharbor/authorize?redirect_uri=${encodeURIComponent(e)}`),a=await t.json();if(!t.ok)throw Error(a.error||"Could not start the login");k(a),j.current=window.open(a.authUrl,"tokenharbor_login","width=600,height=700"),j.current||f("The login window was blocked. Allow popups for this site and try again.")}catch(e){f(e.message)}finally{h(!1)}},C=async()=>{if(!b.trim())return void f("Paste the URL shown in the login window");h(!0),f(null);try{let e=await fetch("/api/oauth/tokenharbor/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:b.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Could not complete the login");a?.(),w()}catch(e){f(e.message)}finally{h(!1)}},S=async()=>{if(!c.trim()||!m)return void f("Email and password are required");h(!0),f(null);try{let e=await fetch("/api/oauth/tokenharbor/password-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c.trim(),password:m})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");p(""),a?.(),w()}catch(e){f(e.message)}finally{h(!1)}};return e?(0,n.jsx)(o.aF,{isOpen:e,title:"Connect Token Harbor",onClose:w,size:"lg",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[!i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Sign in to read your Token Harbor wallet balance in the Quota Tracker."}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("button",{onClick:()=>d("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Sign in with Google"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Opens Token Harbor's own login page"})]})]}),(0,n.jsxs)("button",{onClick:()=>d("password"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Email & password"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"For accounts using a password"})]})]})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Your model API key is set separately — this login only reads your wallet."})]}),"oauth"===i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"A login window opens on Token Harbor's site. After signing in with Google, GitHub or email, the page shows a plain address — copy that whole URL and paste it below to finish connecting."}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(o.$n,{onClick:N,fullWidth:!0,disabled:x,loading:x,children:y?"Open login again":"Sign in with Google"}),(0,n.jsx)(o.$n,{onClick:()=>{d(null),f(null)},variant:"ghost",fullWidth:!0,children:"Back"})]}),(0,n.jsx)(o.pd,{label:"Paste the URL from the login window",value:b,onChange:e=>v(e.target.value),placeholder:"https://tokenharbor.ai/robots.txt?code=...",hint:"The address bar of the login window — copy the whole thing, including ?code=...",inputClassName:"font-mono text-xs"}),g&&(0,n.jsx)("p",{className:"text-sm text-red-500",children:g}),(0,n.jsx)(o.$n,{onClick:C,fullWidth:!0,disabled:!b.trim()||x,loading:x,children:"Connect"})]}),"password"===i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Use the email and password of your Token Harbor account."}),(0,n.jsx)(o.pd,{label:"Email",type:"email",value:c,onChange:e=>u(e.target.value),placeholder:"you@example.com",autoComplete:"username"}),(0,n.jsx)(o.pd,{label:"Password",type:"password",value:m,onChange:e=>p(e.target.value),placeholder:"Your Token Harbor password",autoComplete:"current-password"}),g&&(0,n.jsx)("p",{className:"text-sm text-red-500",children:g}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(o.$n,{onClick:S,fullWidth:!0,disabled:!c.trim()||!m||x,loading:x,children:"Connect"}),(0,n.jsx)(o.$n,{onClick:()=>{d(null),f(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}l.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},23615:(e,t,a)=>{a.d(t,{default:()=>i});var n=a(95155),r=a(12115),s=a(84588);function i(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[o,l]=(0,r.useState)(!0);(0,r.useEffect)(()=>{d()},[]),(0,r.useEffect)(()=>{let e;return o&&(e=setInterval(()=>{("u"<typeof document||!document.hidden)&&d(!1)},3e3)),()=>clearInterval(e)},[o]);let d=async(e=!0)=>{e&&i(!0);try{let e=await fetch("/api/usage/request-logs");if(e.ok){let a=await e.json();t(a)}}catch(e){console.error("Failed to fetch logs:",e)}finally{e&&i(!1)}};return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,n.jsx)("span",{children:"Auto Refresh (3s)"}),(0,n.jsx)("div",{onClick:()=>l(!o),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${o?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,n.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${o?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,n.jsx)(s.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,n.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:a&&0===e.length?(0,n.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,n.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,n.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,n.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,n.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,n.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let a=e.split(" | ");if(a.length<7)return null;let r=a[6],s=r.includes("PENDING"),i=r.includes("FAILED"),o=r.includes("OK");return(0,n.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${s?"bg-primary/5":""}`,children:[(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:a[0]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:a[1]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,n.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:a[2]})}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:a[3],children:a[3]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:a[4]}),(0,n.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:a[5]}),(0,n.jsx)("td",{className:`px-3 py-1.5 font-bold ${o?"text-success":i?"text-error":"text-primary animate-pulse"}`,children:r})]},t)})})]})})}),(0,n.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},23936:(e,t,a)=>{a.d(t,{default:()=>l});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);function l({isOpen:e,onSuccess:t,onClose:a}){let[s,i]=(0,r.useState)(""),[d,c]=(0,r.useState)(!1),[u,m]=(0,r.useState)(null),[p,x]=(0,r.useState)(!1),h=async()=>{if(!s.trim())return void m("Please paste your cookie");c(!0),m(null);try{let e=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:s.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"Authentication failed");x(!0),setTimeout(()=>{t?.(),g()},1500)}catch(e){m(e.message)}finally{c(!1)}},g=()=>{i(""),m(null),x(!1),a?.()};return(0,n.jsx)(o.aF,{isOpen:e,onClose:g,title:"iFlow Cookie Authentication",children:(0,n.jsx)("div",{className:"space-y-4",children:p?(0,n.jsxs)("div",{className:"text-center py-8",children:[(0,n.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,n.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,n.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,n.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,n.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,n.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,n.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,n.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,n.jsx)("li",{children:"Login to your account"}),(0,n.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,n.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,n.jsx)("li",{children:"Paste it below"})]})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,n.jsx)("textarea",{value:s,onChange:e=>i(e.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:d})]}),u&&(0,n.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,n.jsx)("p",{className:"text-sm text-error",children:u})}),(0,n.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,n.jsx)(o.$n,{variant:"secondary",onClick:g,disabled:d,fullWidth:!0,children:"Cancel"}),(0,n.jsx)(o.$n,{onClick:h,loading:d,fullWidth:!0,children:"Authenticate"})]})]})})})}l.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func}},24747:(e,t,a)=>{a.d(t,{default:()=>S});var n=a(95155),r=a(12115),s=a(73321),i=a(98500),o=a.n(i),l=a(14051),d=a.n(l),c=a(57250),u=a(80752),m=a(93308),p=a(38202),x=a(21931);function h(){let[e,t]=(0,r.useState)(!1),[a,s]=(0,r.useState)("en");return(0,r.useEffect)(()=>{s(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${m.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,m.QC)(t)}())},[e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>t(!0),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Language","data-i18n-skip":"true",children:(0,n.jsx)("span",{className:"text-lg leading-none",children:p.h[a]||"\uD83C\uDF10"})}),(0,n.jsx)(x.default,{hideTrigger:!0,isOpen:e,onClose:e=>{t(!1),s(e)}})]})}var g=a(38587),f=a(47650),b=a(90620);function v({isOpen:e,onClose:t}){let[a,s]=(0,r.useState)(null),[i,o]=(0,r.useState)(!1),[l,d]=(0,r.useState)(""),c=(0,r.useRef)(null);return((0,r.useEffect)(()=>{e&&!a&&(o(!0),d(""),fetch(b.Nu.donateUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>s(e)).catch(e=>d(e.message||"Failed to load")).finally(()=>o(!1)))},[e,a]),(0,r.useEffect)(()=>{let a=e=>{c.current&&!c.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,f.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,n.jsxs)("div",{ref:c,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,n.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-pink-500",children:"volunteer_activism"}),a?.title||"Support OmniHilbras"]}),(0,n.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,n.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[i&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),l&&(0,n.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load donate info: ",l]}),!i&&!l&&a&&(0,n.jsxs)(n.Fragment,{children:[a.message&&(0,n.jsx)("p",{className:"text-text-muted text-sm mb-6 text-center",children:a.message}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:a.channels?.map(e=>(0,n.jsx)(y,{channel:e},e.id))})]})]})]})]}),document.body)}function y({channel:e}){let{label:t,description:a,icon:r,color:s,url:i,qr:o}=e,l=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:`${s}20`,color:s},children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:r})}),(0,n.jsx)("div",{className:"font-semibold text-text-main mb-1",children:t}),a&&(0,n.jsx)("div",{className:"text-xs text-text-muted mb-3 text-center",children:a}),o&&(0,n.jsx)("img",{src:o,alt:`${t} QR`,className:"w-full max-w-[180px] aspect-square object-contain rounded-lg bg-white p-1",loading:"lazy",decoding:"async"})]});return(0,n.jsxs)("div",{className:"flex flex-col items-center p-4 rounded-xl border border-black/10 dark:border-white/10 bg-surface/50 hover:border-pink-500/40 transition-colors",children:[l,i&&(0,n.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium text-white hover:opacity-90 transition-opacity",style:{backgroundColor:s},children:["Open",(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"})]})]})}v.propTypes={isOpen:d().bool.isRequired,onClose:d().func.isRequired};var k=a(38003),j=a(65921),w=a(88105),N=a(8247),C=a(73006);function S({onMenuClick:e,showMenuButton:t=!0}){let a=(0,s.usePathname)(),[i,l]=(0,r.useState)(""),[d,m]=(0,r.useState)(""),[p,x]=(0,r.useState)(!1),f=(0,j.i)(),{title:y,description:k,icon:W,breadcrumbs:T}=(0,r.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(t){let e=t[1],a=t[2];if("combo"===e)return{title:"Combo",description:"",breadcrumbs:[{label:"Combos",href:"/dashboard/combos"},{label:"Combo"}]};let n=w.rj.find(t=>t.id===e),r=w.Q2[a];return{title:r?.name||a,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:n?.label||e,href:`/dashboard/media-providers/${e}`},{label:r?.name||a,image:(0,N.HY)(a)}]}}let a=e.match(/\/media-providers\/([^/]+)$/);if(a){let e=a[1];if("web"===e)return{title:"Web Fetch & Search",description:"Manage your web fetch and search providers",icon:"travel_explore",breadcrumbs:[]};let t=w.rj.find(t=>t.id===e);return{title:t?.label||e,description:`Manage your ${t?.label||e} providers`,icon:t?.icon||"perm_media",breadcrumbs:[]}}let n=e.match(/\/providers\/([^/]+)$/);if(n){let e=n[1],t=b.zN[e]||b.fg[e];if(t)return{title:t.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:t.name,image:(0,N.HY)(t.id)}]}}return e.includes("/providers")&&!e.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:e.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:e.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:e.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through OmniHilbras",icon:"security",breadcrumbs:[]}:e.includes("/token-saver")?{title:"Token Saver",description:"Compress prompts and outputs to save tokens",icon:"savings",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:e.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:e.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use OmniHilbras — no install needed",icon:"extension",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(a),[a]);(0,r.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let a=await t.json();e||(l(a?.displayName||a?.samlName||a?.samlEmail||a?.oidcName||a?.oidcEmail||""),m(a?.loginMethod||""))}catch{e||(l(""),m(""))}}(),()=>{e=!0}},[]);let F=async()=>{try{if((await fetch("/api/auth/logout",{method:"POST"})).ok)return void window.location.assign("/login");f.error("Logout failed. Please try again.")}catch(e){console.error("Failed to logout:",e),f.error("Logout failed. Please try again.")}};return(0,n.jsxs)("header",{className:"dashboard-header shrink-0 flex items-center justify-between gap-3 px-4 sm:px-6 lg:px-8 min-h-[64px] border-b border-border bg-bg z-20",children:[(0,n.jsx)("div",{className:"flex items-center gap-3 lg:hidden shrink-0",children:t&&(0,n.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,n.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,n.jsx)("div",{className:"flex flex-col min-w-0 flex-1",children:T.length>0?(0,n.jsx)("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:T.map((e,t)=>(0,n.jsxs)("div",{className:`items-center gap-1.5 sm:gap-2 min-w-0 ${t<T.length-1?"hidden sm:flex shrink-0":"flex flex-1"}`,children:[t>0&&(0,n.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base hidden sm:inline",children:"chevron_right"}),e.href?(0,n.jsx)(o(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors truncate",children:e.label}):(0,n.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:[e.image&&(0,n.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[24px] max-h-[24px] sm:max-w-[28px] sm:max-h-[28px] shrink-0",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,n.jsx)("h1",{className:"text-base lg:text-2xl font-semibold text-text-main tracking-tight truncate",children:(0,C.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):y?(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[W&&(0,n.jsx)("span",{className:"material-symbols-outlined text-primary text-xl lg:text-2xl",children:W}),(0,n.jsx)("h1",{className:"text-base lg:text-2xl font-semibold tracking-tight truncate",children:(0,C.Tl)(y)})]}),k&&(0,n.jsx)("p",{className:"hidden lg:block text-sm text-text-muted truncate",children:(0,C.Tl)(k)})]}):null}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[i&&("OIDC"===d||"SAML"===d)&&(0,n.jsxs)("div",{className:"hidden sm:flex items-center max-w-[220px] px-3 py-1.5 rounded-full border border-border bg-surface/70 text-xs text-text-muted truncate",title:i,children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1.5 text-primary",children:"person"}),(0,n.jsx)("span",{className:"truncate",children:i}),(0,n.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:d})]}),(0,n.jsx)(O,{}),!1,(0,n.jsx)(g.default,{}),(0,n.jsx)(h,{}),(0,n.jsx)(u.default,{onLogout:F})]}),(0,n.jsx)(v,{isOpen:p,onClose:()=>x(!1)})]})}function O(){let e=(0,k.C)(e=>e.visible),t=(0,k.C)(e=>e.query),a=(0,k.C)(e=>e.placeholder),r=(0,k.C)(e=>e.setQuery);return e?(0,n.jsxs)("div",{className:"relative w-[160px] sm:w-[220px]",children:[(0,n.jsx)("span",{className:"material-symbols-outlined absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[16px] pointer-events-none",children:"search"}),(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),placeholder:a,className:"w-full h-8 pl-7 pr-7 rounded-lg border border-border bg-surface/60 text-sm focus:outline-none focus:border-primary/50 transition-colors"}),t&&(0,n.jsx)("button",{type:"button",onClick:()=>r(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded","aria-label":"Clear search",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}):null}S.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},25086:(e,t,a)=>{a.d(t,{CardSkeleton:()=>i,Skeleton:()=>s});var n=a(95155),r=a(31474);function s({className:e,...t}){return(0,n.jsx)("div",{className:(0,r.cn)("animate-pulse rounded-[10px] bg-surface-2",e),...t})}function i(){return(0,n.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)(s,{className:"h-4 w-24"}),(0,n.jsx)(s,{className:"size-10 rounded-[10px]"})]}),(0,n.jsx)(s,{className:"h-8 w-16 mb-2"}),(0,n.jsx)(s,{className:"h-3 w-20"})]})}},27932:(e,t,a)=>{a.d(t,{default:()=>c});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(35497);let l={"chatgpt-web":{id:"chatgpt-web",name:"ChatGPT Web",website:"https://chatgpt.com",credentialName:"__Secure-next-auth.session-token",extractionSteps:[{label:"Copy the header",body:"With chatgpt.com open and signed in: F12 → Network → reload → click any request to chatgpt.com → Headers → Request Headers → Cookie. Copy that entire line and paste it here. Do not use the Console — the session cookie is HttpOnly, so no console command can read it."},{label:"Or the Application panel",body:"F12 → Application → Storage → Cookies → https://chatgpt.com. Copy the whole value of `__Secure-next-auth.session-token`. If it is split into numbered rows, join them in order with no separator."},{label:"Or run this in the console",body:"Copies what the page can see and tells you whether you are signed in. The session cookie itself is HttpOnly, so **no** console command can read it — the line says so and points at the Network tab.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.some(x => x.startsWith('__Secure-next-auth.callback-url=')) ? 'You are signed in. The session cookie is HttpOnly, so the console cannot copy it — use the Network tab (F12 → Network → reload → a request to chatgpt.com → Request Headers → Cookie) and copy that whole line.' : 'No sign-in cookie here — sign in at chatgpt.com first.'); copy(c.join('; ')); })()"}],paste:{field:"storageState",placeholder:"__Secure-next-auth.session-token=…; oai-did=…",supportsFreeOnly:!0,sectionLabel:"Or paste a session cookie instead",fieldLabel:"Session cookie"},planNote:"Only chatgpt.com and openai.com cookies are kept. Anything else in the export is dropped before it is stored."},"qwen-web":{id:"qwen-web",name:"Qwen Web",website:"https://chat.qwen.ai",credentialName:"Cookie header from auth.qwen.ai",extractionSteps:[{label:"Copy the auth cookie",body:"Sign in at chat.qwen.ai. Then: F12 → Application → Storage → Cookies → **https://auth.qwen.ai**, and copy the cookies for that host. If you would rather use the Network tab, reload, click a request to auth.qwen.ai, and copy its **Request Headers → Cookie** value. The session cookie is HttpOnly, so no console command can read it — the Application panel is the way."},{label:"Or run this on the auth page",body:"Open **auth.qwen.ai** (the origin the cookie belongs to) and run this there. It copies the cookies that origin can see and says whether the session cookie is among them.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.length ? 'Copied the cookies this origin can see. If the check still refuses them, the session cookie is HttpOnly — copy it from F12 → Application → Storage → Cookies → https://auth.qwen.ai.' : 'Nothing readable here — the session cookie is HttpOnly. Copy it from F12 → Application → Storage → Cookies → https://auth.qwen.ai.'); copy(c.join('; ')); })()"},{label:"What happens next",body:"OmniHilbras asks three questions and shows you the answers: whether the credential means anything to auth.qwen.ai, what models Qwen serves, and whether a turn is actually served. Qwen refuses bot-protected requests with **HTTP 200 and a refusal in the body**, so the probe reads the body rather than the status code — nothing is saved either way until a turn really works."}],paste:{field:"cookieHeader",placeholder:"name=value; name2=value2",sectionLabel:"Or paste a cookie header instead",fieldLabel:"Cookie header"},planNote:"Qwen serves its models to guests, so the catalog is real even when a turn is not. The card says which of the two you are looking at."},"deepseek-web":{id:"deepseek-web",name:"DeepSeek Web",website:"https://chat.deepseek.com",credentialName:"userToken",extractionSteps:[{label:"Fastest",body:"With chat.deepseek.com signed in, open the developer tools (F12) → Console, paste this line and press Enter. It copies the userToken.",snippet:"copy(JSON.parse(localStorage.userToken).value)"},{label:"If the copied value is empty",body:'`{"value":null}` means the page has no session, so you are signed out. Sign in at chat.deepseek.com first, then copy it again.'}],paste:{field:"userToken",placeholder:'userToken value, or {"value":"…"}',sectionLabel:"Or paste a userToken instead",fieldLabel:"userToken"},planNote:"DeepSeek Web serves the same models to every account, so there is no plan to read and nothing is narrowed."},"tokenharbor-web":{id:"tokenharbor-web",name:"Token Harbor Web",website:"https://tokenharbor.ai/chat",credentialName:"sb-auth-auth-token",extractionSteps:[{label:"Copy the Cookie header",body:"With tokenharbor.ai open and signed in: F12 → Network → reload → click any request to tokenharbor.ai → Headers → Request Headers → Cookie. Copy that entire line and paste it here. It carries the Cloudflare clearance alongside the session, and both are wanted."},{label:"Or the Application panel",body:"F12 → Application → Storage → Cookies → https://tokenharbor.ai, and copy the value of `sb-auth-auth-token`. If it is split into numbered rows (`.0`, `.1`), copy them all — they are rejoined in order for you."},{label:"Or the console",body:"With tokenharbor.ai open and signed in, open F12 → Console, paste this line and press Enter. It copies the session cookies (the chunks in order, plus cf_clearance) to your clipboard. This only works when the cookie is not HttpOnly; if nothing is copied, use one of the steps above.",snippet:"copy(document.cookie.split('; ').filter((c) => c.startsWith('sb-auth-auth-token') || c.startsWith('cf_clearance')).sort((a, b) => a.localeCompare(b, undefined, { numeric: true })).join('; '))"},{label:"What happens next",body:"Check asks tokenharbor.ai whether the session is accepted, by reading your profile. Nothing is stored unless you press Save, and the check is a credential check — whether a model can answer is only known by sending a turn."}],paste:{field:"cookieHeader",placeholder:"sb-auth-auth-token=base64-...; cf_clearance=...",supportsFreeOnly:!0,sectionLabel:"Or paste a session cookie instead",fieldLabel:"Cookie header or session cookie"},planNote:'Token Harbor serves its catalog to every account; the ":free" models are the ones that never bill.'},"gemini-web":{id:"gemini-web",name:"Gemini Web",website:"https://gemini.google.com",credentialName:"__Secure-1PSID",extractionSteps:[{label:"The two cookies",body:"With gemini.google.com open and signed in: F12 → Application → Storage → Cookies → **https://gemini.google.com**. Copy the values of `__Secure-1PSID` and `__Secure-1PSIDTS` and paste them here as `__Secure-1PSID=...; __Secure-1PSIDTS=...`. Do not use the Console — `__Secure-1PSID` is HttpOnly, so no console command can read it."},{label:"Or the request header",body:"F12 → Network → reload → click any request to gemini.google.com → Headers → Request Headers → Cookie. Copy that entire line."},{label:"Or run this in the console",body:"Copies the cookies the page can see. `__Secure-1PSID` is HttpOnly, so the console cannot read it — the line says so and points at the Application panel.",snippet:"(() => { const c = document.cookie.split('; ').map(s => s.trim()).filter(Boolean); console.log(c.some(x => x.startsWith('__Secure-1PSID')) ? 'Copied. If the check still refuses them, __Secure-1PSID is HttpOnly — copy it from F12 → Application → Storage → Cookies → https://gemini.google.com.' : '__Secure-1PSID is HttpOnly — the console cannot read it. Copy it from F12 → Application → Storage → Cookies → https://gemini.google.com.'); copy(c.join('; ')); })()"},{label:"What happens next",body:"Check opens gemini.google.com in a browser on this machine and reports whether the session is signed in — cookie presence and expiry are local checks and neither can tell a working session from one Google has revoked. Nothing is stored unless you press Save. A turn is sent by driving the page: it is slower than an API and there is a browser in the path by design."}],paste:{field:"cookieHeader",placeholder:"__Secure-1PSID=...; __Secure-1PSIDTS=...",sectionLabel:"Or paste the cookies instead",fieldLabel:"Cookie header, or the __Secure-1PSID value"},planNote:"Gemini Web drives the page, so the model list is the modes the page offers (3.1 Pro, 3.7 Flash, 3.1 Flash-Lite), not Google's API model ids."},"duckduckgo-web":{id:"duckduckgo-web",name:"Duck.ai",website:"https://duck.ai",credentialName:"Nothing — no cookie is required",extractionSteps:[{label:"Nothing to export",body:"Duck.ai answers signed-out visitors, so there is no cookie to copy. You can press Check and then Save with the field below empty, and the connection will work."},{label:"If you would rather send your browser session",body:"With duck.ai open: F12 → Network → reload → click any request to duck.ai → Headers → Request Headers → Cookie. Copy that entire line and paste it here. OmniHilbras does not read it — the service does not either — so it cannot tell you whether the cookie is valid, and Check will say so rather than claiming otherwise.",snippet:"copy(document.cookie)"},{label:"What happens next",body:"Check asks duck.ai for its anti-bot challenge and solves it here, then reports the free models it offers. What it proves is that the endpoint answered and served a solvable challenge — not that a turn will always succeed. A refusal carrying HTTP 418 is a rate limit rather than a broken key: the same request was measured failing 43 seconds after a success and working 4.9 minutes later, so back off rather than retrying."}],optionalCredential:!0,paste:{field:"cookieHeader",placeholder:"Leave empty — or paste the whole Cookie: line from duck.ai",sectionLabel:"Or paste a cookie you would rather send along",fieldLabel:"Cookie header"},planNote:"Only the free lineup is served without a subscription. The list is read from each model's own `accessTier` and changes with duck.ai, so it is reported at connect time rather than written on the card."}};var d=a(5293);function c({isOpen:e,providerId:t,onSuccess:a,onClose:s}){let[i,u]=(0,r.useState)(""),[m,p]=(0,r.useState)(!1),[x,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),y=t&&l[t]||null,{copied:k,copy:j}=(0,d.C)(),w=()=>{u(""),f(null),v(null),p(!1),h(!1),s?.()},N=async e=>{let a=await fetch(`/api/providers/web-session/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,credential:i.trim()})}),n=await a.json().catch(()=>({}));if(!a.ok)throw Error(n.error||"Request failed");return n},C=async()=>{p(!0),f(null);try{let e=await N("check");v(e),!1===e.ok&&e.error&&f(e.error)}catch(e){f(e.message)}finally{p(!1)}},S=async()=>{h(!0),f(null);try{await N("connect"),a?.(),w()}catch(e){f(e.message)}finally{h(!1)}};if(!e||!y)return null;let O=y.optionalCredential||i.trim().length>0,W=m||x;return(0,n.jsx)(o.aF,{isOpen:e,onClose:w,title:`Connect ${y.name}`,size:"lg",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:[y.name," is reached with a session your browser already holds, not with an API key. Sign in at"," ",(0,n.jsx)("a",{href:y.website,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:y.website})," ","first, then copy the credential below."]}),(0,n.jsx)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-3",children:y.extractionSteps.map((e,t)=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("p",{className:"font-medium text-text-primary",children:[t+1,". ",e.label]}),(0,n.jsx)("p",{className:"text-text-muted",children:e.body}),e.snippet&&(0,n.jsx)("button",{type:"button",onClick:()=>j(e.snippet,e.snippet),title:"Copy this line, then paste it in the browser console",className:"block w-full overflow-x-auto rounded border border-line bg-sidebar px-2 py-1 text-left font-mono text-[11px] text-text-primary transition-colors hover:border-gold/50",children:k===e.snippet?"Copied — paste it in the console":e.snippet})]},e.label))}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:y.paste?.fieldLabel||y.credentialName}),(0,n.jsx)("textarea",{value:i,onChange:e=>{u(e.target.value),v(null)},placeholder:y.paste?.placeholder||y.credentialName,className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:W}),(0,n.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Needs: ",y.credentialName]})]}),b&&(0,n.jsxs)("div",{className:`p-3 rounded-lg border text-sm ${b.ok?"bg-success/10 border-success/20 text-text-primary":"bg-error/10 border-error/20 text-error"}`,children:[(0,n.jsx)("p",{children:b.detail||(b.ok?"The credential works.":"The provider refused the credential.")}),Array.isArray(b.models)&&b.models.length>0&&(0,n.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Models available: ",b.models.slice(0,12).join(", "),b.models.length>12?` +${b.models.length-12} more`:""]})]}),g&&(0,n.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,n.jsx)("p",{className:"text-sm text-error",children:g})}),y.planNote&&(0,n.jsx)("p",{className:"text-[11px] text-text-muted",children:y.planNote}),(0,n.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,n.jsx)(o.$n,{variant:"secondary",onClick:w,disabled:W,fullWidth:!0,children:"Cancel"}),(0,n.jsx)(o.$n,{variant:"secondary",onClick:C,disabled:!O||W,loading:m,fullWidth:!0,children:"Check"}),(0,n.jsx)(o.$n,{onClick:S,disabled:!O||W,loading:x,fullWidth:!0,children:"Save"})]})]})})}c.propTypes={isOpen:i().bool.isRequired,providerId:i().string,onSuccess:i().func,onClose:i().func}},28011:(e,t,a)=>{a.d(t,{default:()=>y});var n=a(95155),r=a(12115),s=a(14051),i=a.n(s),o=a(81127),l=a(57250),d=a(29366),c=a(929),u=a(28777),m=a(88105);function p(e){if(!e||"string"!=typeof e)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};let t=e.trim();if(!t)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};if(t.startsWith("/")){let e=t.match(/^\/(.+)\/([a-z]*)$/i);if(e)try{let a=e[2]||"i",n=new RegExp(e[1],a);return{raw:t,isEmpty:!1,isRegex:!0,regex:n,positiveTerms:[],negativeTerms:[]}}catch{}else if(t.length>1)try{let e=RegExp(t.slice(1),"i");return{raw:t,isEmpty:!1,isRegex:!0,regex:e,positiveTerms:[],negativeTerms:[]}}catch{}}let a=t.split(/\s+/),n=[],r=[];for(let e of a)e&&((e.startsWith("!")||e.startsWith("-"))&&e.length>1?r.push(e.slice(1).toLowerCase()):n.push(e.toLowerCase()));return{raw:t,isEmpty:0===n.length&&0===r.length,isRegex:!1,regex:null,positiveTerms:n,negativeTerms:r}}function x(e,t){let a="string"!=typeof t&&t?t:p(t);if(a.isEmpty)return!0;let n=[];if("string"==typeof e?n=[e]:Array.isArray(e)?n=e.filter(e=>"string"==typeof e):e&&"object"==typeof e&&(n=[e.name,e.id,e.value,e.alias,e.provider].filter(e=>"string"==typeof e)),0===n.length)return!1;if(a.isRegex&&a.regex){let e=n.join(" ");return/\(\?!|\(\?<!/.test(a.raw)?a.regex.test(e):n.some(e=>a.regex.test(e))||a.regex.test(e)}let r=n.map(e=>e.toLowerCase());if(a.negativeTerms.length>0){for(let e of a.negativeTerms)if(r.some(t=>t.includes(e)))return!1}if(a.positiveTerms.length>0){for(let e of a.positiveTerms)if(!r.some(t=>t.includes(e)))return!1}return!0}var h=a(70217);let g=[...Object.keys(m.zN),...Object.keys(m.IS),...Object.keys(m.nJ),...Object.keys(m.fg)],f=Object.keys(m.IS).filter(e=>m.IS[e].noAuth),b=["cursor","cline","clinepass","zed"];function v(e,t,a){let[n,s]=(0,r.useState)([]),i=(t??[]).join("|");return(0,r.useEffect)(()=>{let t=i?i.split("|"):[];if(!e||0===t.length)return void s([]);let n=!1;return Promise.all(t.map(async e=>{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let a=await t.json();return Array.isArray(a.models)?a.models:[]})).then(e=>{if(n)return;let t=new Set;s(e.flat().filter(e=>!(!e?.id||t.has(e.id))&&(t.add(e.id),!0)))}).catch(e=>{console.warn(`Unable to load ${a} models for selector:`,e),n||s([])}),()=>{n=!0}},[e,i,a]),n}function y({isOpen:e,onClose:t,onSelect:a,onDeselect:s,onSelectBatch:i,onDeselectBatch:k,selectedModel:j,activeProviders:w=[],title:N="Select Model",size:C="lg",modelAliases:S={},kindFilter:O=null,capFilter:W=null,addedModelValues:T=[],closeOnSelect:F=!0,allowProviderWildcard:I=!1}){let[_,P]=(0,r.useState)(null),$=async()=>{try{let e=await fetch("/api/providers");if(!e.ok)throw Error(`Failed to fetch providers: ${e.status}`);let t=await e.json();P(t.connections||[])}catch(e){console.error("Error fetching providers in ModelSelectModal:",e),P([])}};(0,r.useEffect)(()=>{e&&$()},[e]);let E=(0,r.useMemo)(()=>null!==_?_:w||[],[_,w]),A=(0,r.useMemo)(()=>{let e=E.filter(e=>e&&!1!==e.isActive);return O?e.filter(e=>{let t=m.Q2[e.provider];return(t?.serviceKinds||["llm"]).includes(O)}):e},[E,O]),R=(0,r.useMemo)(()=>(0,h.i)(E),[E]),{getCaps:D}=(0,c.y)(),[z,q]=(0,r.useState)(""),[M,L]=(0,r.useState)([]),[U,K]=(0,r.useState)([]),[H,V]=(0,r.useState)([]),[J,B]=(0,r.useState)({}),G=(0,r.useMemo)(()=>{let e=Object.fromEntries(b.map(e=>[e,[]]));for(let t of A)t?.id&&Object.prototype.hasOwnProperty.call(e,t.provider)&&e[t.provider].push(t.id);return e},[A]),Q=G.cursor,Y=G.cline,X=G.clinepass,Z=G.zed,ee=v(e,Q,"Cursor"),et=v(e,Y,"Cline"),ea=v(e,X,"ClinePass"),en=v(e,Z,"Zed"),er=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();L(t.combos||[])}catch(e){console.error("Error fetching combos:",e),L([])}};(0,r.useEffect)(()=>{e&&er()},[e]);let es=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();K(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),K([])}};(0,r.useEffect)(()=>{e&&es()},[e]);let ei=async()=>{try{let e=await fetch("/api/models/custom");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();V(t.models||[])}catch(e){console.error("Error fetching custom models:",e),V([])}};(0,r.useEffect)(()=>{e&&ei()},[e]);let eo=async()=>{try{let e=await fetch("/api/models/disabled");if(!e.ok)throw Error(`Failed to fetch disabled models: ${e.status}`);let t=await e.json();B(t.disabled||{})}catch(e){console.error("Error fetching disabled models:",e),B({})}};(0,r.useEffect)(()=>{e&&eo()},[e]);let el=(0,r.useMemo)(()=>({...m.zN,...m.IS,...m.nJ,...m.fg}),[]),ed=(0,r.useMemo)(()=>{let e={},t=new Set(["webSearch","webFetch"]),a=new Set(["image","tts","stt","embedding","imageToText"]),n=new Set(["tts","image","webFetch"]),r=A.map(e=>e.provider),s=(O?f.filter(e=>(m.Q2[e]?.serviceKinds||["llm"]).includes(O)):f).filter(e=>!R.has(e)),i=new Set((U||[]).map(e=>e?.id).filter(Boolean));return[...new Set([...r,...s,...O?[]:H.map(e=>e.providerAlias).filter(e=>((0,m.mq)(e)||(0,m.gb)(e))&&i.has(e)&&!R.has(e))].filter(e=>!R.has(e)))].sort((e,t)=>{let a=g.indexOf(e),n=g.indexOf(t);return(-1===a?999:a)-(-1===n?999:n)}).forEach(r=>{let s=(0,m.wG)(r),i=el[r]||{name:r,color:"#666"},o=(0,m.mq)(r)||(0,m.gb)(r);if(O&&t.has(O)){e[r]={name:i.name,alias:s,color:i.color,models:[{id:r,name:i.name,value:r}]};return}if(i.passthroughModels){let t=Object.entries(S).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t})),o=H.filter(e=>e.providerAlias===s).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,kind:(0,u.CP)(e),isCustom:!0})),l=t;if(O&&a.has(O)){let e=o.filter(e=>(0,u.CP)(e)===O);0===(l=[...e,...(0,u.KC)(r).filter(e=>(0,u.CP)(e)===O).map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})).filter(t=>!e.some(e=>e.value===t.value))]).length&&n.has(O)&&(i.serviceKinds||["llm"]).includes(O)&&(l=[{id:r,name:i.name,value:s}])}else{let e=o.filter(e=>!(0,u.CP)(e)||"llm"===(0,u.CP)(e)),a=new Set([...t,...e].map(e=>e.value)),n=(0,u.KC)(r).filter(e=>!(0,u.CP)(e)||"llm"===(0,u.CP)(e)).map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})).filter(e=>!a.has(e.value));l=[...e,...t.filter(t=>!e.some(e=>e.value===t.value)),...n]}if(l.length>0){let t=U.find(e=>e.id===r),a=t?.name||i.name;e[r]={name:a,alias:s,color:i.color,models:l}}}else if(o){if(O&&a.has(O))return;let t=A.find(e=>e.provider===r)||E.find(e=>e.provider===r),n=U.find(e=>e.id===r),s=n?.name||t?.name||i.name,o=t?.providerSpecificData?.prefix||n?.prefix||r,l=Object.entries(S).filter(([,e])=>e.startsWith(`${r}/`)).map(([e,t])=>({id:t.replace(`${r}/`,""),name:e,value:`${o}/${t.replace(`${r}/`,"")}`})),d=H.filter(e=>e.providerAlias===r).map(e=>({id:e.id,name:e.name||e.id,value:`${o}/${e.id}`,isCustom:!0})),c=new Set(l.map(e=>e.value)),u=[...l,...d.filter(e=>!c.has(e.value))],m=u.length>0?u:[{id:`__placeholder__${r}`,name:`${o}/model-id`,value:`${o}/model-id`,isPlaceholder:!0}];e[r]={name:s,alias:o,color:i.color,models:m,isCustom:!0,hasModels:u.length>0}}else{var l;let t="cursor"===r?ee:"cline"===r?et:"clinepass"===r?ea:"zed"===r?en:[],o=t.length>0?t:(0,u.KC)(r),d=new Set(o.map(e=>e.id)),c=o.length>0,m=Object.entries(S).filter(([e,t])=>t.startsWith(`${s}/`)&&(!c||e===t.replace(`${s}/`,""))&&!d.has(t.replace(`${s}/`,""))).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t,isCustom:!0})),p=new Set(m.map(e=>e.id)),x=H.filter(e=>e.providerAlias===s&&!d.has(e.id)&&!p.has(e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,isCustom:!0})),h=[...o.map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`,kind:(0,u.CP)(e)})),...m,...x],g=new Set,f=(l=h.filter(e=>!g.has(e.value)&&(g.add(e.value),!0)),O?a.has(O)?l.filter(e=>e.isPlaceholder||(0,u.CP)(e)===O):l:l.filter(e=>e.isPlaceholder||e.isCustom||!(0,u.CP)(e)||"llm"===(0,u.CP)(e)));0===f.length&&O&&n.has(O)&&(i.serviceKinds||["llm"]).includes(O)&&(f=[{id:r,name:i.name,value:s}]),f.length>0&&(e[r]={name:i.name,alias:s,color:i.color,models:f})}}),Object.entries(e).forEach(([t,a])=>{let n=new Set([...J[(0,m.wG)(t)]||[],...J[t]||[]]);0!==n.size&&(a.models=a.models.filter(e=>!n.has(e.id)),0===a.models.length&&delete e[t])}),Object.entries(e).forEach(([t,a])=>{let n=A.filter(e=>e.provider===t),r=[];for(let e of n)Array.isArray(e.providerSpecificData?.enabledModels)&&e.providerSpecificData.enabledModels.length>0&&r.push(...e.providerSpecificData.enabledModels);if(r.length>0){let n=new Set(r),s=a.alias||(0,m.wG)(t)||t;a.models=a.models.filter(e=>n.has(e.id)||n.has(e.value)||n.has(`${s}/${e.id}`)||e.value&&n.has(e.value.replace(`${s}/`,""))),0===a.models.length&&delete e[t]}}),e},[A,S,el,U,H,J,O,E,R,ee,et,ea,en]),ec=(0,r.useMemo)(()=>p(z),[z]),eu=(0,r.useMemo)(()=>O||W?[]:ec.isEmpty?M:M.filter(e=>x(e.name,ec)),[M,ec,O,W]),em=(0,r.useMemo)(()=>{let e={};return Object.entries(ed).forEach(([t,a])=>{var n;let r=a.models;if(!W||0!==(r=r.filter(e=>D(e.value)?.[W]===!0)).length){if(!ec.isEmpty){let e=x(a.name,ec),n=I&&(a.alias&&x(a.alias,ec)||t&&x(t,ec)||x(`${a.alias}/*`,ec));if(0===(r=r.filter(t=>!!x(t,ec)||(!!e||!!n)&&(!(ec.negativeTerms.length>0)||x(t,{...ec,positiveTerms:[]})))).length)return}e[t]={...a,models:[...(n=r).filter(e=>T.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name)),...n.filter(e=>!T.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name))]}}}),e},[ed,ec,T,I]),ep=(0,r.useMemo)(()=>{let e=[];return Object.values(em).forEach(t=>{t.models.forEach(t=>{t.isPlaceholder||e.push(t)})}),e},[em]),ex=(0,r.useMemo)(()=>ep.filter(e=>!T.includes(e.value)),[ep,T]),eh=(0,r.useMemo)(()=>ep.filter(e=>T.includes(e.value)),[ep,T]),eg=e=>{let n=e?.value||e?.name||e;T.includes(n)&&s?s(e):a(e),F&&(t(),q(""))};return(0,n.jsxs)(o.default,{isOpen:e,onClose:()=>{t(),q("")},title:N,size:C,className:"p-4!",footer:null,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,n.jsx)("span",{children:I?"Click to add/remove a model, or click a provider name for wildcard (e.g. provider/*). Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/).":"Click to add, click again to remove. Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/)."})]}),(0,n.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,n.jsx)("input",{type:"text",placeholder:I?"Search models (e.g. claude -haiku, oc/*, /regex/)...":"Search models (e.g. claude -haiku, !embed, /regex/)...",value:z,onChange:e=>q(e.target.value),className:"w-full pl-8 pr-20 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,n.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[ec.isRegex&&(0,n.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-primary/10 text-primary font-mono font-medium",children:"regex"}),ec.negativeTerms.length>0&&!ec.isRegex&&(0,n.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-amber-500/10 text-amber-500 font-mono font-medium",children:"!exclude"}),z&&(0,n.jsx)("button",{type:"button",onClick:()=>q(""),className:"text-text-muted hover:text-text-main cursor-pointer p-0.5 rounded",title:"Clear search",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px] leading-none",children:"close"})})]})]}),!F&&ep.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-1 text-[11px] text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("span",{children:[ep.length," models"]}),T.length>0&&(0,n.jsxs)("span",{className:"text-primary font-medium",children:["(",T.length," selected)"]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[ex.length>0&&(0,n.jsxs)("button",{type:"button",onClick:()=>{0!==ex.length&&(i?i(ex):ex.forEach(e=>a(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors cursor-pointer",title:"Select all filtered models",children:["Select All (",ex.length,")"]}),eh.length>0&&(0,n.jsxs)("button",{type:"button",onClick:()=>{0!==eh.length&&(k?k(eh):s&&eh.forEach(e=>s(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-border/40 text-text-muted hover:text-text-main hover:bg-border/60 transition-colors cursor-pointer",title:"Deselect all filtered models",children:["Deselect All (",eh.length,")"]})]})]})]}),(0,n.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[eu.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,n.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,n.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",eu.length,")"]})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eu.map(e=>{let t=j===e.name;return(0,n.jsxs)("button",{onClick:()=>eg({id:e.name,name:e.name,value:e.name}),className:`
2
2
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
3
3
  ${t?"bg-primary text-white border-primary":T.includes(e.name)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
4
  `,children:[T.includes(e.name)&&(0,n.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(em).map(([e,t])=>{let a=`${t.alias||e}/*`,r=I&&T.includes(a);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5 z-10",children:[(0,n.jsx)(l.A,{src:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),I?(0,n.jsxs)("button",{type:"button",onClick:()=>eg({value:a,name:a}),title:r?`Click to remove wildcard ${a}`:`Click to allow all models from ${t.name} (${a})`,className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-medium transition-all cursor-pointer border ${r?"bg-primary text-white border-primary shadow-2xs hover:bg-primary-hover":"text-primary border-transparent hover:bg-primary/10 hover:border-primary/20"}`,children:[r&&(0,n.jsx)("span",{className:"material-symbols-outlined leading-none text-[12px]",children:"check"}),(0,n.jsx)("span",{children:t.name}),(0,n.jsx)("span",{className:`text-[10px] font-mono px-1 py-0.2 rounded ${r?"bg-white/20 text-white":"text-text-muted bg-sidebar border border-border/50"}`,children:a})]}):(0,n.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,n.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=j===e.value,a=e.isPlaceholder;return(0,n.jsx)("button",{onClick:()=>eg(e),title:a?"Select to pre-fill, then edit model ID in the input":void 0,className:`
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{898:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>L});var a=r(95155),i=r(12115),s=r(73321),n=r(57250),l=r(13097);let o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function x(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function f(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function y(e,t,r=[]){let a=t?.[e]?.hidden;return Array.isArray(a)&&0!==a.length?new Set((r.length>0?function(e=[],t=[]){if(!Array.isArray(e)||0===e.length)return[];let r=new Set(t.map(f).filter(Boolean));return[...new Set(e.map(e=>String(e).trim()).filter(e=>r.has(e)))]}(a,r):a).map(String)):new Set}function v({quotas:e=[],compact:t=!1,sortMode:r="default",onHideQuota:s=null}){let[n,l]=(0,i.useState)(1),o=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):g(e?.used,e?.total)})),[e]),d=(0,i.useMemo)(()=>"remaining-asc"===r?[...o].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...o].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10));if((0,i.useEffect)(()=>{l(1)},[r,e]),(0,i.useEffect)(()=>{l(e=>Math.min(e,c))},[c]),!e||0===e.length)return(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No quota data available"})});let u=d.slice((n-1)*10,10*n),m=0===d.length?0:(n-1)*10+1,x=Math.min(10*n,d.length),h=t?"py-1 px-1.5":"py-2 px-3",p=t?"text-[11px]":"text-sm",b=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",y="function"==typeof s;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-between gap-2",children:(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[d.length," quota",d.length>1?"s":""]})}),(0,a.jsx)("div",{className:"space-y-px",children:u.map(e=>{var r;let i=!0===e.unlimited,n=!0===e.isCreditBalance,l=n?{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500",bgLight:"bg-blue-500/10",emoji:"\uD83D\uDCB0"}:i||(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},o=e.neverExpires?"-":function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),d=!e.neverExpires&&!e.resetAt&&!!e.detailUrl,c=e.neverExpires?"Never expires":d?"See details":function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),u=d&&e.detailUrl?e.detailUrl:c,m=!1!==e.recurring?`in ${o}`:`expires in ${o}`,x=t=>d?(0,a.jsxs)("a",{href:e.detailUrl,target:"_blank",rel:"noopener noreferrer",className:`${t} inline-flex items-center gap-0.5 hover:text-text-primary hover:underline`,title:`Open usage details: ${u}`,"aria-label":`Open usage details for ${e.name}`,children:[c,(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]}):c;return(0,a.jsxs)("div",{className:`flex items-center gap-2 border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${h}`,children:[(0,a.jsxs)("div",{className:"flex w-36 min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:l.emoji}),(0,a.jsx)("span",{className:`${p} font-medium text-text-primary truncate`,children:e.name})]}),(0,a.jsxs)("div",{className:`min-w-0 flex-1 ${t?"space-y-1":"space-y-1.5"}`,children:[!i&&!n&&(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${l.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${l.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between gap-1 min-w-0 ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted truncate",title:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:n?`Credit balance: ${e.total.toFixed(2)} ${e.currency||""}`:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}`,children:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:n?`Credit: ${e.total.toFixed(2)} ${e.currency||""}`:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}${e.unit?` ${e.unit}`:""}`}),(0,a.jsx)("span",{className:`font-medium ${i?"text-green-600 dark:text-green-400":n?"text-blue-600 dark:text-blue-400":l.text} shrink-0`,children:i?"Unlimited":n?"":`${e.remaining}%`})]})]}),(0,a.jsx)("div",{className:"min-w-0 shrink",children:"-"!==o||c?t?(0,a.jsx)("div",{className:`${b} text-text-primary font-medium truncate`,title:u||"",children:"-"!==o?m:x(b)}):(0,a.jsxs)("div",{className:"min-w-0 space-y-0.5",children:["-"!==o&&(0,a.jsx)("div",{className:`${b} text-text-primary font-medium truncate`,children:m}),c&&(0,a.jsx)("div",{className:`${f} text-text-muted truncate`,children:x(f)})]}):(0,a.jsx)("div",{className:`${b} text-text-muted italic`,children:"N/A"})}),y&&(0,a.jsx)("button",{type:"button",onClick:()=>s(e),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})]},`${e.name}-${e.index}`)})}),c>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",m,"-",x," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",n," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.max(1,e-1)),disabled:1===n,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.min(c,e+1)),disabled:n===c,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var w=r(98542),k=r(97677),j=r(84588),N=r(35497),C=r(97132),S=r(93195),A=r(88105),$=r(5293);let P={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},q={claude:"claudeAutoPing",codex:"codexAutoPing"};function E(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function _(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}let D={five_hour:"session",seven_day:"weekly",seven_day_overage_included:"weekly",seven_day_opus:"Opus weekly",seven_day_sonnet:"Sonnet weekly"};function O(e){let t=[...new Set((e||[]).map(e=>D[e]).filter(Boolean))];return t.length?`${t.join(" + ")} limits`:"limits"}function T(e){return A.Q2[e]?.name||e}function M(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function F(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}function L(){let{copied:e,copy:t}=(0,$.C)(),r=(0,s.useSearchParams)(),D=(0,s.useRouter)(),L=(0,s.usePathname)(),[I,R]=(0,i.useState)([]),[z,U]=(0,i.useState)({}),[H,W]=(0,i.useState)({}),[B,J]=(0,i.useState)({}),[K,V]=(0,i.useState)(!0),[G,Q]=(0,i.useState)({claude:{},codex:{}}),[Z,Y]=(0,i.useState)(null),[X,ee]=(0,i.useState)(!1),[et,er]=(0,i.useState)(!1),[ea,ei]=(0,i.useState)(60),[es,en]=(0,i.useState)(!0),[el,eo]=(0,i.useState)(null),[ed,ec]=(0,i.useState)(null),[eu,em]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,eb]=(0,i.useState)(null),[eg,ef]=(0,i.useState)(!1),[ey,ev]=(0,i.useState)(null),[ew,ek]=(0,i.useState)([]),[ej,eN]=(0,i.useState)(()=>r?.get("provider")||"all"),eC=(0,i.useCallback)(e=>{eN(e);try{let t=new URLSearchParams(r?.toString()||"");"all"===e?t.delete("provider"):t.set("provider",e);let a=t.toString()?`${L}?${t.toString()}`:L;D.replace(a,{scroll:!1})}catch{}},[L,D,r]),[eS,eA]=(0,i.useState)([]),[e$,eP]=(0,i.useState)("all"),[eq,eE]=(0,i.useState)("default"),[e_,eD]=(0,i.useState)({}),[eO,eT]=(0,i.useState)(!1),[eM,eF]=(0,i.useState)(!1),[eL,eI]=(0,i.useState)(!1),[eR,ez]=(0,i.useState)(1),[eU,eH]=(0,i.useState)(20),[eW,eB]=(0,i.useState)(String(20)),[eJ,eK]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eV,eG]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eQ=(0,i.useRef)(null),eZ=(0,i.useRef)(null),eY=(0,i.useRef)(0),eX=(0,i.useCallback)(async(e=eR)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eU),accountStatus:e$,sort:"priority"});"all"!==ej&&a.set("provider",ej);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eU,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return R(n),eA(s.providerOptions||[]),eK(l),eG(o),ez((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),R([]),eA([]),eK({page:1,pageSize:eU,total:0,totalPages:1}),eG({eligibleConnections:0,providerFilteredConnections:0}),[]}},[e$,eR,eU,ej]),e0=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{W(t=>({...t,[e]:!0})),J(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};U(t=>({...t,[e]:a}));return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let n={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":if(t.quotas){let e=Object.entries(t.quotas),a=new Set(["gemini_weekly","claude_gpt_weekly"]),i=new Set(["gemini_session","claude_gpt_session"]),s=new Set([...a,...i]),n=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),l=e.filter(([e])=>e.startsWith("claude-")),o=e.filter(([e])=>e.includes("image")),d=e.filter(([e])=>s.has(e)),c=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.includes("image")&&!s.has(e)),u=!!t.quotas.gemini_weekly,m=!!t.quotas.gemini_session,x=!!t.quotas.claude_gpt_weekly,h=!!t.quotas.claude_gpt_session;if(m)d.filter(([e])=>"gemini_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(n.length>0){let e=n.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.gemini_weekly?.resetAt;u&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}if(u&&d.filter(([e])=>"gemini_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),h)d.filter(([e])=>"claude_gpt_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(l.length>0){let e=l.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.claude_gpt_weekly?.resetAt;x&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Claude (Sonnet / Opus)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}x&&d.filter(([e])=>"claude_gpt_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),o.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),x||h||c.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let a=e;"spark_session"===e?a="Spark (5h)":"spark_weekly"===e?a="Spark (Weekly)":"session"===e?a="5h":"weekly"===e?a="Weekly":"review_session"===e?a="Review (5h)":"review_weekly"===e&&(a="Review (Weekly)"),r.push({name:a,quotaType:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":case"qoder-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{t&&0!==(Number(t.total)||0)&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":"addOn"===e?"Add-on":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null,neverExpires:!0===t.neverExpires,detailUrl:t.detailUrl||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||100)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:g(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":case"codebuddy-intl":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,isCreditBalance:t.isCreditBalance??!0,currency:t.currency||(e.includes("(")?e.slice(e.indexOf("(")+1,e.indexOf(")")):"USD")})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"groq":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"zed":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:t.unlimited})});break;case"minimax-code":case"minimax-code-global":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,remainingPercentage:t.remainingPercentage,resetAt:t.resetAt||null,message:t.message,isCreditBalance:t.isCreditBalance,currency:t.currency})});break;case"tokenharbor":case"nara-router":case"apmix":case"apinex":case"tiarina":case"xkiro":case"beatapi":case"kiraai":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total,remainingPercentage:t.remainingPercentage,resetAt:t.resetAt||null,unlimited:!0===t.unlimited,isCreditBalance:!0===t.isCreditBalance,currency:t.currency||"USD"})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,l.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return("gemini"===a||"gemini_session"===a)&&(a="gemini-3.8-flash-high"),("claude"===a||"claude_gpt_session"===a)&&(a="claude-sonnet-4-6"),("gemini"===i||"gemini_session"===i)&&(i="gemini-3.8-flash-high"),("claude"===i||"claude_gpt_session"===i)&&(i="claude-sonnet-4-6"),(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};U(t=>({...t,[e]:n}))}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),J(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{W(t=>({...t,[e]:!1}))}},[]),e1=(0,i.useCallback)(async(e,t)=>{await e0(e,t,{force:!0})},[e0]),e5=(0,i.useCallback)(async(e,t)=>{if(("codex"===t||"claude"===t)&&!eu){em(e),J(t=>({...t,[e]:null}));try{let r="claude"===t?await fetch(`/api/usage/${e}/claude-reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grantId:z[e]?.raw?.resetCredits?.nextGrantId})}):await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset limit");await e0(e,t,{force:!0})}catch(t){J(r=>({...r,[e]:t.message||"Failed to reset limit"}))}finally{em(null)}}},[e0,eu,z]),e2=(0,i.useCallback)((e,t)=>{eb({connection:e,loading:!1,error:null,data:{kind:"claude",...t}})},[]),e3=(0,i.useCallback)(async e=>{eb({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>(e.expiresAt?new Date(e.expiresAt).getTime():1/0)-(t.expiresAt?new Date(t.expiresAt).getTime():1/0)),eb({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eb({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),e4=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){eo(e);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&(U(t=>{let r={...t};return delete r[e],r}),W(t=>{let r={...t};return delete r[e],r}),J(t=>{let r={...t};return delete r[e],r}),await b(eX,eR))}catch(e){console.error("Error deleting connection:",e)}finally{eo(null)}}},[eX,eR]),e8=(0,i.useCallback)(async(e,t)=>{ec(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&await b(eX,eR)}catch(e){console.error("Error updating connection status:",e)}finally{ec(null)}},[eX,eR]),e6=(0,i.useCallback)(async e=>{if(!ey?.id)return;let t=ey.id,r=ey.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eX(),ef(!1),ev(null),A.wb.includes(r)&&await e0(t,r))}catch(e){console.error("Error saving connection:",e)}},[ey,eX,e0]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ek(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e9=(0,i.useCallback)(async(e=!1)=>{if(et)return;er(!0),ei(60);let t=eY.current+=1;try{let r=await eX(eR),a=function(e,{force:t=!1,tick:r=1,claudeEvery:a=1}={}){return e.filter(e=>t||"claude"!==e.provider||r%a==0)}(r,{force:e,tick:t,claudeEvery:10});W(h(a)),J(e=>p(e,r)),U(e=>p(e,r)),await Promise.all(a.map(e=>e0(e.id,e.provider)))}catch(e){console.error("Error refreshing all providers:",e)}finally{er(!1)}},[et,eX,e0,eR]);(0,i.useEffect)(()=>{(async()=>{en(!0);let e=await eX(eR);en(!1),W(h(e)),J(t=>p(t,e)),U(t=>p(t,e)),await Promise.all(e.map(e=>e0(e.id,e.provider)))})()},[eX,e0,eR]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);V(null===e||"true"===e),ee(!0)},[]),(0,i.useEffect)(()=>{X&&window.localStorage.setItem(o,String(K))},[K,X]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{Q({claude:e?.claudeAutoPing||{},codex:e?.codexAutoPing||{}}),eD(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e7=(0,i.useCallback)(async(e,t,{reactive:r,schedule:a})=>{let i=q[t];if(!i)return;let s=G[t]||{},n={...s,connections:{...s.connections||{},[e]:r},schedules:{...s.schedules||{},[e]:a}};Q({...G,[t]:n});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[i]||{},connections:n.connections,schedules:n.schedules};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[i]:t})})}catch{Q(G)}},[G]),te=(0,i.useCallback)(async(e,t)=>{eD(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eD(t)}},[]),tt=(0,i.useCallback)((e,t)=>{let r=f(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.add(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}te({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,te]),tr=(0,i.useCallback)((e,t)=>{let r=f(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.delete(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}te({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,te]);(0,i.useEffect)(()=>{if(!X||!K){eQ.current&&(clearInterval(eQ.current),eQ.current=null),eZ.current&&(clearInterval(eZ.current),eZ.current=null);return}return eQ.current=setInterval(()=>{e9()},6e4),eZ.current=setInterval(()=>{ei(e=>e<=1?60:e-1)},1e3),()=>{eQ.current&&clearInterval(eQ.current),eZ.current&&clearInterval(eZ.current)}},[K,e9,X]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(eQ.current&&(clearInterval(eQ.current),eQ.current=null),eZ.current&&(clearInterval(eZ.current),eZ.current=null)):K&&X&&(eQ.current&&(clearInterval(eQ.current),eQ.current=null),eZ.current&&(clearInterval(eZ.current),eZ.current=null),eQ.current=setInterval(()=>e9(),6e4),eZ.current=setInterval(()=>{ei(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[K,e9,X]);let ta=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=x(e,t),s=x(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(m(e)||"").localeCompare(m(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(I,z,eO,ej,eq),[I,z,eO,ej,eq]),ti=e=>{let t=z[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=g(e.used,e.total))},ts=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eL){eI(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await b(eX,eR)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eI(!1)}}},[eL,eX,eR]),tn="all"===ej?"All providers":T(ej),tl=eV.eligibleConnections>0,to=ta.length>0,td=eV.eligibleConnections?eV.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ej?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===e$?"turned off":"active"===e$?"active":"matching"} accounts found for ${ej}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},tc=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eJ),tu=!d.includes(eU);return es||tl?es||to?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eF(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eM,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ej?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(n.A,{src:`/providers/${ej}.png`,alt:ej,size:18,className:"size-[18px] rounded object-contain",fallbackText:ej.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate hidden lg:inline",children:tn})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eM&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eF(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==ej&&ez(1),eC("all"),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ej?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ej&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:eS.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{ej!==e&&ez(1),eC(e),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ej===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(n.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium",children:T(e)}),ej===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:e$,onChange:e=>{let t=e.target.value;e$!==t&&ez(1),eP(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ej&&(0,a.jsx)("select",{value:eq,onChange:e=>eE(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eT(e=>!e),"aria-pressed":eO,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eO?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{ts(ta.filter(e=>(e.isActive??!0)&&ti(e)).map(e=>e.id),!1)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{ts(ta.filter(e=>!(e.isActive??!0)&&!ti(e)).map(e=>e.id),!0)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>V(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:K?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${K?"text-primary":"text-text-muted"}`,children:K?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),K&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",ea,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e9(!0),disabled:et,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${et?"animate-spin":""}`,children:"refresh"})})]})}),eO&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:ta.map(r=>{let i,s,l,o=z[r.id],d=H[r.id],c=B[r.id],u=!1===r.isActive,x="codex"===r.provider,h="claude"===r.provider?o?.raw?.resetCredits:null,p=x?"Codex reset credit":"Claude limit reset",b=Number.isFinite(s="number"==typeof(i=o?.raw?.resetCredits?.availableCount)?i:Number(i))?Math.max(0,s):0,g=eu===r.id,N=el===r.id||ed===r.id||g,C=o?.quotas||[],A=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=y(e,r,t);return 0===a.size?t:t.filter(e=>!a.has(f(e)))}(r.provider,C,e_),$=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=y(e,r,t);return 0===a.size?[]:t.filter(e=>a.has(f(e)))}(r.provider,C,e_);return(0,a.jsxs)(j.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(n.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:T(r.provider)}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,E(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:E(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(l=r.providerSpecificData?.authMethod)&&P[l]?P[l]:"api_key"===r.authType?"API Key":"OAuth"}),_(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:_(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(x||h)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.default,{text:b>0?h?`Use your reset now (${b} left, use by ${M(h.expiresAt)}) \xb7 refills ${O(h.clears)}`:`Use one ${p}. Available: ${b}`:`No ${p}s available`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>eh({connection:r,resetCreditCount:b}),disabled:b<=0||d||N,"aria-label":b>0?`Use one ${p}. ${b} available.`:`No ${p}s available`,className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${g?"animate-spin":""}`,children:g?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(k.default,{text:x?"View Codex reset credit expiry":"View Claude Code reset expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>x?e3(r):e2(r,h),disabled:d||N,"aria-label":x?"View Codex reset credit expiry":"View Claude Code reset expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),q[r.provider]&&"oauth"===r.authType&&(()=>{let e=G[r.provider]||{},t=e.connections?.[r.id]===!0,i=e.schedules?.[r.id],s=i?.enabled===!0,n=[];if(t&&n.push("On reset"),s){let e=(0,S.JW)(i).join(" / ");n.push(`Scheduled (${e||"active"})`)}let l=n.length>0?`Auto-ping active: ${n.join(" + ")}. Click to configure.`:"codex"===r.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure.";return(0,a.jsx)(k.default,{text:l,children:(0,a.jsx)("button",{type:"button",onClick:()=>Y(r),"aria-label":"Configure auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${t||s?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})})})(),(0,a.jsx)(k.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r.id,r.provider),disabled:d||N,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(k.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ev(r),ef(!0)},disabled:N,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(k.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>e4(r.id),disabled:N,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${el===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(w.default,{size:"sm",checked:r.isActive??!0,disabled:N,onChange:e=>e8(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):c?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(v,{quotas:A,compact:!0,sortMode:"default",onHideQuota:e=>tt(r.provider,e)}),$.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:$.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>tr(r.provider,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},f(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:tc}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tu?"custom":String(eU),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(ez(1),eH(r),eB(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eW,onChange:e=>eB(e.target.value),onBlur:()=>{let e=Number.parseInt(eW,10);if(!Number.isFinite(e))return void eB(String(eU));let t=Math.min(500,Math.max(1,e));ez(1),eH(t),eB(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eW,10);if(!Number.isFinite(t))return void eB(String(eU));let r=Math.min(500,Math.max(1,t));ez(1),eH(r),eB(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eJ.page," / ",eJ.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>ez(1),disabled:eJ.page<=1||es||et,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>ez(e=>Math.max(1,e-1)),disabled:eJ.page<=1||es||et,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>ez(e=>Math.min(eJ.totalPages,e+1)),disabled:eJ.page>=eJ.totalPages||es||et,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>ez(eJ.totalPages),disabled:eJ.page>=eJ.totalPages||es||et,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(N.uo,{isOpen:!!ex,onClose:()=>{eu||eh(null)},onConfirm:async()=>{let e=ex?.connection;e&&(await e5(e.id,e.provider),eh(null))},title:ex?.connection?.provider==="claude"?"Reset Claude limits?":"Reset Codex limit?",message:ex?.connection?.provider==="claude"?`Refills your ${O(z[ex.connection.id]?.raw?.resetCredits?.clears)} now for ${m(ex.connection)||"this account"} \xb7 your weekly reset day stays ${M(z[ex.connection.id]?.raw?.resetCredits?.weeklyResetsAt)}. This cannot be undone. Resets left: ${ex.resetCreditCount??0}.`:`Use 1 Codex reset credit for ${m(ex?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${ex?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!eu}),ep&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:ep.data?.kind==="claude"?"Claude Code Limit Resets":"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:m(ep.connection)||(ep.data?.kind==="claude"?"Claude account":"Codex account")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eb(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ep.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ep.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ep.error}):ep.data?.kind==="claude"&&ep.data.grants?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ep.data.availableCount??0," reset",1===ep.data.availableCount?"":"s"," left"]}),(0,a.jsxs)("span",{children:["Weekly reset day: ",M(ep.data.weeklyResetsAt)]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Reset"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Left"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Refills"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Use By"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:(ep.data.grants||[]).map(e=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsxs)("td",{className:"px-3 py-2",children:[(0,a.jsx)("div",{className:"text-text-primary",children:e.label||e.id}),(0,a.jsx)("span",{className:"mt-1 inline-block rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.resetsLeft<=0?"used":e.paused?"paused":e.endsAt&&new Date(e.endsAt).getTime()<=Date.now()?"expired":e.usableNow?"usable now":e.startsAt&&new Date(e.startsAt).getTime()>Date.now()?"not started":e.useRequiresLimit?"at limit only":"unavailable"})]}),(0,a.jsxs)("td",{className:"whitespace-nowrap px-3 py-2 font-medium tabular-nums text-text-primary",children:[e.resetsLeft," / ",e.resetsTotal]}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:O(e.clears)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:M(e.endsAt)}),(0,a.jsx)("td",{className:"whitespace-nowrap px-3 py-2 font-medium text-text-primary",children:F(e.endsAt)})]},e.id))})]})})]}):ep.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ep.data.credits.length," reset credit",1===ep.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ep.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ep.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:M(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:M(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:F(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:ep.data?.kind==="claude"?"No limit resets available for this account.":"No reset credit details returned for this account."})})]})}),(0,a.jsx)(N.wI,{isOpen:eg,connection:ey,proxyPools:ew,onSave:e6,onClose:()=>{ef(!1),ev(null)}}),Z&&(0,a.jsx)(C.A,{isOpen:!!Z,onClose:()=>Y(null),connection:Z,reactive:G[Z.provider]?.connections?.[Z.id]===!0,schedule:G[Z.provider]?.schedules?.[Z.id]||null,onSave:e=>e7(Z.id,Z.provider,e)})]}):(0,a.jsx)(j.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:td.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:td.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:td.description})]})}):(0,a.jsx)(j.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}},93195:(e,t,r)=>{"use strict";function a(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}r.d(t,{JW:()=>o,Vm:()=>a,fB:()=>s,gy:()=>i,nz:()=>n});let i={anchor:"09:30",timezone:a(),windowHours:5,slotsPerDay:3};function s(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let r=Number(t[1]),a=Number(t[2]);return r>23||a>59?null:{hour:r,minute:a}}function n(e){return Math.max(1,Math.floor(24/e))}function l(e,t,r,a){let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.min(a,Math.max(r,i)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=s(e.anchor)||s(i.anchor),r=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?i.timezone:e.timezone,o=l(e.windowHours,i.windowHours,.5,24),d=Math.round(l(e.slotsPerDay,i.slotsPerDay,1,n(o)));return{enabled:!0,anchor:r,timezone:a,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:r,minute:a}=s(t.anchor),o=60*r+a;return Array.from({length:t.slotsPerDay},(e,r)=>{let a=Math.round(o+r*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}},97132:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var a=r(95155),i=r(12115),s=r(14051),n=r.n(s),l=r(35497),o=r(31474),d=r(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function u({isOpen:e,onClose:t,onSave:r,connection:s,reactive:n=!1,schedule:m=null}){let[x,h]=(0,i.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:m?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(m?.windowHours??d.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??d.gy.slotsPerDay)})),p=Number(x.windowHours),b=Number(x.slotsPerDay),g=!!(0,d.fB)(x.anchor),f=Number.isFinite(p)&&p>=.5&&p<=24,y=f?(0,d.nz)(p):24,v=Number.isInteger(b)&&b>=1&&b<=y,w=g&&f&&v,k="schedule"!==x.mode||w,j=w?(0,d.JW)({enabled:!0,...x,windowHours:p,slotsPerDay:b}):[],N=j.length&&f?(()=>{let{hour:e,minute:t}=(0,d.fB)(x.anchor),r=Math.round(60*e+t+b*p*60)%1440;return`${String(Math.floor(r/60)).padStart(2,"0")}:${String(r%60).padStart(2,"0")}`})():"",C=e=>h(t=>({...t,...e}));return(0,a.jsx)(l.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(l.$n,{onClick:()=>{k&&(r({reactive:"reset"===x.mode,schedule:"schedule"===x.mode?{enabled:!0,anchor:x.anchor,timezone:x.timezone,windowHours:p,slotsPerDay:b}:{enabled:!1}}),t())},disabled:!k,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",s?.name?` for ${s.name}`:""," — pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=x.mode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>C({mode:e.value}),className:(0,o.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",t?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,a.jsx)("span",{children:e.label})]},e.value)})}),"reset"===x.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===x.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,a.jsx)(l.pd,{label:"Anchor time",type:"time",value:x.anchor,onChange:e=>C({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(l.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:x.windowHours,onChange:e=>C({windowHours:e.target.value}),error:f?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(l.pd,{label:"Pings per day",type:"number",min:"1",max:String(y),step:"1",value:x.slotsPerDay,onChange:e=>C({slotsPerDay:e.target.value}),error:v?"":`1 – ${y}`,hint:v?`Max ${y}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),j.length>0&&(0,a.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,a.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",x.timezone,")"]}),(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:j.join(" → ")}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",j[0]," – ",N,", then pauses until ",j[0]," next day."]})]})]})]})})}u.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSave:n().func.isRequired,connection:n().object,reactive:n().bool,schedule:n().object}}},e=>{e.O(0,[8500,246,2723,705,5497,8441,3794,7358],()=>e(e.s=898)),_N_E=e.O()}]);