ekarouter 1.0.0

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 (242) hide show
  1. package/README.md +36 -0
  2. package/bin/cli.js +192 -0
  3. package/binaries/ekarouter-linux-amd64 +0 -0
  4. package/binaries/ekarouter-windows-amd64.exe +0 -0
  5. package/package.json +36 -0
  6. package/public/apple-touch-icon.png +0 -0
  7. package/public/assets/LoginView-CSzx0ltN.js +1 -0
  8. package/public/assets/OrangeSwitch-Dc_G3ztN.js +1 -0
  9. package/public/assets/QueryClientProvider-BjElddVn.js +1 -0
  10. package/public/assets/_id-BC10EHRw.js +4 -0
  11. package/public/assets/_id-CnBJVbQB.js +2 -0
  12. package/public/assets/api-lXjeGSiV.js +2 -0
  13. package/public/assets/bot-mZlhzHVu.js +1 -0
  14. package/public/assets/boxes-DXduN63I.js +1 -0
  15. package/public/assets/callback-D2O49UZw.js +2 -0
  16. package/public/assets/callback-pJodpDyd.js +1 -0
  17. package/public/assets/check-36OnHiEM.js +1 -0
  18. package/public/assets/chevron-down-DxUrtHFo.js +1 -0
  19. package/public/assets/chevron-right-CHJcvRU6.js +1 -0
  20. package/public/assets/circle-alert-CcGnUa7l.js +1 -0
  21. package/public/assets/cli-tools-DCOrwuor.js +21 -0
  22. package/public/assets/cloud-upload-D41DfGnv.js +1 -0
  23. package/public/assets/code-xml-BsvsUoDv.js +1 -0
  24. package/public/assets/combos-Df1jA7_R.js +1 -0
  25. package/public/assets/console-log-Bl-Kc0eo.js +2 -0
  26. package/public/assets/copy-B1k2VT2A.js +1 -0
  27. package/public/assets/createLucideIcon-CLdWFMku.js +1 -0
  28. package/public/assets/dialog-B56WVEML.js +41 -0
  29. package/public/assets/dist-yiyhte89.js +1 -0
  30. package/public/assets/endpoint-C-3fXtUc.js +36 -0
  31. package/public/assets/external-link-BYVStqz6.js +1 -0
  32. package/public/assets/eye-Cbs9C6DS.js +1 -0
  33. package/public/assets/eye-off-DIe2-cve.js +1 -0
  34. package/public/assets/file-text-BRzD_S8I.js +1 -0
  35. package/public/assets/flask-conical-CoRklKsr.js +1 -0
  36. package/public/assets/globe-hcLYcRzz.js +1 -0
  37. package/public/assets/hard-drive-Dakvr_if.js +1 -0
  38. package/public/assets/headerSearch-C758FsaX.js +1 -0
  39. package/public/assets/image-B10s4838.js +1 -0
  40. package/public/assets/jsx-runtime-B-hcVAMW.js +1 -0
  41. package/public/assets/key-BXUPFSjV.js +1 -0
  42. package/public/assets/kit-DGWILC5k.js +1 -0
  43. package/public/assets/laptop-D_8f9_v7.js +1 -0
  44. package/public/assets/layers-C_9oEa0w.js +1 -0
  45. package/public/assets/loader-circle-NEOay2w5.js +1 -0
  46. package/public/assets/lock-Chb45-Rn.js +1 -0
  47. package/public/assets/log-out-wyRkCSAT.js +1 -0
  48. package/public/assets/login-BuQTIKrL.js +1 -0
  49. package/public/assets/media-providers-C_wofVbG.js +1 -0
  50. package/public/assets/mic-D6DQAnIR.js +1 -0
  51. package/public/assets/network-D0tNT-6h.js +1 -0
  52. package/public/assets/pencil-CFgylVBP.js +1 -0
  53. package/public/assets/play-CPV0a6Tn.js +1 -0
  54. package/public/assets/playground-BIwkZcr_.js +67 -0
  55. package/public/assets/plus-qKI-KwZh.js +1 -0
  56. package/public/assets/preload-helper-CzRBhNKp.js +1 -0
  57. package/public/assets/providers-D8WoK8lA.js +1 -0
  58. package/public/assets/providersData-lrEpUDQM.js +1 -0
  59. package/public/assets/proxy-pools-BusHbtGD.js +5 -0
  60. package/public/assets/react-dom-8HkkFvw6.js +1 -0
  61. package/public/assets/refresh-cw-CHzni4H4.js +1 -0
  62. package/public/assets/routes-r_aF-Xnw.js +1 -0
  63. package/public/assets/search-BtJsgOj6.js +1 -0
  64. package/public/assets/server-CAbKLNFx.js +1 -0
  65. package/public/assets/settings-Tk-iCnFy.js +1 -0
  66. package/public/assets/shield-CMYlc0qf.js +1 -0
  67. package/public/assets/skills-D0d-ShKH.js +1 -0
  68. package/public/assets/spa-Bs7oEq98.js +10 -0
  69. package/public/assets/sparkles-DZ5Pl1vD.js +1 -0
  70. package/public/assets/styles-BSGa23zc.css +2 -0
  71. package/public/assets/terminal-BkaGpO2M.js +1 -0
  72. package/public/assets/theme-o081sJEj.js +1 -0
  73. package/public/assets/token-saver-DgfF_Mvq.js +1 -0
  74. package/public/assets/trash-2-D9HI9O7Q.js +1 -0
  75. package/public/assets/triangle-alert-DUFscLic.js +1 -0
  76. package/public/assets/upload--8EEkrQJ.js +1 -0
  77. package/public/assets/usage-D2lS5DQa.js +56 -0
  78. package/public/assets/useNavigate-D06Ztr27.js +1 -0
  79. package/public/assets/useQuery-BrM5_EQu.js +1 -0
  80. package/public/assets/utils-B6KiDbIe.js +1 -0
  81. package/public/assets/volume-2-DoDae9nb.js +1 -0
  82. package/public/assets/wifi-Bsq09YFd.js +1 -0
  83. package/public/assets/x-CGuQtexA.js +1 -0
  84. package/public/assets/zap-BS7lyU9U.js +1 -0
  85. package/public/favicon-16x16.png +0 -0
  86. package/public/favicon-32x32.png +0 -0
  87. package/public/favicon.ico +0 -0
  88. package/public/favicon.png +0 -0
  89. package/public/favicon.svg +3 -0
  90. package/public/icon-192.png +0 -0
  91. package/public/icon-512.png +0 -0
  92. package/public/icon.png +0 -0
  93. package/public/icons.svg +24 -0
  94. package/public/index.html +55 -0
  95. package/public/logo-icon-dark.svg +28 -0
  96. package/public/logo.png +0 -0
  97. package/public/providers/agentrouter.png +0 -0
  98. package/public/providers/alicode-intl.png +0 -0
  99. package/public/providers/alicode.png +0 -0
  100. package/public/providers/alims-intl.png +0 -0
  101. package/public/providers/alitp-intl.png +0 -0
  102. package/public/providers/amp.png +0 -0
  103. package/public/providers/anthropic-m.png +0 -0
  104. package/public/providers/anthropic.png +0 -0
  105. package/public/providers/antigravity.png +0 -0
  106. package/public/providers/api-airforce.png +0 -0
  107. package/public/providers/assemblyai.png +0 -0
  108. package/public/providers/aws-polly.png +0 -0
  109. package/public/providers/azure.png +0 -0
  110. package/public/providers/baidu.png +0 -0
  111. package/public/providers/bazaarlink.png +0 -0
  112. package/public/providers/black-forest-labs.png +0 -0
  113. package/public/providers/blackbox.png +0 -0
  114. package/public/providers/bluesminds.png +0 -0
  115. package/public/providers/brave-search.png +0 -0
  116. package/public/providers/bynara.svg +28 -0
  117. package/public/providers/byteplus.png +0 -0
  118. package/public/providers/cartesia.png +0 -0
  119. package/public/providers/cerebras.png +0 -0
  120. package/public/providers/chutes.png +0 -0
  121. package/public/providers/claude.png +0 -0
  122. package/public/providers/cline.png +0 -0
  123. package/public/providers/clinepass.png +0 -0
  124. package/public/providers/cloudflare-ai.png +0 -0
  125. package/public/providers/codebuddy-cn.png +0 -0
  126. package/public/providers/codebuddy-intl.png +0 -0
  127. package/public/providers/codex.png +0 -0
  128. package/public/providers/cohere.png +0 -0
  129. package/public/providers/comfyui.png +0 -0
  130. package/public/providers/commandcode.png +0 -0
  131. package/public/providers/continue.png +0 -0
  132. package/public/providers/copilot.png +0 -0
  133. package/public/providers/coqui.png +0 -0
  134. package/public/providers/cursor.png +0 -0
  135. package/public/providers/deepgram.png +0 -0
  136. package/public/providers/deepseek-tui.png +0 -0
  137. package/public/providers/deepseek.png +0 -0
  138. package/public/providers/devin-cli.png +0 -0
  139. package/public/providers/droid.png +0 -0
  140. package/public/providers/edge-tts.png +0 -0
  141. package/public/providers/elevenlabs.png +0 -0
  142. package/public/providers/exa.png +0 -0
  143. package/public/providers/fal-ai.png +0 -0
  144. package/public/providers/featherless.png +0 -0
  145. package/public/providers/firecrawl.png +0 -0
  146. package/public/providers/fireworks.png +0 -0
  147. package/public/providers/fish-audio.png +0 -0
  148. package/public/providers/gemini-cli.png +0 -0
  149. package/public/providers/gemini.png +0 -0
  150. package/public/providers/github.png +0 -0
  151. package/public/providers/gitlab.png +0 -0
  152. package/public/providers/glm-cn.png +0 -0
  153. package/public/providers/glm.png +0 -0
  154. package/public/providers/google-pse.png +0 -0
  155. package/public/providers/google-tts.png +0 -0
  156. package/public/providers/grok-cli.png +0 -0
  157. package/public/providers/grok-web.png +0 -0
  158. package/public/providers/groq.png +0 -0
  159. package/public/providers/hermes.png +0 -0
  160. package/public/providers/huggingface.png +0 -0
  161. package/public/providers/hyperbolic.png +0 -0
  162. package/public/providers/iflow.png +0 -0
  163. package/public/providers/inworld.png +0 -0
  164. package/public/providers/jcode.png +0 -0
  165. package/public/providers/jina-ai.png +0 -0
  166. package/public/providers/jina-reader.png +0 -0
  167. package/public/providers/kilo-gateway.png +0 -0
  168. package/public/providers/kilocode.png +0 -0
  169. package/public/providers/kimchi.png +0 -0
  170. package/public/providers/kimchi.svg +4 -0
  171. package/public/providers/kimi-coding.png +0 -0
  172. package/public/providers/kimi.png +0 -0
  173. package/public/providers/kiro.png +0 -0
  174. package/public/providers/linkup.png +0 -0
  175. package/public/providers/llm7.png +0 -0
  176. package/public/providers/local-device.png +0 -0
  177. package/public/providers/longcat.png +0 -0
  178. package/public/providers/mimo-free.png +0 -0
  179. package/public/providers/minimax-cn.png +0 -0
  180. package/public/providers/minimax.png +0 -0
  181. package/public/providers/mistral.png +0 -0
  182. package/public/providers/mmf.png +0 -0
  183. package/public/providers/morph.png +0 -0
  184. package/public/providers/nanobanana.png +0 -0
  185. package/public/providers/nara.svg +28 -0
  186. package/public/providers/nebius.png +0 -0
  187. package/public/providers/novita.png +0 -0
  188. package/public/providers/nvidia.png +0 -0
  189. package/public/providers/oai-cc.png +0 -0
  190. package/public/providers/oai-r.png +0 -0
  191. package/public/providers/ollama-local.png +0 -0
  192. package/public/providers/ollama.png +0 -0
  193. package/public/providers/openai.png +0 -0
  194. package/public/providers/openclaw.png +0 -0
  195. package/public/providers/opencode-go.png +0 -0
  196. package/public/providers/opencode.png +0 -0
  197. package/public/providers/opendesign.png +0 -0
  198. package/public/providers/openrouter.png +0 -0
  199. package/public/providers/perplexity-agent.png +0 -0
  200. package/public/providers/perplexity-web.png +0 -0
  201. package/public/providers/perplexity.png +0 -0
  202. package/public/providers/playht.png +0 -0
  203. package/public/providers/poolside.png +0 -0
  204. package/public/providers/qoder.png +0 -0
  205. package/public/providers/qwen.png +0 -0
  206. package/public/providers/recraft.png +0 -0
  207. package/public/providers/reka.png +0 -0
  208. package/public/providers/roo.png +0 -0
  209. package/public/providers/runwayml.png +0 -0
  210. package/public/providers/sambanova.png +0 -0
  211. package/public/providers/sdwebui.png +0 -0
  212. package/public/providers/searchapi.png +0 -0
  213. package/public/providers/searxng.png +0 -0
  214. package/public/providers/selfhosted-embedding.png +0 -0
  215. package/public/providers/selfhosted-stt.png +0 -0
  216. package/public/providers/selfhosted-tts.png +0 -0
  217. package/public/providers/serper.png +0 -0
  218. package/public/providers/siliconflow.png +0 -0
  219. package/public/providers/stability-ai.png +0 -0
  220. package/public/providers/tavily.png +0 -0
  221. package/public/providers/tencent.png +0 -0
  222. package/public/providers/together.png +0 -0
  223. package/public/providers/tokenrouter.png +0 -0
  224. package/public/providers/topaz.png +0 -0
  225. package/public/providers/tortoise.png +0 -0
  226. package/public/providers/trae.png +0 -0
  227. package/public/providers/venice.png +0 -0
  228. package/public/providers/vercel-ai-gateway.png +0 -0
  229. package/public/providers/vercel.png +0 -0
  230. package/public/providers/vertex-partner.png +0 -0
  231. package/public/providers/vertex.png +0 -0
  232. package/public/providers/volcengine-ark.png +0 -0
  233. package/public/providers/voyage-ai.png +0 -0
  234. package/public/providers/windsurf.png +0 -0
  235. package/public/providers/workbuddy.png +0 -0
  236. package/public/providers/xai.png +0 -0
  237. package/public/providers/xiaomi-mimo.png +0 -0
  238. package/public/providers/xiaomi-tokenplan.png +0 -0
  239. package/public/providers/xquik.png +0 -0
  240. package/public/providers/youcom.png +0 -0
  241. package/public/providers/zed.png +0 -0
  242. package/public/robots.txt +14 -0
@@ -0,0 +1,21 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as r}from"./api-lXjeGSiV.js";import{t as i}from"./createLucideIcon-CLdWFMku.js";import{t as a}from"./check-36OnHiEM.js";import{t as o}from"./copy-B1k2VT2A.js";import{t as s}from"./globe-hcLYcRzz.js";import{t as c}from"./hard-drive-Dakvr_if.js";import{u as ee}from"./kit-DGWILC5k.js";import{t as te}from"./key-BXUPFSjV.js";import{t as ne}from"./refresh-cw-CHzni4H4.js";import{t as re}from"./search-BtJsgOj6.js";import{t as l}from"./shield-CMYlc0qf.js";import{t as u}from"./trash-2-D9HI9O7Q.js";import{t as ie}from"./zap-BS7lyU9U.js";var ae=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),oe=i(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),se=i(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),d=i(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),f=i(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ce=i(`sliders-vertical`,[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]]),p=e(t(),1),m=n(),h=[{id:`claude`,name:`Claude Code`,category:`cli`,configType:`env`,icon:`/providers/claude.png`,color:`#D97757`,description:`Anthropic Claude Code CLI autonomous coding agent.`,settingsFile:`~/.claude/settings.json`,apiEndpoint:`/api/cli-tools/claude-settings`,installGuide:`npm install -g @anthropic-ai/claude-code`,defaultModels:[{id:`sonnet`,name:`Claude Sonnet (Primary Model)`,envKey:`ANTHROPIC_DEFAULT_SONNET_MODEL`,defaultValue:`anthropic/claude-3-7-sonnet-20250219`},{id:`opus`,name:`Claude Opus (High Reasoning / Deep Work)`,envKey:`ANTHROPIC_DEFAULT_OPUS_MODEL`,defaultValue:`anthropic/claude-3-opus-20240229`},{id:`haiku`,name:`Claude Haiku (Fast / Lightweight)`,envKey:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,defaultValue:`anthropic/claude-3-5-haiku-20241022`}]},{id:`codex`,name:`OpenAI Codex CLI`,category:`cli`,configType:`custom`,icon:`/providers/codex.png`,color:`#10A37F`,description:`OpenAI Codex developer terminal harness.`,settingsFile:`~/.codex/config.toml`,apiEndpoint:`/api/cli-tools/codex-settings`,installGuide:`npm install -g @openai/codex`,defaultModels:[{id:`model`,name:`Default Model`,defaultValue:`openai/gpt-4.5-preview`}]},{id:`opencode`,name:`OpenCode`,category:`cli`,configType:`custom`,icon:`/providers/opencode.png`,color:`#E87040`,description:`High-performance AI terminal coding assistant with multi-model provider.`,settingsFile:`~/.config/opencode/opencode.json`,apiEndpoint:`/api/cli-tools/opencode-settings`,installGuide:`winget install opencode / npm install -g opencode`,defaultModels:[{id:`model`,name:`Primary Model`,defaultValue:`anthropic/claude-3-7-sonnet-20250219`}]},{id:`cline`,name:`Cline / Roo Code`,category:`ide`,configType:`custom`,icon:`/providers/cline.png`,color:`#5B9BD5`,description:`Autonomous VS Code coding extension with plan/act modes.`,settingsFile:`~/.cline/data/globalState.json`,apiEndpoint:`/api/cli-tools/cline-settings`,defaultModels:[{id:`model`,name:`OpenAI Compatible Model`,defaultValue:`anthropic/claude-3-7-sonnet-20250219`}]},{id:`droid`,name:`Factory Droid`,category:`cli`,configType:`custom`,icon:`/providers/droid.png`,color:`#00D4FF`,description:`Factory Droid AI Assistant with terminal tools.`,settingsFile:`~/.factory/config.json`,apiEndpoint:`/api/cli-tools/droid-settings`,defaultModels:[{id:`model`,name:`Default Model`,defaultValue:`openai/gpt-4.5-preview`}]},{id:`openclaw`,name:`Open Claw`,category:`cli`,configType:`custom`,icon:`/providers/openclaw.png`,color:`#FF6B35`,description:`Autonomous agent execution CLI with multi-step workflows.`,settingsFile:`~/.openclaw/openclaw.json`,apiEndpoint:`/api/cli-tools/openclaw-settings`,defaultModels:[{id:`model`,name:`Default Model`,defaultValue:`combo/full-chain`}]},{id:`hermes`,name:`Hermes Agent`,category:`cli`,configType:`custom`,icon:`/providers/hermes.png`,color:`#8B5CF6`,description:`Nous Research self-improving coding agent.`,settingsFile:`~/.hermes/config.json`,apiEndpoint:`/api/cli-tools/hermes-settings`,defaultModels:[{id:`model`,name:`Agent Model`,defaultValue:`google/gemini-2.5-pro`}]},{id:`deepseek-tui`,name:`DeepSeek TUI`,category:`cli`,configType:`custom`,icon:`/providers/deepseek-tui.png`,color:`#4D6BFE`,description:`Rust-based Terminal User Interface coding agent for DeepSeek.`,settingsFile:`~/.deepseek/config.toml`,apiEndpoint:`/api/cli-tools/deepseek-tui-settings`,defaultModels:[{id:`model`,name:`Inference Model`,defaultValue:`deepseek/deepseek-chat`}]},{id:`jcode`,name:`jcode`,category:`cli`,configType:`custom`,icon:`/providers/jcode.png`,color:`#FF6B35`,description:`Ultra-fast Rust coding agent harness with 14ms boot and low memory footprint.`,settingsFile:`~/.jcode/config.toml`,apiEndpoint:`/api/cli-tools/jcode-settings`,defaultModels:[{id:`model`,name:`Primary Model`,defaultValue:`anthropic/claude-3-7-sonnet-20250219`}]},{id:`grok-build`,name:`Grok Build`,category:`cli`,configType:`custom`,icon:`/providers/grok-cli.png`,color:`#1DA1F2`,description:`xAI Grok Build TUI coding assistant.`,settingsFile:`~/.grok/config.toml`,apiEndpoint:`/api/cli-tools/grok-build-settings`,defaultModels:[{id:`model`,name:`Grok Routed Model`,defaultValue:`xai/grok-2-1212`}]},{id:`kilo`,name:`Kilo Code`,category:`cli`,configType:`custom`,icon:`/providers/kilocode.png`,color:`#FF6B6B`,description:`Kilo Code multi-agent CLI terminal assistant.`,settingsFile:`~/.local/share/kilo/auth.json`,apiEndpoint:`/api/cli-tools/kilo-settings`,defaultModels:[{id:`model`,name:`Default Model`,defaultValue:`kilocode/kilo-auto`}]},{id:`cowork`,name:`Claude Cowork`,category:`ide`,configType:`custom`,icon:`/providers/claude.png`,color:`#D97757`,description:`Claude Desktop Cowork with third-party inference.`,settingsFile:`~/.claude.json`,apiEndpoint:`/api/cli-tools/cowork-settings`},{id:`copilot`,name:`GitHub Copilot`,category:`ide`,configType:`guide`,icon:`/providers/copilot.png`,color:`#1F6FEB`,description:`Route Copilot sessions with auto-refreshing tokens and model translation.`,docsUrl:`https://marketplace.visualstudio.com`,guideSteps:[{step:1,title:`Install Extension`,desc:`Install GitHub Copilot or Copilot Chat in your VS Code / JetBrains editor.`},{step:2,title:`Configure Base URL`,desc:`Point your extension server proxy URL to EkaRouter.`,code:`{{baseUrl}}`},{step:3,title:`Authentication Token`,desc:`Provide your EkaRouter API Key in the authentication header.`}]},{id:`cursor`,name:`Cursor IDE`,category:`ide`,configType:`guide`,icon:`/providers/cursor.png`,color:`#000000`,description:`Route Cursor editor queries directly through EkaRouter.`,guideSteps:[{step:1,title:`Open Settings`,desc:`Open Cursor Settings > Models panel in the editor.`},{step:2,title:`Enable OpenAI API`,desc:`Toggle 'OpenAI API Key' and check 'Override OpenAI Base URL'.`},{step:3,title:`Set Endpoint`,desc:`Set the Base URL to your EkaRouter endpoint and enter your API Key.`,code:`{{baseUrl}}`},{step:4,title:`Add Custom Models`,desc:`Add models like 'anthropic/claude-3-7-sonnet-20250219' or 'openai/gpt-4.5-preview'.`}]},{id:`roo`,name:`Roo Code`,category:`ide`,configType:`guide`,icon:`/providers/roo.png`,color:`#FF6B6B`,description:`Multi-role autonomous coding extension for VS Code.`,guideSteps:[{step:1,title:`Open Roo Settings`,desc:`Navigate to the Roo Code panel in VS Code.`},{step:2,title:`Select Provider`,desc:`Choose 'OpenAI Compatible' or 'Ollama' from the provider dropdown.`},{step:3,title:`Base URL & Key`,desc:`Set Base URL to your EkaRouter endpoint with your API key.`,code:`{{baseUrl}}`}]},{id:`continue`,name:`Continue`,category:`ide`,configType:`guide`,icon:`/providers/continue.png`,color:`#7C3AED`,description:`Open-source AI coding assistant extension for VS Code and JetBrains.`,guideSteps:[{step:1,title:`Open config.json`,desc:`Press Ctrl+Shift+P and select 'Continue: Open config.json'.`},{step:2,title:`Add Model Block`,desc:`Insert the EkaRouter OpenAI-compatible configuration into the models array.`,code:`{
2
+ "title": "EkaRouter Sonnet",
3
+ "provider": "openai",
4
+ "model": "anthropic/claude-3-7-sonnet-20250219",
5
+ "apiKey": "{{apiKey}}",
6
+ "apiBase": "{{baseUrl}}"
7
+ }`}]},{id:`amp`,name:`Amp CLI`,category:`cli`,configType:`guide`,icon:`/providers/amp.png`,color:`#F97316`,description:`Sourcegraph Amp terminal assistant CLI.`,guideSteps:[{step:1,title:`Set Environment Variables`,desc:`Export OPENAI_BASE_URL and OPENAI_API_KEY in your terminal.`,code:`export OPENAI_BASE_URL={{baseUrl}}
8
+ export OPENAI_API_KEY={{apiKey}}
9
+ amp`}]},{id:`qwen`,name:`Qwen Code`,category:`cli`,configType:`guide`,icon:`/providers/qwen.png`,color:`#10B981`,description:`Alibaba Qwen Code CLI terminal assistant.`,guideSteps:[{step:1,title:`Edit ~/.qwen/settings.json`,desc:`Set the security auth provider to openai pointing to EkaRouter.`,code:`{
10
+ "security": {
11
+ "auth": {
12
+ "selectedType": "openai",
13
+ "apiKey": "{{apiKey}}",
14
+ "baseUrl": "{{baseUrl}}"
15
+ }
16
+ },
17
+ "model": {
18
+ "name": "anthropic/claude-3-7-sonnet-20250219"
19
+ }
20
+ }`}]},{id:`devin`,name:`Devin CLI`,category:`cli`,configType:`guide`,icon:`/providers/devin-cli.png`,color:`#6366F1`,description:`Cognition Devin CLI relay assistant.`,guideSteps:[{step:1,title:`Install Devin Binary`,desc:`Download and install devin CLI from cli.devin.ai.`},{step:2,title:`Authenticate`,desc:`Run devin auth login to register your local token.`,code:`devin auth login`}]},{id:`opendesign`,name:`OpenDesign`,category:`ide`,configType:`guide`,icon:`/providers/opendesign.png`,color:`#7C3AED`,description:`Agent-native UI/UX design skill pack for Claude Code & Cursor.`,guideSteps:[{step:1,title:`Install Skill`,desc:`Run the marketplace command in your host agent.`,code:`/plugin marketplace add manalkaff/opendesign
21
+ /plugin install opendesign@opendesign`}]},{id:`gemini-cli`,name:`Google Gemini CLI`,category:`cli`,configType:`guide`,icon:`/providers/gemini-cli.png`,color:`#1E88E5`,description:`Official Google Gemini CLI tool with OAuth & API authentication.`,guideSteps:[{step:1,title:`Install Gemini CLI`,desc:`Install the official Gemini CLI globally or run with npx.`,code:`npm install -g @google/gemini-cli`},{step:2,title:`Configure EkaRouter Endpoint`,desc:`Route Gemini CLI requests through EkaRouter proxy.`,code:`export GEMINI_API_BASE="http://127.0.0.1:20128/v1"`}]},{id:`antigravity`,name:`Google Antigravity IDE`,category:`mitm`,configType:`mitm`,icon:`/providers/antigravity.png`,color:`#4285F4`,description:`Transparent MITM interception for Google Cloud Code / Antigravity IDE RPCs.`}];function g(){let[e,t]=(0,p.useState)({}),[n,i]=(0,p.useState)(!0),[g,_]=(0,p.useState)(!1),[v,le]=(0,p.useState)(``),[y,b]=(0,p.useState)(`all`),[x,S]=(0,p.useState)(()=>typeof window<`u`&&window.location?.origin?`${window.location.origin}/v1`:`/v1`),[C,ue]=(0,p.useState)([]),[w,T]=(0,p.useState)(`sk-default-key`),[E,D]=(0,p.useState)(()=>typeof window<`u`?new URLSearchParams(window.location.search).get(`tool`):null),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(!1),[M,N]=(0,p.useState)(!1),[P,F]=(0,p.useState)(null),[I,L]=(0,p.useState)({}),[R,z]=(0,p.useState)(`ps`),[B,V]=(0,p.useState)(()=>({running:!0,port:typeof window<`u`&&window.location?.port?parseInt(window.location.port,10):8080})),[H,U]=(0,p.useState)({}),[W,G]=(0,p.useState)(!1);(0,p.useEffect)(()=>{r?S(`${r}/v1`):typeof window<`u`&&window.location?.origin&&S(`${window.location.origin}/v1`)},[]);let K=async()=>{try{let e=await fetch(`${r}/api/cli-tools/all-statuses`);if(e.ok){let n=await e.json();t(n)}}catch{}},q=async()=>{try{let e=await fetch(`${r}/api/keys`);if(e.ok){let t=(await e.json()).keys||[];ue(t),t.length>0&&w===`sk-default-key`&&T(t[0].key)}}catch{}},J=async(e=`antigravity`)=>{try{let[t,n]=await Promise.all([fetch(`${r}/api/cli-tools/antigravity-mitm`),fetch(`${r}/api/cli-tools/antigravity-mitm/alias?tool=${e}`)]);if(t.ok&&V(await t.json()),n.ok){let e=await n.json();U(e.aliases||{})}}catch{}};(0,p.useEffect)(()=>{(async()=>{i(!0),await Promise.all([K(),q(),J()]),i(!1)})()},[]);let de=async()=>{_(!0),await Promise.all([K(),q(),J()]),_(!1)},Y=(e,t)=>{navigator.clipboard.writeText(e),k(t),setTimeout(()=>k(null),1800)},X=e=>{if(D(e),F(null),typeof window<`u`){let t=new URL(window.location.href);e?t.searchParams.set(`tool`,e):t.searchParams.delete(`tool`),window.history.pushState({},``,t.toString())}if(e){let t=h.find(t=>t.id===e);if(t?.defaultModels){let e={};t.defaultModels.forEach(t=>{e[t.id]=t.defaultValue}),L(e)}t?.category===`mitm`&&J(t.id)}},Z=(0,p.useMemo)(()=>E&&h.find(e=>e.id===E)||null,[E]),fe=async()=>{if(!(!Z||!Z.apiEndpoint)){j(!0),F(null);try{let e={};e=Z.id===`claude`?{baseUrl:x,apiKey:w,env:{ANTHROPIC_BASE_URL:x,ANTHROPIC_AUTH_TOKEN:w,ANTHROPIC_DEFAULT_SONNET_MODEL:I.sonnet||`anthropic/claude-3-7-sonnet-20250219`,ANTHROPIC_DEFAULT_OPUS_MODEL:I.opus||`anthropic/claude-3-opus-20240229`,ANTHROPIC_DEFAULT_HAIKU_MODEL:I.haiku||`anthropic/claude-3-5-haiku-20241022`}}:Z.id===`codex`?{baseUrl:x,apiKey:w,model:I.model||`openai/gpt-4.5-preview`}:Z.id===`opencode`?{baseUrl:x,apiKey:w,model:I.model||`anthropic/claude-3-7-sonnet-20250219`,models:[I.model||`anthropic/claude-3-7-sonnet-20250219`,`openai/gpt-4.5-preview`]}:{baseUrl:x,apiKey:w,model:I.model||`combo/full-chain`};let t=await fetch(`${r}${Z.apiEndpoint}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(t.ok)F({text:`Settings successfully applied to ${Z.settingsFile||`configuration file`}!`,success:!0}),await K();else{let e=await t.json().catch(()=>({}));F({text:e.error||`Failed to update configuration file.`,success:!1})}}catch(e){F({text:e.message||`Network request failed`,success:!1})}finally{j(!1)}}},pe=async()=>{if(!(!Z||!Z.apiEndpoint)){N(!0),F(null);try{(await fetch(`${r}${Z.apiEndpoint}`,{method:`DELETE`})).ok?(F({text:`Configuration removed and restored to default.`,success:!0}),await K()):F({text:`Failed to reset configuration file.`,success:!1})}catch(e){F({text:e.message||`Network request failed`,success:!1})}finally{N(!1)}}},me=async()=>{if(Z){G(!0),F(null);try{(await fetch(`${r}/api/cli-tools/antigravity-mitm/alias`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({tool:Z.id,mappings:H})})).ok?F({text:`MITM Model translation aliases saved successfully!`,success:!0}):F({text:`Failed to update MITM model aliases.`,success:!1})}catch{F({text:`Failed to save aliases.`,success:!1})}finally{G(!1)}}},Q=(e,t)=>{let n=w||`sk-default-key`,r=typeof window<`u`&&window.location?.origin?`${window.location.origin}/v1`:`/v1`,i=x||r;return e.id===`claude`?t===`ps`?`$env:ANTHROPIC_BASE_URL="${i}"; $env:ANTHROPIC_AUTH_TOKEN="${n}"; claude`:t===`cmd`?`set ANTHROPIC_BASE_URL=${i} && set ANTHROPIC_AUTH_TOKEN=${n} && claude`:`export ANTHROPIC_BASE_URL="${i}"\nexport ANTHROPIC_AUTH_TOKEN="${n}"\nclaude`:e.id===`codex`?t===`ps`?`$env:OPENAI_BASE_URL="${i}"; $env:OPENAI_API_KEY="${n}"; codex`:t===`cmd`?`set OPENAI_BASE_URL=${i} && set OPENAI_API_KEY=${n} && codex`:`export OPENAI_BASE_URL="${i}"\nexport OPENAI_API_KEY="${n}"\ncodex`:t===`ps`?`$env:OPENAI_BASE_URL="${i}"; $env:OPENAI_API_KEY="${n}"; ${e.id}`:t===`cmd`?`set OPENAI_BASE_URL=${i} && set OPENAI_API_KEY=${n} && ${e.id}`:`export OPENAI_BASE_URL="${i}"\nexport OPENAI_API_KEY="${n}"\n${e.id}`},he=(0,p.useMemo)(()=>h.filter(t=>{let n=y===`all`?!0:y===`connected`?e[t.id]?.hasEkaRouter||e[t.id]?.has9Router:y===`installed`?e[t.id]?.installed:t.category===y,r=v.toLowerCase().trim(),i=!r||t.name.toLowerCase().includes(r)||t.description.toLowerCase().includes(r)||t.id.toLowerCase().includes(r);return n&&i}),[y,v,e]),$=(0,p.useMemo)(()=>{let t=0,n=0,r=0;return h.forEach(i=>{let a=e[i.id];(a?.hasEkaRouter||a?.has9Router||i.category===`mitm`)&&t++,a?.installed?n++:r++}),{total:h.length,connected:t,installedOnDevice:n,notInstalled:r}},[e]);if(Z){let t=e[Z.id],n=t?.installed,r=t?.hasEkaRouter||t?.has9Router;return(0,m.jsxs)(`div`,{className:`space-y-6 animate-in fade-in duration-200`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#202533] pb-4`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>X(null),className:`inline-flex items-center gap-1.5 text-xs font-semibold text-zinc-400 hover:text-orange-400 transition-colors cursor-pointer`,children:[(0,m.jsx)(ae,{className:`h-4 w-4`}),(0,m.jsx)(`span`,{children:`Back to CLI & IDE Tools`})]}),(0,m.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,m.jsxs)(`span`,{className:`text-xs text-zinc-500 font-mono`,children:[`ID: `,Z.id]})})]}),(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 shadow-sm space-y-4`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,m.jsx)(`div`,{className:`relative flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#0e1017] border border-[#2a3144] p-2 shadow-inner`,children:(0,m.jsx)(`img`,{src:Z.icon,alt:``,className:`h-full w-full object-contain`,onError:e=>{e.currentTarget.style.display=`none`}})}),(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(`h1`,{className:`text-xl font-bold text-white tracking-tight`,children:Z.name}),(0,m.jsx)(`span`,{className:`text-[10px] rounded bg-orange-500/10 px-2 py-0.5 text-orange-400 border border-orange-500/20 font-mono uppercase font-semibold`,children:Z.category})]}),(0,m.jsx)(`p`,{className:`mt-1 text-xs text-zinc-400 leading-relaxed max-w-2xl`,children:Z.description})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n?(0,m.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium text-emerald-400 shadow-sm`,children:[(0,m.jsx)(c,{className:`h-3.5 w-3.5`}),(0,m.jsx)(`span`,{children:`Detected on Device`})]}):(0,m.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 rounded-xl border border-zinc-700/40 bg-zinc-800/20 px-3 py-1.5 text-xs font-medium text-zinc-400`,children:[(0,m.jsx)(oe,{className:`h-3.5 w-3.5`}),(0,m.jsx)(`span`,{children:`Not Found in PATH`})]}),r?(0,m.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium text-emerald-400 shadow-sm`,children:[(0,m.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-emerald-400 animate-pulse`}),(0,m.jsx)(`span`,{children:`Connected to EkaRouter`})]}):(0,m.jsx)(`div`,{className:`inline-flex items-center gap-1.5 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-medium text-amber-400`,children:(0,m.jsx)(`span`,{children:`Not Configured`})})]})]}),t?.binaryPath&&(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#212736] bg-[#0d0f16] p-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-zinc-400`,children:[(0,m.jsx)(d,{className:`h-3.5 w-3.5 text-zinc-500 shrink-0`}),(0,m.jsx)(`span`,{className:`text-zinc-500 font-medium`,children:`Executable Path:`}),(0,m.jsx)(`span`,{className:`font-mono text-zinc-300 break-all`,children:t.binaryPath})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Y(t.binaryPath,`bin-path`),className:`inline-flex items-center gap-1 text-[11px] text-zinc-400 hover:text-white shrink-0`,children:[O===`bin-path`?(0,m.jsx)(a,{className:`h-3 w-3 text-emerald-400`}):(0,m.jsx)(o,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{children:`Copy Path`})]})]}),!n&&Z.installGuide&&(0,m.jsxs)(`div`,{className:`rounded-xl border border-sky-500/20 bg-sky-500/5 p-3 flex items-center justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-sky-300`,children:[(0,m.jsx)(f,{className:`h-3.5 w-3.5 text-sky-400 shrink-0`}),(0,m.jsx)(`span`,{children:`Quick Install Command:`}),(0,m.jsx)(`code`,{className:`font-mono text-white bg-black/40 px-2 py-0.5 rounded border border-sky-500/30`,children:Z.installGuide})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Y(Z.installGuide,`install-cmd`),className:`inline-flex items-center gap-1 text-[11px] text-sky-300 hover:text-white shrink-0`,children:[O===`install-cmd`?(0,m.jsx)(a,{className:`h-3 w-3 text-emerald-400`}):(0,m.jsx)(o,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{children:`Copy`})]})]})]}),P&&(0,m.jsxs)(`div`,{className:`rounded-xl p-3.5 text-xs flex items-center gap-2.5 border ${P.success?`bg-emerald-500/10 text-emerald-300 border-emerald-500/20`:`bg-red-500/10 text-red-300 border-red-500/20`}`,children:[(0,m.jsx)(f,{className:`h-4 w-4 shrink-0`}),(0,m.jsx)(`span`,{className:`font-medium`,children:P.text})]}),Z.category===`mitm`?(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`rounded-2xl border border-blue-500/20 bg-[#121622] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(l,{className:`h-5 w-5 text-blue-400`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Transparent MITM Interceptor`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Intercepts IDE RPC calls and routes them through EkaRouter fallback models`})]})]}),(0,m.jsxs)(`span`,{className:`text-xs font-mono text-emerald-400 bg-emerald-500/10 px-2.5 py-1 rounded-lg border border-emerald-500/20`,children:[`Port `,B.port||8080,` Ready`]})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 pt-2`,children:[(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#222736] bg-[#0c0e14] p-3.5`,children:[(0,m.jsx)(`span`,{className:`text-[11px] text-zinc-500 font-medium`,children:`Intercepted Domain`}),(0,m.jsx)(`div`,{className:`mt-1 font-mono text-xs text-white`,children:Z.id===`antigravity`?`daily-cloudcode-pa.googleapis.com`:`api.openai.com`})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#222736] bg-[#0c0e14] p-3.5`,children:[(0,m.jsx)(`span`,{className:`text-[11px] text-zinc-500 font-medium`,children:`Target Router Base`}),(0,m.jsx)(`div`,{className:`mt-1 font-mono text-xs text-orange-400`,children:x})]})]})]}),(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Model Translation Mappings`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Map intercepted client model IDs to your desired upstream models in EkaRouter`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:me,disabled:W,className:`inline-flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-xs font-medium text-white hover:bg-blue-500 transition-colors cursor-pointer shadow-sm`,children:[(0,m.jsx)(a,{className:`h-3.5 w-3.5`}),(0,m.jsx)(`span`,{children:W?`Saving...`:`Save Model Aliases`})]})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#252c3c] bg-[#0c0e14] overflow-hidden divide-y divide-[#1e2330]`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-12 gap-3 px-4 py-2.5 text-[11px] font-semibold text-zinc-400 bg-[#12151e]`,children:[(0,m.jsx)(`div`,{className:`col-span-5`,children:`Intercepted IDE Model`}),(0,m.jsx)(`div`,{className:`col-span-7`,children:`EkaRouter Upstream Model Target`})]}),Object.entries(H).map(([e,t])=>(0,m.jsxs)(`div`,{className:`grid grid-cols-12 gap-3 px-4 py-2.5 items-center`,children:[(0,m.jsx)(`div`,{className:`col-span-5 font-mono text-xs text-zinc-300 truncate`,children:e}),(0,m.jsx)(`div`,{className:`col-span-7`,children:(0,m.jsx)(`input`,{type:`text`,value:t,onChange:t=>U(n=>({...n,[e]:t.target.value})),className:`w-full rounded-lg border border-[#2b3142] bg-[#161922] px-3 py-1.5 text-xs text-zinc-200 font-mono focus:border-orange-500 focus:outline-none`})})]},e))]})]})]}):Z.configType===`guide`?(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Integration Setup Guide`}),(0,m.jsxs)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:[`Follow these instructions to connect `,Z.name,` with your current EkaRouter instance`]})]}),(0,m.jsx)(`div`,{className:`space-y-4`,children:Z.guideSteps?.map(e=>{let t=e.code?e.code.replaceAll(`{{baseUrl}}`,x).replaceAll(`{{apiKey}}`,w||`sk-default-key`):``;return(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#252b3a] bg-[#11141c] p-4 space-y-2.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full bg-orange-500/20 text-[11px] font-bold text-orange-400 border border-orange-500/30`,children:e.step}),(0,m.jsx)(`h4`,{className:`text-xs font-semibold text-white`,children:e.title})]}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 leading-relaxed pl-7.5`,children:e.desc}),e.code&&(0,m.jsxs)(`div`,{className:`relative mt-2 rounded-lg border border-[#272d3e] bg-[#0b0d12] p-3 pl-4 font-mono text-xs text-zinc-300`,children:[(0,m.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap`,children:t}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Y(t,`guide-${e.step}`),className:`absolute top-2 right-2 p-1.5 text-zinc-400 hover:text-white rounded bg-[#1b1f2b] border border-[#2d3446]`,children:O===`guide-${e.step}`?(0,m.jsx)(a,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,m.jsx)(o,{className:`h-3.5 w-3.5`})})]})]},e.step)})})]}):(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`EkaRouter Connection & Auth`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Point this tool to your EkaRouter endpoint and specify an authorized API key`})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsxs)(`label`,{className:`text-[11px] font-medium text-zinc-400 flex items-center gap-1.5`,children:[(0,m.jsx)(s,{className:`h-3.5 w-3.5 text-orange-400`}),(0,m.jsx)(`span`,{children:`EkaRouter Base URL`})]}),(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-500 font-mono`,children:`Dynamic Host`})]}),(0,m.jsx)(`input`,{type:`text`,value:x,onChange:e=>S(e.target.value),className:`w-full rounded-lg border border-[#2c3244] bg-[#10131b] px-3 py-2 text-xs text-zinc-200 font-mono focus:border-orange-500 focus:outline-none`}),(0,m.jsxs)(`p`,{className:`text-[10px] text-zinc-500`,children:[`Automatically configured to your current origin:`,` `,(0,m.jsx)(`span`,{className:`font-mono text-zinc-400`,children:x})]})]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsxs)(`label`,{className:`text-[11px] font-medium text-zinc-400 flex items-center gap-1.5`,children:[(0,m.jsx)(te,{className:`h-3.5 w-3.5 text-orange-400`}),(0,m.jsx)(`span`,{children:`API Key Selector`})]}),(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-500 font-mono`,children:`Bearer Token`})]}),C.length>0?(0,m.jsx)(ee,{value:w,onChange:e=>T(e.target.value),options:C.map(e=>({label:`${e.name} (${e.key.substring(0,10)}...)`,value:e.key}))}):(0,m.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`Key`,className:`w-full rounded-lg border border-[#2c3244] bg-[#10131b] px-3 py-2 text-xs text-zinc-200 font-mono focus:border-orange-500 focus:outline-none`}),(0,m.jsx)(`p`,{className:`text-[10px] text-zinc-500`,children:`Kunci API aktif.`})]})]})]}),Z.defaultModels&&Z.defaultModels.length>0&&(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Model Configuration`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Select modern models to route inference calls through EkaRouter`})]}),(0,m.jsx)(`div`,{className:`space-y-3`,children:Z.defaultModels.map(e=>(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#262c3b] bg-[#10131b] p-3.5 space-y-1.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,m.jsx)(`span`,{className:`font-semibold text-zinc-200`,children:e.name}),e.envKey&&(0,m.jsx)(`span`,{className:`font-mono text-[10px] text-zinc-500`,children:e.envKey})]}),(0,m.jsx)(`input`,{type:`text`,value:I[e.id]||e.defaultValue,onChange:t=>L(n=>({...n,[e.id]:t.target.value})),className:`w-full rounded-lg border border-[#293040] bg-[#0c0e14] px-3 py-2 text-xs text-zinc-200 font-mono focus:border-orange-500 focus:outline-none`})]},e.id))})]}),(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Local Configuration File`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Apply these parameters directly to your local file on disk`})]}),Z.settingsFile&&(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#222736] bg-[#0c0e14] p-3.5 flex items-center justify-between gap-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5 text-xs`,children:[(0,m.jsx)(se,{className:`h-4 w-4 text-orange-400 shrink-0`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`span`,{className:`font-mono text-zinc-200`,children:Z.settingsFile}),(0,m.jsx)(`div`,{className:`text-[10px] text-zinc-500 mt-0.5`,children:t?.path?`Resolved: ${t.path}`:`User Profile Directory`})]})]}),t?.path&&(0,m.jsx)(`span`,{className:`text-[10px] font-medium text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded border border-emerald-500/20`,children:`File Found`})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 pt-2`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:fe,disabled:A,className:`inline-flex items-center gap-2 rounded-xl bg-orange-500 px-5 py-2.5 text-xs font-semibold text-white hover:bg-orange-600 transition-colors shadow-sm cursor-pointer`,children:[(0,m.jsx)(ie,{className:`h-4 w-4`}),(0,m.jsx)(`span`,{children:A?`Writing Configuration...`:`Apply to Settings File`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:pe,disabled:M,className:`inline-flex items-center gap-2 rounded-xl border border-[#2e3547] bg-[#181c26] px-4 py-2.5 text-xs font-semibold text-zinc-300 hover:bg-[#222734] hover:text-red-400 transition-colors cursor-pointer`,children:[(0,m.jsx)(u,{className:`h-4 w-4`}),(0,m.jsx)(`span`,{children:M?`Resetting...`:`Reset Config`})]})]})]}),(0,m.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#141722] p-6 space-y-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:`Shell Command Export`}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Launch directly from your favorite terminal shell`})]}),(0,m.jsx)(`div`,{className:`flex items-center gap-1 bg-[#0c0e14] p-1 rounded-xl border border-[#242a3a]`,children:[`ps`,`bash`,`cmd`].map(e=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>z(e),className:`rounded-lg px-2.5 py-1 text-[11px] font-mono font-semibold transition-colors cursor-pointer ${R===e?`bg-orange-500 text-white`:`text-zinc-400 hover:text-zinc-200`}`,children:e.toUpperCase()},e))})]}),(0,m.jsxs)(`div`,{className:`relative rounded-xl border border-[#252b3a] bg-[#0c0e14] p-4 font-mono text-xs text-zinc-300`,children:[(0,m.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap leading-relaxed`,children:Q(Z,R)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Y(Q(Z,R),`cmd-export`),className:`absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white rounded-lg bg-[#191d28] border border-[#2c3344] cursor-pointer`,children:O===`cmd-export`?(0,m.jsx)(a,{className:`h-4 w-4 text-emerald-400`}):(0,m.jsx)(o,{className:`h-4 w-4`})})]})]})]})]})}return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,m.jsxs)(`button`,{type:`button`,onClick:de,disabled:g,className:`inline-flex items-center gap-1.5 rounded-lg border border-[#2c3242] bg-[#171a23] px-3 py-2 text-xs font-medium text-zinc-300 hover:bg-[#1f2330] hover:text-white transition-colors cursor-pointer`,children:[(0,m.jsx)(ne,{className:`h-3.5 w-3.5 ${g?`animate-spin`:``}`}),(0,m.jsx)(`span`,{children:`Refresh Device Status`})]})}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,m.jsxs)(`div`,{className:`rounded-xl border border-[#222735] bg-[#141720]/80 p-3.5`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-medium text-zinc-400`,children:`Total Tools`}),(0,m.jsx)(`div`,{className:`mt-1 text-2xl font-bold text-white`,children:$.total}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[10px] text-zinc-500`,children:`20 CLI/IDE + 2 MITM Proxies`})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border border-emerald-500/20 bg-[#141720]/80 p-3.5`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-medium text-emerald-400`,children:`Connected`}),(0,m.jsx)(`div`,{className:`mt-1 text-2xl font-bold text-emerald-400`,children:$.connected}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[10px] text-zinc-500`,children:`Routing via EkaRouter`})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border border-blue-500/20 bg-[#141720]/80 p-3.5`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-medium text-blue-400`,children:`Detected on Device`}),(0,m.jsx)(`div`,{className:`mt-1 text-2xl font-bold text-blue-400`,children:$.installedOnDevice}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[10px] text-zinc-500`,children:`Scanned on local PC`})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border border-zinc-700/30 bg-[#141720]/80 p-3.5`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-medium text-zinc-400`,children:`Uninstalled Guides`}),(0,m.jsx)(`div`,{className:`mt-1 text-2xl font-bold text-zinc-300`,children:$.notInstalled}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[10px] text-zinc-500`,children:`One-click setup available`})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[{id:`all`,label:`All Tools`},{id:`connected`,label:`Connected`},{id:`installed`,label:`Installed on Device`},{id:`cli`,label:`CLI Agents`},{id:`ide`,label:`IDEs & Plugins`},{id:`mitm`,label:`MITM Proxies`}].map(e=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>b(e.id),className:`rounded-lg px-3 py-1.5 text-xs font-medium transition-all cursor-pointer ${y===e.id?`bg-orange-500 text-white shadow-sm`:`bg-[#161922] text-zinc-400 hover:bg-[#1f2432] hover:text-zinc-200 border border-[#252b3b]`}`,children:e.label},e.id))}),(0,m.jsxs)(`div`,{className:`relative w-full sm:w-72`,children:[(0,m.jsx)(re,{className:`absolute left-3 top-2.5 h-3.5 w-3.5 text-zinc-500`}),(0,m.jsx)(`input`,{type:`text`,placeholder:`Cari`,value:v,onChange:e=>le(e.target.value),className:`w-full rounded-lg border border-[#282e3e] bg-[#141720] pl-9 pr-3 py-1.5 text-xs text-zinc-200 placeholder-zinc-500 focus:border-orange-500/70 focus:outline-none`})]})]}),(0,m.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:he.map(t=>{let n=e[t.id],r=n?.hasEkaRouter||n?.has9Router,i=n?.installed,s=t.configType===`guide`,c=t.category===`mitm`;return(0,m.jsxs)(`div`,{onClick:()=>X(t.id),className:`group relative flex flex-col justify-between rounded-xl border border-[#242a3a] bg-[#141721] p-4 shadow-sm hover:border-[#3d465c] transition-all cursor-pointer`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`div`,{className:`relative flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[#0f1118] border border-[#2a3042] p-1.5 shadow-inner`,children:(0,m.jsx)(`img`,{src:t.icon,alt:``,className:`h-full w-full object-contain`,onError:e=>{e.currentTarget.style.display=`none`}})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold text-white group-hover:text-orange-400 transition-colors`,children:t.name}),(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-500 uppercase tracking-wider font-mono`,children:t.category===`cli`?`CLI Agent`:t.category===`ide`?`IDE Plugin`:`MITM Proxy`})]})]}),c?(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-400 border border-blue-500/20`,children:[(0,m.jsx)(l,{className:`h-3 w-3`}),`MITM`]}):r?(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 border border-emerald-500/20`,children:[(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse`}),`Connected`]}):i?(0,m.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-400 border border-blue-500/20`,children:`Installed on PC`}):s?(0,m.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-400 border border-sky-500/20`,children:`Guide`}):(0,m.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-zinc-500/10 px-2 py-0.5 text-[10px] font-medium text-zinc-400 border border-zinc-700/30`,children:`Not installed`})]}),(0,m.jsx)(`p`,{className:`text-xs text-zinc-400 line-clamp-2 leading-relaxed mb-4`,children:t.description})]}),(0,m.jsxs)(`div`,{className:`space-y-2 pt-2 border-t border-[#1e2330]`,children:[n?.binaryPath?(0,m.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-mono truncate`,title:n.binaryPath,children:[(0,m.jsx)(`span`,{className:`text-emerald-500 mr-1`,children:`●`}),n.binaryPath]}):t.settingsFile?(0,m.jsx)(`div`,{className:`flex items-center justify-between text-[11px] text-zinc-500 font-mono`,children:(0,m.jsx)(`span`,{className:`truncate max-w-[200px]`,children:t.settingsFile})}):null,(0,m.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),X(t.id)},className:`flex-1 flex items-center justify-center gap-1.5 rounded-lg border border-[#2d3446] bg-[#1b1f2b] px-3 py-1.5 text-xs font-medium text-zinc-200 hover:bg-orange-500 hover:text-white hover:border-orange-500 transition-all cursor-pointer`,children:[(0,m.jsx)(ce,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{children:s?`Setup Guide`:c?`Configure MITM`:`Configure`})]}),(0,m.jsx)(`button`,{type:`button`,title:`Copy Shell Command`,onClick:e=>{e.stopPropagation(),Y(Q(t,`ps`),t.id)},className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-[#2d3446] bg-[#191d27] text-zinc-400 hover:text-white hover:border-zinc-500 transition-colors cursor-pointer`,children:O===t.id?(0,m.jsx)(a,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,m.jsx)(o,{className:`h-3.5 w-3.5`})})]})]})]},t.id)})})]})}var _=g;export{_ as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as r}from"./useQuery-BrM5_EQu.js";import{n as i}from"./QueryClientProvider-BjElddVn.js";import{n as a,r as o}from"./api-lXjeGSiV.js";import{t as s}from"./createLucideIcon-CLdWFMku.js";import{t as ee}from"./check-36OnHiEM.js";import{t as te}from"./copy-B1k2VT2A.js";import{t as c}from"./eye-Cbs9C6DS.js";import{u as ne}from"./kit-DGWILC5k.js";import{t as l}from"./layers-C_9oEa0w.js";import{t as u}from"./mic-D6DQAnIR.js";import{t as re}from"./pencil-CFgylVBP.js";import{t as d}from"./plus-qKI-KwZh.js";import{t as ie}from"./search-BtJsgOj6.js";import{t as f}from"./trash-2-D9HI9O7Q.js";import{t as p}from"./x-CGuQtexA.js";import{t as m}from"./utils-B6KiDbIe.js";import{n as h}from"./dist-yiyhte89.js";import{n as g}from"./providersData-lrEpUDQM.js";var _=s(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),v=e(t()),y=n();function b(e,t){let n=e.toLowerCase();return{hasVision:t?.vision===!0||n.includes(`vision`)||n.includes(`gemini`)||n.includes(`gpt-4o`)||n.includes(`claude`)||n.includes(`gemma`)||n.includes(`kimi`)||n.includes(`mimo`)||n.includes(`cohere`),hasTools:t?.tools===!0||n.includes(`codestral`)||n.includes(`claude`)||n.includes(`gemini`)||n.includes(`deepseek`)||n.includes(`glm`)||n.includes(`kimi`)||n.includes(`tool`)||n.includes(`coder`)}}function x({checked:e,onChange:t,disabled:n}){return(0,y.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:m(`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none`,e?`bg-primary`:`bg-muted`,n&&`opacity-50 cursor-not-allowed`),children:(0,y.jsx)(`span`,{"aria-hidden":`true`,className:m(`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-xs transition duration-200 ease-in-out`,e?`translate-x-4`:`translate-x-0`)})})}function S(){return(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ff5f56]`}),(0,y.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ffbd2e]`}),(0,y.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#27c93f]`})]})}function C(){let e=i(),t=r({queryKey:[`combos`],queryFn:a.combos}),n=r({queryKey:[`settings`],queryFn:a.settings}),s=r({queryKey:[`models`],queryFn:a.models}),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)([]),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[ae,F]=(0,v.useState)(!1),[I,oe]=(0,v.useState)(`combo`),[L,R]=(0,v.useState)(``),[se,z]=(0,v.useState)(null),B=(n.data||{}).capacityAdapter||{vision:{enabled:!0,roundRobin:!0,models:[]},audioInput:{enabled:!0,roundRobin:!0,models:[]}},ce=B.vision?.enabled??!0,V=B.vision?.roundRobin??!0,H=B.audioInput?.enabled??!0,U=B.audioInput?.roundRobin??!0,W=(0,v.useMemo)(()=>{let e=new Set;return(s.data?.models||[]).forEach(t=>{let n=t.provider||`Other`,r=t.fullModel||t.id||`${n}/${t.model}`;e.add(r),t.id&&e.add(t.id),t.fullModel&&e.add(t.fullModel)}),e},[s.data]),G=B.vision?.models||[],K=(0,v.useMemo)(()=>W.size===0?G:G.filter(e=>W.has(e)),[G,W]),q=B.audioInput?.models||[],J=(0,v.useMemo)(()=>W.size===0?q:q.filter(e=>W.has(e)),[q,W]),Y=async t=>{let n={...B,...t};try{await a.updateSettings({capacityAdapter:n}),e.invalidateQueries({queryKey:[`settings`]})}catch(e){h.error(`Gagal menyimpan: ${o(e)}`)}},X=(0,v.useMemo)(()=>{let e=new Map;(s.data?.models||[]).forEach(t=>{let n=t.provider||`Other`,r=t.fullModel||t.id||`${n}/${t.model}`,i=t.name||t.model||r,{hasVision:a,hasTools:o}=b(r,t.caps),s=e.get(n)||[];s.some(e=>e.id===r)||(s.push({id:r,name:i,provider:n,hasVision:a,hasTools:o}),e.set(n,s))});let t=L.trim().toLowerCase();if(!t)return e;let n=new Map;return e.forEach((e,r)=>{let i=e.filter(e=>e.id.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||r.toLowerCase().includes(t));i.length>0&&n.set(r,i)}),n},[s.data,L]),le=()=>{E(null),O(``),A([]),M(null),w(!0)},ue=e=>{E(e),O(e.name),A([...e.models]),M(null),w(!0)},de=async()=>{if(!D.trim()){M(`Nama combo wajib diisi`);return}M(null),P(!0);try{T?await a.updateCombo(T.id,{name:D.trim(),models:k}):await a.createCombo({name:D.trim(),models:k,strategy:`fallback`}),w(!1),e.invalidateQueries({queryKey:[`combos`]})}catch(e){M(o(e))}finally{P(!1)}},fe=async t=>{try{await a.deleteCombo(t),e.invalidateQueries({queryKey:[`combos`]})}catch(e){h.error(`Gagal menghapus: ${o(e)}`)}},Z=e=>{navigator.clipboard.writeText(e.name),z(e.id),setTimeout(()=>z(null),1600)},pe=async(t,n)=>{try{await a.updateCombo(t.id,{name:t.name,models:t.models,kind:n}),e.invalidateQueries({queryKey:[`combos`]})}catch(e){console.error(e)}},Q=e=>{oe(e),R(``),F(!0)},me=e=>I===`combo`?k.includes(e):I===`vision`?K.includes(e):I===`audio`&&J.includes(e),he=async e=>{if(I===`combo`)A(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);else if(I===`vision`){let t=K.includes(e)?K.filter(t=>t!==e):[...K,e];await Y({vision:{...B.vision,models:t}})}else if(I===`audio`){let t=J.includes(e)?J.filter(t=>t!==e):[...J,e];await Y({audioInput:{...B.audioInput,models:t}})}},$=t.data||[];return(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Model Combos`}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Kombinasi model dengan strategi fallback, round-robin, atau fusion.`})]}),(0,y.jsxs)(`button`,{type:`button`,onClick:le,className:`flex shrink-0 items-center gap-1.5 rounded-xl bg-primary hover:bg-primary/90 px-3.5 py-1.5 text-xs font-semibold text-primary-foreground shadow-xs transition-colors cursor-pointer`,children:[(0,y.jsx)(d,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{children:`Buat Combo`})]})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[t.isLoading&&(0,y.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-8 text-center text-xs text-muted-foreground animate-pulse`,children:`Memuat combos...`}),$.length===0&&!t.isLoading&&(0,y.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-10 text-center text-xs text-muted-foreground`,children:`Belum ada combo. Klik "Buat Combo" untuk menambahkan.`}),$.map(e=>{let t=e.kind||`fallback`;return(0,y.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-4 rounded-2xl border border-border bg-card p-4 shadow-xs transition-colors hover:border-primary/40 md:flex-row md:items-center`,children:[(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3.5 md:items-center`,children:[(0,y.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10`,children:(0,y.jsx)(l,{className:`h-4 w-4 text-primary`})}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`h3`,{className:`truncate font-mono text-xs font-bold uppercase tracking-wider text-foreground`,children:e.name}),(0,y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[e.models.slice(0,4).map(e=>{let{hasVision:t,hasTools:n}=b(e),r=e.split(`/`)[0]||``;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border border-border bg-muted/40 px-2 py-0.5 font-mono text-[11px] text-foreground shadow-xs`,children:[(0,y.jsx)(`img`,{src:g(r),alt:``,className:`h-3 w-3 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,y.jsx)(`span`,{className:`truncate max-w-[180px]`,children:e}),t&&(0,y.jsx)(c,{className:`h-3 w-3 shrink-0 text-blue-400`}),n&&(0,y.jsx)(_,{className:`h-3 w-3 shrink-0 text-amber-500`})]},e)}),e.models.length>4&&(0,y.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,e.models.length-4,` lainnya`]}),e.models.length===0&&(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Kosong`})]})]})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,y.jsx)(`div`,{className:`w-44 sm:w-48`,children:(0,y.jsx)(ne,{compact:!0,value:t,onChange:t=>pe(e,t.target.value),options:[{label:`Fallback`,value:`fallback`},{label:`Round Robin`,value:`round-robin`},{label:`Fusion`,value:`fusion`}]})}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>Z(e),className:`flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-hover transition-colors cursor-pointer`,title:`Salin nama`,children:se===e.id?(0,y.jsx)(ee,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,y.jsx)(te,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>ue(e),className:`flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-hover transition-colors cursor-pointer`,title:`Edit`,children:(0,y.jsx)(re,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>fe(e.id),className:`flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-rose-500 hover:bg-rose-500/10 transition-colors cursor-pointer`,title:`Hapus`,children:(0,y.jsx)(f,{className:`h-3.5 w-3.5`})})]})]},e.id)})]}),(0,y.jsxs)(`div`,{className:`space-y-3 pt-2`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Capacity Adapters`}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Auto-switch ke model pendukung jika request memuat konten vision atau audio.`})]}),(0,y.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-4 rounded-2xl border border-border bg-card p-4 shadow-xs md:flex-row md:items-center`,children:[(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 md:items-center`,children:[(0,y.jsx)(x,{checked:ce,onChange:e=>Y({vision:{...B.vision,enabled:e}})}),(0,y.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10`,children:(0,y.jsx)(c,{className:`h-4 w-4 text-primary`})}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-xs font-semibold text-foreground`,children:`Vision`}),(0,y.jsxs)(`div`,{className:`flex min-h-[34px] flex-wrap items-center gap-1.5 rounded-xl border border-border bg-background p-1.5`,children:[K.slice(0,3).map(e=>{let{hasVision:t,hasTools:n}=b(e),r=e.split(`/`)[0]||``;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border border-border bg-muted/40 px-2 py-0.5 font-mono text-[11px] text-foreground`,children:[(0,y.jsx)(`img`,{src:g(r),alt:``,className:`h-3 w-3 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,y.jsx)(`span`,{className:`truncate max-w-[180px]`,children:e}),t&&(0,y.jsx)(c,{className:`h-3 w-3 shrink-0 text-blue-400`}),n&&(0,y.jsx)(_,{className:`h-3 w-3 shrink-0 text-amber-500`})]},e)}),K.length>3&&(0,y.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,K.length-3,` lainnya`]}),K.length===0&&(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground italic px-1`,children:`Kosong`})]})]})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(x,{checked:V,onChange:e=>Y({vision:{...B.vision,roundRobin:e}})}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Round`})]}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>Q(`vision`),className:`flex items-center gap-1.5 rounded-xl border border-border bg-card hover:bg-hover px-3 py-1.5 text-xs font-medium text-foreground transition-colors cursor-pointer`,children:[(0,y.jsx)(d,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{children:`Pilih Model`})]})]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-4 rounded-2xl border border-border bg-card p-4 shadow-xs md:flex-row md:items-center`,children:[(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 md:items-center`,children:[(0,y.jsx)(x,{checked:H,onChange:e=>Y({audioInput:{...B.audioInput,enabled:e}})}),(0,y.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10`,children:(0,y.jsx)(u,{className:`h-4 w-4 text-primary`})}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-xs font-semibold text-foreground`,children:`Audio`}),(0,y.jsxs)(`div`,{className:`flex min-h-[34px] flex-wrap items-center gap-1.5 rounded-xl border border-border bg-background p-1.5`,children:[J.slice(0,3).map(e=>{let{hasVision:t,hasTools:n}=b(e),r=e.split(`/`)[0]||``;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border border-border bg-muted/40 px-2 py-0.5 font-mono text-[11px] text-foreground`,children:[(0,y.jsx)(`img`,{src:g(r),alt:``,className:`h-3 w-3 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,y.jsx)(`span`,{className:`truncate max-w-[180px]`,children:e}),t&&(0,y.jsx)(c,{className:`h-3 w-3 shrink-0 text-blue-400`}),n&&(0,y.jsx)(_,{className:`h-3 w-3 shrink-0 text-amber-500`})]},e)}),J.length>3&&(0,y.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,J.length-3,` lainnya`]}),J.length===0&&(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground italic px-1`,children:`Kosong`})]})]})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(x,{checked:U,onChange:e=>Y({audioInput:{...B.audioInput,roundRobin:e}})}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Round`})]}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>Q(`audio`),className:`flex items-center gap-1.5 rounded-xl border border-border bg-card hover:bg-hover px-3 py-1.5 text-xs font-medium text-foreground transition-colors cursor-pointer`,children:[(0,y.jsx)(d,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{children:`Pilih Model`})]})]})]})]}),C&&(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/75 p-4 backdrop-blur-xs`,children:(0,y.jsxs)(`div`,{className:`w-full max-w-[480px] overflow-hidden rounded-2xl border border-border bg-card shadow-2xl`,children:[(0,y.jsxs)(`div`,{className:`relative flex items-center border-b border-border px-4 py-3 bg-muted/30`,children:[(0,y.jsx)(S,{}),(0,y.jsx)(`h2`,{className:`pointer-events-none w-full text-center text-xs font-semibold text-foreground`,children:T?`Edit Combo`:`Buat Combo`})]}),(0,y.jsxs)(`div`,{className:`space-y-4 p-5`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{className:`mb-1.5 block text-[11px] font-semibold text-muted-foreground`,children:`Nama Combo`}),(0,y.jsx)(`input`,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Nama`,className:`w-full rounded-xl border border-border bg-background px-3.5 py-2 font-mono text-xs text-foreground focus:border-primary focus:outline-none`})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{className:`mb-1.5 block text-[11px] font-semibold text-muted-foreground`,children:`Models`}),k.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl border border-border bg-background p-6`,children:[(0,y.jsx)(l,{className:`h-6 w-6 text-muted-foreground/40`}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Belum ada model`})]}):(0,y.jsx)(`div`,{className:`flex max-h-[160px] flex-wrap gap-1.5 overflow-y-auto rounded-xl border border-border bg-background p-2.5`,children:k.map(e=>{let t=e.split(`/`)[0]||``;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 py-1 font-mono text-xs text-foreground`,children:[(0,y.jsx)(`img`,{src:g(t),alt:``,className:`h-3.5 w-3.5 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,y.jsx)(`span`,{className:`truncate max-w-[180px]`,children:e}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>A(t=>t.filter(t=>t!==e)),className:`text-muted-foreground hover:text-foreground cursor-pointer`,children:(0,y.jsx)(p,{className:`h-3 w-3`})})]},e)})}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>Q(`combo`),className:`mt-2.5 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-xl border border-dashed border-border py-2 text-xs font-medium text-primary hover:bg-primary/5 hover:border-primary/60 transition-colors`,children:[(0,y.jsx)(d,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{children:`Pilih Model`})]})]}),j&&(0,y.jsx)(`p`,{className:`rounded-lg bg-rose-500/10 p-2 text-xs text-rose-500`,children:j}),(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border pt-3`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>w(!1),className:`cursor-pointer rounded-xl border border-border bg-card px-3.5 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-hover transition-colors`,children:`Batal`}),(0,y.jsx)(`button`,{type:`button`,disabled:N||!D.trim(),onClick:de,className:`cursor-pointer rounded-xl bg-primary hover:bg-primary/90 px-4 py-1.5 text-xs font-semibold text-primary-foreground shadow-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50`,children:N?`Menyimpan...`:T?`Simpan`:`Buat`})]})]})]})}),ae&&(0,y.jsx)(`div`,{className:`fixed inset-0 z-60 flex items-center justify-center bg-black/80 p-4 backdrop-blur-xs`,children:(0,y.jsxs)(`div`,{className:`flex max-h-[85vh] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-2xl`,children:[(0,y.jsxs)(`div`,{className:`relative flex shrink-0 items-center border-b border-border px-4 py-3 bg-muted/30`,children:[(0,y.jsx)(S,{}),(0,y.jsx)(`h2`,{className:`pointer-events-none w-full text-center text-xs font-semibold text-foreground`,children:I===`combo`?`Pilih Model Combo`:I===`vision`?`Pilih Model Vision`:`Pilih Model Audio`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>F(!1),className:`absolute right-4 text-muted-foreground hover:text-foreground cursor-pointer`,children:(0,y.jsx)(p,{className:`h-4 w-4`})})]}),(0,y.jsxs)(`div`,{className:`relative mx-5 mt-4 shrink-0`,children:[(0,y.jsx)(ie,{className:`absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,y.jsx)(`input`,{type:`text`,value:L,onChange:e=>R(e.target.value),placeholder:`Cari model...`,className:`w-full rounded-xl border border-border bg-background pl-9 pr-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none`})]}),(0,y.jsxs)(`div`,{className:`flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[Array.from(X.entries()).map(([e,t])=>{let n=t[0]?.provider||e;return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,y.jsx)(`img`,{src:g(n),alt:``,className:`h-4 w-4 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,y.jsx)(`span`,{className:`text-xs font-bold text-foreground capitalize`,children:e}),(0,y.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(e=>{let t=me(e.id);return(0,y.jsxs)(`button`,{type:`button`,onClick:()=>he(e.id),className:m(`flex cursor-pointer select-none items-center gap-1.5 rounded-lg border px-2.5 py-1 font-mono text-xs transition-all`,t?`border-primary bg-primary/15 font-medium text-primary shadow-xs`:`border-border bg-background text-foreground hover:bg-hover hover:border-primary/40`),children:[(0,y.jsx)(`span`,{children:e.name}),e.hasVision&&(0,y.jsx)(c,{className:`h-3 w-3 shrink-0 text-blue-400`,title:`Vision`}),e.hasTools&&(0,y.jsx)(_,{className:`h-3 w-3 shrink-0 text-amber-500`,title:`Tools`})]},e.id)})})]},e)}),X.size===0&&(0,y.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:`Tidak ada model yang cocok.`})]}),(0,y.jsx)(`div`,{className:`flex shrink-0 items-center justify-end border-t border-border px-5 py-3`,children:(0,y.jsx)(`button`,{type:`button`,onClick:()=>F(!1),className:`cursor-pointer rounded-xl bg-primary hover:bg-primary/90 px-4 py-1.5 text-xs font-semibold text-primary-foreground shadow-xs transition-colors`,children:`Selesai`})})]})})]})}export{C as component};
@@ -0,0 +1,2 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{n as r,t as i}from"./api-lXjeGSiV.js";import{t as a}from"./createLucideIcon-CLdWFMku.js";import{t as o}from"./check-36OnHiEM.js";import{t as s}from"./copy-B1k2VT2A.js";import{t as c}from"./play-CPV0a6Tn.js";import{t as l}from"./search-BtJsgOj6.js";import{t as u}from"./terminal-BkaGpO2M.js";import{t as d}from"./trash-2-D9HI9O7Q.js";import{t as f}from"./utils-B6KiDbIe.js";import{n as p}from"./providersData-lrEpUDQM.js";var m=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),h=e(t(),1),g=n();function _(){let[e,t]=(0,h.useState)([]),[n,a]=(0,h.useState)(`ALL`),[_,v]=(0,h.useState)(``),[y,b]=(0,h.useState)(!0),[x,S]=(0,h.useState)(!1),[C,w]=(0,h.useState)(!1),T=(0,h.useRef)(null),E=(0,h.useRef)(new Set),D=async()=>{if(!x)try{let e=(await r.usageHistory(`all`,50)).logs||[],n=[];try{let e=await r.translatorConsoleLogs();Array.isArray(e.logs)&&(n=e.logs)}catch{}let i=[];e.forEach((e,t)=>{let n=e.id||`usage-${e.createdAt}-${e.model}-${t}`;if(E.current.has(n))return;E.current.add(n);let r=e.status>=400||e.error,a=e.provider||e.model?.split(`/`)?.[0]||`router`;i.push({id:n,timestamp:e.createdAt||new Date().toISOString(),level:r?`ERROR`:`SUCCESS`,provider:a,model:e.model,message:r?`Request failed: ${e.error||`Status `+(e.status||500)}`:`Routed request -> ${e.model} (${(e.inputTokens||0)+(e.outputTokens||0)} tokens)`,tokens:e.inputTokens||e.outputTokens?{input:e.inputTokens||0,output:e.outputTokens||0}:void 0})}),n.forEach((e,t)=>{let n=`trans-${e.timestamp}-${t}`;if(E.current.has(n))return;E.current.add(n);let r=(e.level||`INFO`).toUpperCase();i.push({id:n,timestamp:e.timestamp||new Date().toISOString(),level:r===`ERROR`?`ERROR`:r===`WARN`?`WARN`:`INFO`,message:e.message||`System event`})}),i.length>0&&t(e=>{let t=[...e,...i];return t.sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),t.slice(-500)})}catch{}};(0,h.useEffect)(()=>{D();let e=setInterval(()=>{D()},2e3);return()=>clearInterval(e)},[x]),(0,h.useEffect)(()=>{let e;try{e=new EventSource(`${i||``}/api/translator/console-logs/stream`),e.onmessage=e=>{if(!x)try{let n=JSON.parse(e.data),r=n.message||n.line||JSON.stringify(n),i=(n.level||`INFO`).toUpperCase(),a={id:`sse-${Date.now()}-${Math.random()}`,timestamp:new Date().toISOString(),level:i===`ERROR`?`ERROR`:i===`WARN`?`WARN`:`INFO`,message:r};t(e=>[...e,a].slice(-500))}catch{typeof e.data==`string`&&e.data.trim()&&t(t=>[...t,{id:`sse-${Date.now()}-${Math.random()}`,timestamp:new Date().toISOString(),level:`INFO`,message:e.data}].slice(-500))}}}catch{}return()=>{e?.close()}},[x]),(0,h.useEffect)(()=>{y&&T.current?.scrollIntoView({behavior:`smooth`})},[e,y]);let O=(0,h.useMemo)(()=>e.filter(e=>{if(n!==`ALL`&&e.level!==n)return!1;if(_.trim()){let t=_.toLowerCase();return e.message.toLowerCase().includes(t)||e.provider?.toLowerCase().includes(t)||e.model?.toLowerCase().includes(t)}return!0}),[e,n,_]),k=()=>{let e=O.map(e=>`[${e.timestamp}] [${e.level}] ${e.provider?`[${e.provider}] `:``}${e.message}`).join(`
2
+ `);navigator.clipboard.writeText(e),w(!0),setTimeout(()=>w(!1),2e3)},A=async()=>{t([]),E.current.clear();try{await r.clearTranslatorConsoleLogs()}catch{}},j=e=>{switch(e){case`ERROR`:return`bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/25`;case`WARN`:return`bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25`;case`SUCCESS`:return`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25`;default:return`bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-500/25`}};return(0,g.jsxs)(`div`,{className:`space-y-4`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,g.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-xl border border-border bg-card px-2.5 py-1 text-xs font-mono`,children:[(0,g.jsx)(`span`,{className:f(`h-2 w-2 rounded-full`,x?`bg-amber-500`:`bg-emerald-500 animate-pulse`)}),(0,g.jsx)(`span`,{className:`font-semibold text-foreground`,children:x?`PAUSED`:`LIVE STREAM`}),(0,g.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,O.length,` events)`]})]})}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,g.jsxs)(`div`,{className:`relative w-36 sm:w-44`,children:[(0,g.jsx)(l,{className:`absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,g.jsx)(`input`,{type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:`Cari log...`,className:`w-full rounded-xl border border-border bg-card pl-8 pr-2.5 py-1 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none`})]}),(0,g.jsx)(`div`,{className:`flex items-center rounded-xl border border-border bg-card p-0.5`,children:[`ALL`,`SUCCESS`,`INFO`,`WARN`,`ERROR`].map(e=>(0,g.jsx)(`button`,{onClick:()=>a(e),className:f(`rounded-lg px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer`,n===e?`bg-primary/15 text-primary font-semibold`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>S(e=>!e),className:f(`flex h-7 items-center gap-1 rounded-xl border px-2.5 text-xs font-medium cursor-pointer transition-colors`,x?`border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400 hover:bg-amber-500/20`:`border-border bg-card text-muted-foreground hover:text-foreground hover:bg-hover`),title:x?`Resume stream`:`Pause stream`,children:[x?(0,g.jsx)(c,{className:`h-3 w-3`}):(0,g.jsx)(m,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`hidden sm:inline`,children:x?`Resume`:`Pause`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:k,disabled:O.length===0,className:`flex h-7 items-center gap-1 rounded-xl border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-hover transition-colors cursor-pointer disabled:opacity-40`,title:`Salin log`,children:[C?(0,g.jsx)(o,{className:`h-3 w-3 text-emerald-500`}):(0,g.jsx)(s,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`hidden sm:inline`,children:C?`Tersalin`:`Salin`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:A,className:`flex h-7 items-center gap-1 rounded-xl border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground hover:text-rose-500 hover:bg-rose-500/10 transition-colors cursor-pointer`,title:`Bersihkan log`,children:[(0,g.jsx)(d,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`hidden sm:inline`,children:`Bersihkan`})]})]})]}),(0,g.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-card shadow-xs`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border bg-muted/40 px-4 py-2.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ff5f56]`}),(0,g.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ffbd2e]`}),(0,g.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#27c93f]`}),(0,g.jsx)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:`ekarouter-engine-stream`})]}),(0,g.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground cursor-pointer select-none`,children:[(0,g.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`rounded accent-primary`}),(0,g.jsx)(`span`,{children:`Auto-scroll`})]})]}),(0,g.jsxs)(`div`,{className:`h-[540px] overflow-y-auto p-3 font-mono text-xs leading-relaxed space-y-1 bg-background/50`,children:[O.length===0?(0,g.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-muted-foreground`,children:[(0,g.jsx)(u,{className:`h-8 w-8 text-muted-foreground/40`}),(0,g.jsx)(`p`,{className:`text-xs`,children:`Menunggu aktivitas router...`})]}):O.map((e,t)=>{let n=e.timestamp?new Date(e.timestamp).toLocaleTimeString(`id-ID`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`--:--:--`;return(0,g.jsxs)(`div`,{className:`flex items-start gap-2.5 py-1 px-2 rounded-lg hover:bg-muted/60 transition-colors border border-transparent hover:border-border/40`,children:[(0,g.jsx)(`span`,{className:`text-muted-foreground/50 select-none text-[11px] w-6 shrink-0 text-right font-mono`,children:t+1}),(0,g.jsx)(`span`,{className:`text-muted-foreground select-none shrink-0 text-[11px]`,children:n}),(0,g.jsx)(`span`,{className:f(`rounded border px-1.5 py-0.2 text-[10px] font-semibold shrink-0 uppercase tracking-wide`,j(e.level)),children:e.level}),e.provider&&(0,g.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-foreground font-medium shrink-0`,children:[(0,g.jsx)(`img`,{src:p(e.provider),alt:``,className:`h-3.5 w-3.5 rounded-xs object-contain`,onError:e=>{e.currentTarget.style.display=`none`}}),(0,g.jsx)(`span`,{className:`capitalize`,children:e.provider})]}),(0,g.jsx)(`span`,{className:`text-foreground/90 break-all flex-1`,children:e.message}),e.tokens&&(0,g.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-mono shrink-0`,children:[`in:`,e.tokens.input,` out:`,e.tokens.output]})]},e.id||t)}),(0,g.jsx)(`div`,{ref:T})]})]})]})}var v=_;export{v as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./jsx-runtime-B-hcVAMW.js";var n=e(t()),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=(0,n.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o=``,children:l,iconNode:u,...d},f)=>(0,n.createElement)(`svg`,{ref:f,...s,width:t,height:t,stroke:e,strokeWidth:a?Number(i)*24/Number(t):i,className:r(`lucide`,o),...!l&&!c(d)&&{"aria-hidden":`true`},...d},[...u.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(l)?l:[l]])),u=(e,t)=>{let a=(0,n.forwardRef)(({className:a,...s},c)=>(0,n.createElement)(l,{ref:c,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,a),...s}));return a.displayName=o(e),a};export{u as t};
@@ -0,0 +1,41 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as r}from"./react-dom-8HkkFvw6.js";import{t as i}from"./x-CGuQtexA.js";import{t as a}from"./utils-B6KiDbIe.js";var o=e(t(),1),s=Object.defineProperty,c=(e,t)=>s(e,`name`,{value:t,configurable:!0}),l=!!(typeof window<`u`&&window.document&&window.document.createElement);function u(e,t,{checkForDefaultPrevented:n=!0}={}){return c(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}c(u,`composeEventHandlers`);function d(e){if(!l)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}c(d,`getOwnerWindow`);function f(e){if(!l)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}c(f,`getOwnerDocument`);function p(e,t=!1){let{activeElement:n}=f(e);if(!n?.nodeName)return null;if(m(n)&&n.contentDocument)return p(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=f(n).getElementById(e);if(t)return t}}return n}c(p,`getActiveElement`);function m(e){return e.tagName===`IFRAME`}c(m,`isFrame`);var h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}g(_,`setRef`);function v(...e){return t=>{let n=!1,r=e.map(e=>{let r=_(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_(e[t],null)}}}}g(v,`composeRefs`);function y(...e){return o.useCallback(v(...e),e)}g(y,`useComposedRefs`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=S(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[s,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>o.createContext(e));return S(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=globalThis?.document?o.useLayoutEffect:()=>{},ee=Object.defineProperty,te=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),ne=o.useId||(()=>void 0),D=0;function O(e){let[t,n]=o.useState(ne());return E(()=>{e||n(e=>e??String(D++))},[e]),e||(t?`radix-${t}`:``)}te(O,`useId`);var re=Object.defineProperty,ie=(e,t)=>re(e,`name`,{value:t,configurable:!0}),ae=o.useEffectEvent,oe=o.useInsertionEffect;function se(e){if(typeof ae==`function`)return ae(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof oe==`function`?oe(()=>{t.current=e}):E(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}ie(se,`useEffectEvent`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0}),le=o.useInsertionEffect||E;function ue({prop:e,defaultProp:t,onChange:n=k(()=>{},`onChange`),caller:r}){let[i,a,s]=de({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=fe(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}k(ue,`useControllableState`);function de({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return le(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}k(de,`useUncontrolledState`);function fe(e){return typeof e==`function`}k(fe,`isFunction`);var pe=Symbol(`RADIX:SYNC_STATE`);function me(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=se(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===pe)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=o.useRef(m);o.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=o.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return o.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:pe,state:i})},[i,f.state,l]),[g,p]}k(me,`useControllableStateReducer`);var he=e(r(),1),ge=Object.defineProperty,A=(e,t)=>ge(e,`name`,{value:t,configurable:!0});function _e(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];Te(r)&&typeof ke==`function`&&(r=ke(r._payload)),o.Children.forEach(r,e=>{if(Ce(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Te(n)&&typeof ke==`function`&&(n=ke(n._payload)),a=be(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?Se(a):void 0,u=y(n,l);if(!a){if(r||r===0)throw Error(s?Oe(e):De(e));return r}let d=xe(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}A(_e,`createSlot`);var ve=Symbol.for(`radix.slottable`);function ye(e){let t=A(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=ve,t}A(ye,`createSlottable`);var be=A((e,t)=>{if(`child`in e.props){let t=e.props.child;return o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null}return o.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function xe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}A(xe,`mergeProps`);function Se(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}A(Se,`getElementRef`);function Ce(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ve}A(Ce,`isSlottable`);var we=Symbol.for(`react.lazy`);function Te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===we&&`_payload`in e&&Ee(e._payload)}A(Te,`isLazyComponent`);function Ee(e){return typeof e==`object`&&!!e&&`then`in e}A(Ee,`isPromiseLike`);var De=A(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Oe=A(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ke=o.use,Ae=Object.defineProperty,je=(e,t)=>Ae(e,`name`,{value:t,configurable:!0}),j=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=_e(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Me(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}je(Me,`dispatchDiscreteCustomEvent`);var Ne=Object.defineProperty,Pe=(e,t)=>Ne(e,`name`,{value:t,configurable:!0});function M(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Pe(M,`useCallbackRef`);var Fe=Object.defineProperty,N=(e,t)=>Fe(e,`name`,{value:t,configurable:!0}),Ie=`dismissableLayer.update`,Le=`dismissableLayer.pointerDownOutside`,Re=`dismissableLayer.focusOutside`,ze,Be=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ve=o.forwardRef(N(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...d}=e,f=o.useContext(Be),[p,m]=o.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=o.useState({}),_=y(t,m),v=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x?v.indexOf(x):-1,C=p?v.indexOf(p):-1,w=f.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,E=o.useRef(!1),ee=We(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return T&&!t},[f.branches,T])}),te=Ge(e=>{if(r&&E.current)return;let t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},h),ne=p?C===v.length-1:!1,D=M(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(ne)return h.addEventListener(`keydown`,D,{capture:!0}),()=>h.removeEventListener(`keydown`,D,{capture:!0})},[h,ne,D]),o.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ze=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),Ke(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),f.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=ze))}},[p,h,n,f]),o.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),Ke())},[p,f]),o.useEffect(()=>{let e=N(()=>g({}),`handleUpdate`);return document.addEventListener(Ie,e),()=>document.removeEventListener(Ie,e)},[]),(0,b.jsx)(j.div,{...d,ref:_,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:u(e.onFocusCapture,te.onFocusCapture),onBlurCapture:u(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:u(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function He(){let e=o.useContext(Be),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}N(He,`useDismissableLayerSurface`);var Ue=N(()=>!0,`IS_TRUE`);function We(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Ue}=t,c=M(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}N(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}N(t,`isOutsideInteractionIntercepted`);function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}N(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}N(p,`handleInteractionBubble`);let m=N(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||qe(Le,c,p,{discrete:!0})};if(N(o,`handleAndDispatchPointerDownOutsideEvent`),!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:N(()=>l.current=!0,`onPointerDownCapture`)}}N(We,`usePointerDownOutside`);function Ge(e,t=globalThis?.document){let n=M(e),r=o.useRef(!1);return o.useEffect(()=>{let e=N(e=>{e.target&&!r.current&&qe(Re,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:N(()=>r.current=!0,`onFocusCapture`),onBlurCapture:N(()=>r.current=!1,`onBlurCapture`)}}N(Ge,`useFocusOutside`);function Ke(){let e=new CustomEvent(Ie);document.dispatchEvent(e)}N(Ke,`dispatchUpdate`);function qe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Me(i,a):i.dispatchEvent(a)}N(qe,`handleAndDispatchCustomEvent`);var Je=Object.defineProperty,P=(e,t)=>Je(e,`name`,{value:t,configurable:!0}),Ye=`focusScope.autoFocusOnMount`,Xe=`focusScope.autoFocusOnUnmount`,Ze={bubbles:!1,cancelable:!0},Qe=o.forwardRef(P(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[c,l]=o.useState(null),u=M(i),d=M(a),f=o.useRef(null),p=y(t,l),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:F(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||F(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&F(c)};P(e,`handleFocusIn`),P(t,`handleFocusOut`),P(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),o.useEffect(()=>{if(c){at.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Ye,Ze);c.addEventListener(Ye,u),c.dispatchEvent(t),t.defaultPrevented||($e(ct(tt(c)),{select:!0}),document.activeElement===e&&F(c))}return()=>{c.removeEventListener(Ye,u),setTimeout(()=>{let t=new CustomEvent(Xe,Ze);c.addEventListener(Xe,d),c.dispatchEvent(t),t.defaultPrevented||F(e??document.body,{select:!0}),c.removeEventListener(Xe,d),at.remove(m)},0)}}},[c,u,d,m]);let h=o.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=et(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&F(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&F(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(j.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})},`FocusScope`));function $e(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(F(r,{select:t}),document.activeElement!==n)return}P($e,`focusFirst`);function et(e){let t=tt(e);return[nt(t,e),nt(t.reverse(),e)]}P(et,`getTabbableEdges`);function tt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:P(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}P(tt,`getTabbableCandidates`);function nt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):rt(r,{upTo:t})))return r}P(nt,`findVisible`);function rt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}P(rt,`isHidden`);function it(e){return e instanceof HTMLInputElement&&`select`in e}P(it,`isSelectableInput`);function F(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}P(F,`focus`);var at=ot();function ot(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=st(e,t),e.unshift(t)},remove(t){e=st(e,t),e[0]?.resume()}}}P(ot,`createFocusScopesStack`);function st(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}P(st,`arrayRemove`);function ct(e){return e.filter(e=>e.tagName!==`A`)}P(ct,`removeLinks`);var lt=Object.defineProperty,ut=o.forwardRef(((e,t)=>lt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);E(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?he.createPortal((0,b.jsx)(j.div,{...r,ref:t}),s):null},`Portal`)),dt=Object.defineProperty,I=(e,t)=>dt(e,`name`,{value:t,configurable:!0});function ft(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}I(ft,`useStateMachine`);var pt=I(e=>{let{present:t,children:n}=e,r=mt(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=gt(r.ref,_t(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function mt(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=ft(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??L(r.current),s.current=void 0):a.current=`none`},[c]),E(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=L(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),E(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=I(a=>{let o=L(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=I(e=>{e.target===t&&(a.current=L(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=L(t)}else r.current=null;n(e)},[])}}I(mt,`usePresence`);function ht(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}I(ht,`setRef`);function gt(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ht(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ht(n[e],null)}}},[])}I(gt,`useStableComposedRefs`);function L(e){return e?.animationName||`none`}I(L,`getAnimationName`);function _t(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}I(_t,`getElementRef`);var vt=Object.defineProperty,yt=(e,t)=>vt(e,`name`,{value:t,configurable:!0}),R=0,z=null;function bt(e){return xt(),e.children}yt(bt,`FocusGuards`);function xt(){o.useEffect(()=>{z||={start:St(),end:St()};let{start:e,end:t}=z;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),R++,()=>{R===1&&(z?.start.remove(),z?.end.remove(),z=null),R=Math.max(0,R-1)}},[])}yt(xt,`useFocusGuards`);function St(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}yt(St,`createFocusGuard`);var B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)};function Ct(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function wt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var V=`right-scroll-bar-position`,H=`width-before-scroll-bar`,Tt=`with-scroll-bars-hidden`,Et=`--removed-body-scroll-bar-size`;function Dt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ot(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var kt=typeof window<`u`?o.useLayoutEffect:o.useEffect,At=new WeakMap;function jt(e,t){var n=Ot(t||null,function(t){return e.forEach(function(e){return Dt(e,t)})});return kt(function(){var t=At.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Dt(e,null)}),i.forEach(function(e){r.has(e)||Dt(e,a)})}At.set(n,e)},[e]),n}function Mt(e){return e}function Nt(e,t){t===void 0&&(t=Mt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Pt(e){e===void 0&&(e={});var t=Nt(null);return t.options=B({async:!0,ssr:!1},e),t}var Ft=function(e){var t=e.sideCar,n=Ct(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,B({},n))};Ft.isSideCarExport=!0;function It(e,t){return e.useMedium(t),Ft}var Lt=Pt(),Rt=function(){},U=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Rt,onWheelCapture:Rt,onTouchMoveCapture:Rt}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ct(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=jt([n,t]),w=B(B({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Lt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),B(B({},w),{ref:C})):o.createElement(y,B({},w,{className:l,ref:C}),c))});U.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},U.classNames={fullWidth:H,zeroRight:V};var zt,Bt=function(){if(zt)return zt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Vt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Bt();return t&&e.setAttribute(`nonce`,t),e}function Ht(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ut(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Wt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vt())&&(Ht(t,n),Ut(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gt=function(){var e=Wt();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kt=function(){var e=Gt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},qt={left:0,top:0,right:0,gap:0},Jt=function(e){return parseInt(e||``,10)||0},Yt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Jt(n),Jt(r),Jt(i)]},Xt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return qt;var t=Yt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Zt=Kt(),W=`data-scroll-locked`,Qt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Tt} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${W}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${V} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${H} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${V} .${V} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${H} .${H} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${W}] {
36
+ ${Et}: ${s}px;
37
+ }
38
+ `},$t=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},en=function(){o.useEffect(function(){return document.body.setAttribute(W,($t()+1).toString()),function(){var e=$t()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},tn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;en();var a=o.useMemo(function(){return Xt(i)},[i]);return o.createElement(Zt,{styles:Qt(a,!t,i,n?``:`!important`)})},nn=!1;if(typeof window<`u`)try{var G=Object.defineProperty({},"passive",{get:function(){return nn=!0,!0}});window.addEventListener(`test`,G,G),window.removeEventListener(`test`,G,G)}catch{nn=!1}var K=nn?{passive:!1}:!1,rn=function(e){return e.tagName===`TEXTAREA`},an=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!rn(e)&&n[t]===`visible`)},on=function(e){return an(e,`overflowY`)},sn=function(e){return an(e,`overflowX`)},cn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),dn(e,r)){var i=fn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ln=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},un=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},dn=function(e,t){return e===`v`?on(t):sn(t)},fn=function(e,t){return e===`v`?ln(t):un(t)},pn=function(e,t){return e===`h`&&t===`rtl`?-1:1},mn=function(e,t,n,r,i){var a=pn(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=fn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&dn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},q=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hn=function(e){return[e.deltaX,e.deltaY]},gn=function(e){return e&&`current`in e?e.current:e},_n=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vn=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},yn=0,J=[];function bn(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(yn++)[0],a=o.useState(Kt)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wt([e.lockRef.current],(e.shards||[]).map(gn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=q(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=cn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=cn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return mn(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!J.length||J[J.length-1]!==a)){var r=`deltaY`in n?hn(n):q(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&_n(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(gn).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:xn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=q(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,hn(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,q(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return J.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,K),document.addEventListener(`touchmove`,l,K),document.addEventListener(`touchstart`,d,K),function(){J=J.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,K),document.removeEventListener(`touchmove`,l,K),document.removeEventListener(`touchstart`,d,K)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:vn(i)}):null,m?o.createElement(tn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Sn=It(Lt,bn),Cn=o.forwardRef(function(e,t){return o.createElement(U,B({},e,{ref:t,sideCar:Sn}))});Cn.classNames=U.classNames;var wn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Y=new WeakMap,X=new WeakMap,Tn={},En=0,Dn=function(e){return e&&(e.host||Dn(e.parentNode))},On=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Dn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},kn=function(e,t,n,r){var i=On(t,Array.isArray(e)?e:[e]);Tn[n]||(Tn[n]=new WeakMap);var a=Tn[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Y.get(e)||0)+1,l=(a.get(e)||0)+1;Y.set(e,c),a.set(e,l),o.push(e),c===1&&i&&X.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),En++,function(){o.forEach(function(e){var t=Y.get(e)-1,i=a.get(e)-1;Y.set(e,t),a.set(e,i),t||(X.has(e)||e.removeAttribute(r),X.delete(e)),i||e.removeAttribute(n)}),En--,En||(Y=new WeakMap,Y=new WeakMap,X=new WeakMap,Tn={})}},An=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||wn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),kn(r,i,n,`aria-hidden`)):function(){return null}},jn=Object.defineProperty,Z=(e,t)=>jn(e,`name`,{value:t,configurable:!0}),Mn=`Dialog`,[Nn,Pn]=w(Mn),[Fn,Q]=Nn(Mn),In=Z(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=o.useRef(null),l=o.useRef(null),[u,d]=ue({prop:r,defaultProp:i??!1,onChange:a,caller:Mn}),[f,p]=o.useState(0),[m,h]=o.useState(0);return(0,b.jsx)(Fn,{scope:t,triggerRef:c,contentRef:l,contentId:O(),titleId:O(),descriptionId:O(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:o.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})},`Dialog`),Ln=`DialogPortal`,[Rn,zn]=Nn(Ln,{forceMount:void 0}),Bn=Z(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Q(Ln,t);return(0,b.jsx)(Rn,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,b.jsx)(pt,{present:n||a.open,children:(0,b.jsx)(ut,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Vn=`DialogOverlay`,Hn=o.forwardRef(Z(function(e,t){let n=zn(Vn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q(Vn,e.__scopeDialog);return a.modal?(0,b.jsx)(pt,{present:r||a.open,children:(0,b.jsx)(Wn,{...i,ref:t})}):null},`DialogOverlay`)),Un=_e(`DialogOverlay.RemoveScroll`),Wn=o.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Vn,n),a=y(t,He());return(0,b.jsx)(Cn,{as:Un,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(j.div,{"data-state":tr(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),$=`DialogContent`,Gn=o.forwardRef(Z(function(e,t){let n=zn($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q($,e.__scopeDialog);return(0,b.jsx)(pt,{present:r||a.open,children:a.modal?(0,b.jsx)(Kn,{...i,ref:t}):(0,b.jsx)(qn,{...i,ref:t})})},`DialogContent`)),Kn=o.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=o.useRef(null),i=y(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return An(e)},[]),(0,b.jsx)(Jn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:u(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:u(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:u(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),qn=o.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,b.jsx)(Jn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Jn=o.forwardRef(Z(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Q($,n);return xt(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(Qe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,b.jsx)(Ve,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":tr(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Yn=`DialogTitle`,Xn=o.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Yn,n),{setTitleCount:a}=i;return E(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,b.jsx)(j.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Zn=`DialogDescription`,Qn=o.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Zn,n),{setDescriptionCount:a}=i;return E(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,b.jsx)(j.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),$n=`DialogClose`,er=o.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q($n,n);return(0,b.jsx)(j.button,{type:`button`,...r,ref:t,onClick:u(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function tr(e){return e?`open`:`closed`}Z(tr,`getState`);var nr=In,rr=Bn,ir=o.forwardRef(({className:e,...t},n)=>(0,b.jsx)(Hn,{ref:n,className:a(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));ir.displayName=Hn.displayName;var ar=o.forwardRef(({className:e,children:t,...n},r)=>(0,b.jsxs)(rr,{children:[(0,b.jsx)(ir,{}),(0,b.jsxs)(Gn,{ref:r,className:a(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,e),...n,children:[t,(0,b.jsxs)(er,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,b.jsx)(i,{className:`h-4 w-4`}),(0,b.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));ar.displayName=Gn.displayName;var or=({className:e,...t})=>(0,b.jsx)(`div`,{className:a(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});or.displayName=`DialogHeader`;var sr=o.forwardRef(({className:e,...t},n)=>(0,b.jsx)(Xn,{ref:n,className:a(`text-lg font-semibold leading-none tracking-tight`,e),...t}));sr.displayName=Xn.displayName;var cr=o.forwardRef(({className:e,...t},n)=>(0,b.jsx)(Qn,{ref:n,className:a(`text-sm text-muted-foreground`,e),...t}));cr.displayName=Qn.displayName;export{sr as i,ar as n,or as r,nr as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./jsx-runtime-B-hcVAMW.js";import{t as n}from"./react-dom-8HkkFvw6.js";var r=e(t(),1),i=e(n(),1);function a(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var o=e=>{switch(e){case`success`:return l;case`info`:return d;case`warning`:return u;case`error`:return f;default:return null}},s=Array(12).fill(0),c=({visible:e,className:t})=>r.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},r.createElement(`div`,{className:`sonner-spinner`},s.map((e,t)=>r.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),l=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),u=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),d=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),f=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),p=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},r.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),r.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ee=()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},m=1,h=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:m++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let i=Promise.resolve(e instanceof Function?e():e),a=n!==void 0,o,s=i.then(async e=>{if(o=[`resolve`,e],r.isValidElement(e))a=!1,this.create({id:n,type:`default`,message:e});else if(_(e)&&!e.ok){a=!1;let i=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){a=!1;let i=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||m++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},g=(e,t)=>{let n=t?.id||m++;return h.addToast({title:e,...t,id:n}),n},_=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,v=Object.assign(g,{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});a(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function y(e){return e.label!==void 0}var te=3,b=`24px`,x=`16px`,S=4e3,C=356,w=14,T=45,E=200;function D(...e){return e.filter(Boolean).join(` `)}function ne(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var O=e=>{let{invert:t,toast:n,unstyled:i,interacting:a,setHeights:s,visibleToasts:l,heights:u,index:d,toasts:f,expanded:m,removeToast:h,defaultRichColors:g,closeButton:_,style:v,cancelButtonStyle:te,actionButtonStyle:b,className:x=``,descriptionClassName:C=``,duration:w,position:O,gap:k,expandByDefault:A,classNames:j,icons:M,closeButtonAriaLabel:re=`Close toast`}=e,[N,P]=r.useState(null),[F,ie]=r.useState(null),[I,L]=r.useState(!1),[R,z]=r.useState(!1),[B,V]=r.useState(!1),[ae,oe]=r.useState(!1),[se,ce]=r.useState(!1),[le,H]=r.useState(0),[ue,U]=r.useState(0),W=r.useRef(n.duration||w||S),de=r.useRef(null),G=r.useRef(null),fe=d===0,pe=d+1<=l,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=r.useMemo(()=>u.findIndex(e=>e.toastId===n.id)||0,[u,n.id]),ge=r.useMemo(()=>n.closeButton??_,[n.closeButton,_]),_e=r.useMemo(()=>n.duration||w||S,[n.duration,w]),Y=r.useRef(0),X=r.useRef(0),ve=r.useRef(0),Z=r.useRef(null),[ye,be]=O.split(`-`),xe=r.useMemo(()=>u.reduce((e,t,n)=>n>=J?e:e+t.height,0),[u,J]),Se=ee(),Ce=n.invert||t,Q=K===`loading`;X.current=r.useMemo(()=>J*k+xe,[J,xe]),r.useEffect(()=>{W.current=_e},[_e]),r.useEffect(()=>{L(!0)},[]),r.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),s(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>s(e=>e.filter(e=>e.toastId!==n.id))}},[s,n.id]),r.useLayoutEffect(()=>{if(!I)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),s(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[I,n.title,n.description,s,n.id,n.jsx,n.action,n.cancel]);let $=r.useCallback(()=>{z(!0),H(X.current),s(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{h(n)},E)},[n,h,s,X]);r.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return m||a||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[m,a,n,K,Se,$]),r.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return M?.loading?r.createElement(`div`,{className:D(j?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},M.loading):r.createElement(c,{className:D(j?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||M?.[K]||o(K);return r.createElement(`li`,{tabIndex:0,ref:G,className:D(x,me,j?.toast,n?.classNames?.toast,j?.default,j?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??g,"data-styled":!(n.jsx||n.unstyled||i),"data-mounted":I,"data-promise":!!n.promise,"data-swiped":se,"data-removed":R,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":B,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":ae,"data-swipe-direction":F,"data-expanded":!!(m||A&&I),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${R?le:X.current}px`,"--initial-height":A?`auto`:`${ue}px`,...v,...n.style},onDragEnd:()=>{V(!1),P(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(V(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(ae||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=N===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),ie(N===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),oe(!0);return}var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ce(!1),V(!1),P(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ne(O);!N&&(Math.abs(a)>1||Math.abs(i)>1)&&P(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(N===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(N===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ce(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?r.createElement(`button`,{"aria-label":re,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:D(j?.closeButton,n?.classNames?.closeButton)},M?.close??p):null,(K||n.icon||n.promise)&&n.icon!==null&&(M?.[K]!==null||n.icon)?r.createElement(`div`,{"data-icon":``,className:D(j?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,r.createElement(`div`,{"data-content":``,className:D(j?.content,n?.classNames?.content)},r.createElement(`div`,{"data-title":``,className:D(j?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?r.createElement(`div`,{"data-description":``,className:D(C,he,j?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),r.isValidElement(n.cancel)?n.cancel:n.cancel&&y(n.cancel)?r.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||te,onClick:e=>{y(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:D(j?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,r.isValidElement(n.action)?n.action:n.action&&y(n.action)?r.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||b,onClick:e=>{y(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:D(j?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function k(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function A(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?x:b;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var j=r.forwardRef(function(e,t){let{id:n,invert:a,position:o=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:ee,duration:m,style:g,visibleToasts:_=te,toastOptions:v,dir:y=k(),gap:b=w,icons:x,containerAriaLabel:S=`Notifications`}=e,[T,E]=r.useState([]),D=r.useMemo(()=>n?T.filter(e=>e.toasterId===n):T.filter(e=>!e.toasterId),[T,n]),ne=r.useMemo(()=>Array.from(new Set([o].concat(D.filter(e=>e.position).map(e=>e.position)))),[D,o]),[j,M]=r.useState([]),[re,N]=r.useState(!1),[P,F]=r.useState(!1),[ie,I]=r.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),L=r.useRef(null),R=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),z=r.useRef(null),B=r.useRef(!1),V=r.useCallback(e=>{E(t=>(t.find(t=>t.id===e.id)?.delete||h.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return r.useEffect(()=>h.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{E(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{i.flushSync(()=>{E(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[T]),r.useEffect(()=>{if(p!==`system`){I(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?I(`dark`):I(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{I(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{I(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{T.length<=1&&N(!1)},[T]),r.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;N(!0),(t=L.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===L.current||L.current?.contains(document.activeElement))&&N(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),r.useEffect(()=>{if(L.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,B.current=!1)}},[L.current]),r.createElement(`section`,{ref:t,"aria-label":`${S} ${R}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ne.map((t,n)=>{let[i,o]=t.split(`-`);return D.length?r.createElement(`ol`,{key:t,dir:y===`auto`?k():y,tabIndex:-1,ref:L,className:u,"data-sonner-toaster":!0,"data-sonner-theme":ie,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${j[0]?.height||0}px`,"--width":`${C}px`,"--gap":`${b}px`,...g,...A(d,f)},onBlur:e=>{B.current&&!e.currentTarget.contains(e.relatedTarget)&&(B.current=!1,z.current&&=(z.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||B.current||(B.current=!0,z.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{P||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F(!0)},onPointerUp:()=>F(!1)},D.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>r.createElement(O,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:ee,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:a,visibleToasts:_,closeButton:v?.closeButton??l,interacting:P,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:V,toasts:D.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:M,expandByDefault:c,gap:b,expanded:re,swipeDirections:e.swipeDirections}))):null}))});export{v as n,j as t};
@@ -0,0 +1,36 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as r}from"./useQuery-BrM5_EQu.js";import{n as i}from"./QueryClientProvider-BjElddVn.js";import{n as a,r as ee,t as o}from"./api-lXjeGSiV.js";import{t as s}from"./createLucideIcon-CLdWFMku.js";import{t as c}from"./check-36OnHiEM.js";import{t as te}from"./cloud-upload-D41DfGnv.js";import{t as ne}from"./code-xml-BsvsUoDv.js";import{t as l}from"./copy-B1k2VT2A.js";import{t as re}from"./eye-off-DIe2-cve.js";import{t as ie}from"./eye-Cbs9C6DS.js";import{t as u}from"./globe-hcLYcRzz.js";import{t as d}from"./key-BXUPFSjV.js";import{t as ae}from"./laptop-D_8f9_v7.js";import{t as oe}from"./layers-C_9oEa0w.js";import{t as se}from"./loader-circle-NEOay2w5.js";import{t as ce}from"./play-CPV0a6Tn.js";import{t as f}from"./plus-qKI-KwZh.js";import{n as p,t as le}from"./wifi-Bsq09YFd.js";import{t as ue}from"./refresh-cw-CHzni4H4.js";import{t as de}from"./search-BtJsgOj6.js";import{t as fe}from"./server-CAbKLNFx.js";import{t as m}from"./trash-2-D9HI9O7Q.js";import{t as pe}from"./x-CGuQtexA.js";import{t as me}from"./zap-BS7lyU9U.js";import{t as h}from"./utils-B6KiDbIe.js";import{n as g}from"./dist-yiyhte89.js";import{n as he,t as _}from"./OrangeSwitch-Dc_G3ztN.js";var ge=s(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),_e=s(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),v=s(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ve=s(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),y=e(t(),1),b=n();function ye(e){return!e||e.length<=12?e:`${e.slice(0,7)}••••••••••••••••${e.slice(-6)}`}function x(){let e=i(),[t,n]=(0,y.useState)(!1),[s,x]=(0,y.useState)(``),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(null),[E,D]=(0,y.useState)(null),[be,xe]=(0,y.useState)(new Set),[O,Se]=(0,y.useState)(``),[k,Ce]=(0,y.useState)(`curl`),[A,j]=(0,y.useState)(!1),[M,N]=(0,y.useState)(null),[P,F]=(0,y.useState)(!1),[I,L]=(0,y.useState)(``),[R,z]=(0,y.useState)(!1),[B,V]=(0,y.useState)(``),H=r({queryKey:[`settings`],queryFn:a.settings,retry:!1}),we=r({queryKey:[`keys`],queryFn:a.keys,retry:!1}),Te=r({queryKey:[`models`],queryFn:a.models,retry:!1}),Ee=r({queryKey:[`usage-stats`,`today`],queryFn:()=>a.usageStats(`today`),retry:!1}),De=r({queryKey:[`usage-history`,`recent`],queryFn:()=>a.usageHistory(`today`,8),retry:!1});r({queryKey:[`health`],queryFn:a.health,refetchInterval:3e4,retry:!1});let[U,W]=(0,y.useState)(!0);(0,y.useEffect)(()=>{H.data&&(typeof H.data.requireApiKey==`boolean`&&W(H.data.requireApiKey),typeof H.data.tunnelEnabled==`boolean`&&F(H.data.tunnelEnabled),typeof H.data.tunnelUrl==`string`&&L(H.data.tunnelUrl),typeof H.data.tailscaleUrl==`string`&&(V(H.data.tailscaleUrl),z(!!H.data.tailscaleUrl)))},[H.data]);let G=(e,t)=>{navigator.clipboard.writeText(e),D(t),g.success(`Tersalin ke clipboard!`),setTimeout(()=>D(null),1500)},Oe=e=>{xe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ke=async t=>{W(t);try{await a.updateSettings({requireApiKey:t}),e.invalidateQueries({queryKey:[`settings`]}),g.success(t?`Proteksi API Key diaktifkan`:`Proteksi API Key dinonaktifkan (Publik)`)}catch{g.error(`Gagal memperbarui pengaturan keamanan API Key`)}},Ae=async(t,n)=>{try{await a.updateKey(t,{isActive:!n}),e.invalidateQueries({queryKey:[`keys`]}),g.success(n?`Kunci dinonaktifkan`:`Kunci diaktifkan`)}catch{g.error(`Gagal mengubah status kunci`)}},je=async t=>{try{await a.deleteKey(t),e.invalidateQueries({queryKey:[`keys`]}),g.success(`Kunci API berhasil dihapus`)}catch{g.error(`Gagal menghapus kunci`)}},Me=async()=>{T(null);try{let t=await a.createKey(s||`Default Key`);C(t.key),x(``),e.invalidateQueries({queryKey:[`keys`]}),g.success(`Kunci API baru berhasil dibuat`)}catch(e){T(ee(e))}},K=o?`${o}/v1`:typeof window<`u`&&window.location?.origin?`${window.location.origin}/v1`:`/v1`,q=typeof window<`u`&&window.location?.hostname?`${window.location.protocol}//${window.location.hostname}${window.location.port?`:${window.location.port}`:``}/v1`:`/v1`,J=we.data??[],Ne=J.filter(e=>e.isActive).length,Y=J.find(e=>e.isActive)?.key||J[0]?.key||`sk-default-key`,X=(0,y.useMemo)(()=>{if(!O.trim())return J;let e=O.toLowerCase();return J.filter(t=>t.name.toLowerCase().includes(e)||t.key.toLowerCase().includes(e))},[J,O]),Pe=Te.data?.data?.length||165,Z=Ee.data,Q=De.data?.logs||[],Fe=async()=>{j(!0),N(null);let e=performance.now();try{let t=await fetch(`${K}/chat/completions`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${Y}`},body:JSON.stringify({model:`openrouter/openrouter/free`,messages:[{role:`user`,content:`Ping test: balas 'PONG' saja.`}],max_tokens:10})}),n=performance.now(),r=Math.round(n-e);if(!t.ok)N({status:t.status,latencyMs:r,error:`HTTP ${t.status}: ${t.statusText}`}),g.error(`Tes gagal: status ${t.status}`);else{let e=await t.json();N({status:t.status,latencyMs:r,data:e}),g.success(`Tes Sukses! Latensi ${r}ms`)}}catch(t){let n=performance.now(),r=Math.round(n-e);N({status:0,latencyMs:r,error:t?.message||`Koneksi gagal`}),g.error(`Gagal terhubung ke endpoint`)}finally{j(!1)}},$={curl:`curl ${K}/chat/completions \\
2
+ -H "Content-Type: application/json" \\
3
+ -H "Authorization: Bearer ${Y}" \\
4
+ -d '{
5
+ "model": "openrouter/free",
6
+ "messages": [{"role": "user", "content": "Halo EkaRouter!"}]
7
+ }'`,python:`from openai import OpenAI
8
+
9
+ client = OpenAI(
10
+ base_url="${K}",
11
+ api_key="${Y}"
12
+ )
13
+
14
+ response = client.chat.completions.create(
15
+ model="openrouter/free",
16
+ messages=[{"role": "user", "content": "Halo EkaRouter!"}]
17
+ )
18
+ print(response.choices[0].message.content)`,node:`import OpenAI from "openai";
19
+
20
+ const openai = new OpenAI({
21
+ baseURL: "${K}",
22
+ apiKey: "${Y}",
23
+ });
24
+
25
+ const completion = await openai.chat.completions.create({
26
+ model: "openrouter/free",
27
+ messages: [{ role: "user", content: "Halo EkaRouter!" }],
28
+ });
29
+
30
+ console.log(completion.choices[0].message.content);`,claude:`# Claude Code CLI (Configured with EkaRouter)
31
+ export ANTHROPIC_BASE_URL="${K}"
32
+ export ANTHROPIC_API_KEY="${Y}"
33
+ claude -p "Uji coba koneksi AI Gateway EkaRouter"`,cursor:`// Cursor / VS Code / Roo Code Custom Provider
34
+ Base URL: ${K}
35
+ API Key : ${Y}
36
+ Model : openrouter/free (atau MY-COMBO)`};return(0,b.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-6 pb-12`,children:[(0,b.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-border/80 bg-gradient-to-b from-card to-card/60 p-6 shadow-sm`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,b.jsx)(`div`,{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary border border-primary/20 shadow-xs`,children:(0,b.jsx)(he,{className:`h-5 w-5 text-primary`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5 flex-wrap`,children:[(0,b.jsx)(`h1`,{className:`text-lg font-bold tracking-tight text-foreground sm:text-xl`,children:`Gateway & API Endpoint`}),(0,b.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 rounded-full border border-emerald-500/20 bg-emerald-500/10 px-2.5 py-0.5 text-[11px] font-medium text-emerald-400`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse`}),(0,b.jsx)(`span`,{children:`Online & Ready`})]})]}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground leading-relaxed`,children:`Pusat kendali routing OpenAI-compatible gateway, manajemen akses kunci, dan inspeksi throughput real-time.`})]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:Fe,disabled:A,className:`inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-card px-3.5 text-xs font-medium text-foreground hover:bg-hover active:scale-[0.98] transition-all disabled:opacity-50`,children:[A?(0,b.jsx)(se,{className:`h-3.5 w-3.5 animate-spin text-primary`}):(0,b.jsx)(ce,{className:`h-3.5 w-3.5 text-emerald-400 fill-emerald-400/20`}),(0,b.jsx)(`span`,{children:A?`Menguji...`:`Tes Inferensi`})]}),(0,b.jsxs)(`button`,{type:`button`,onClick:()=>{x(``),C(null),T(null),n(!0)},className:`inline-flex h-9 items-center gap-2 rounded-lg bg-primary px-3.5 text-xs font-semibold text-primary-foreground shadow-xs hover:bg-primary-light active:scale-[0.98] transition-all`,children:[(0,b.jsx)(f,{className:`h-3.5 w-3.5 stroke-[2.5]`}),(0,b.jsx)(`span`,{children:`Buat Key Baru`})]})]})]}),M&&(0,b.jsxs)(`div`,{className:h(`mt-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border p-3 text-xs transition-all`,M.error?`border-danger/30 bg-danger/10 text-danger`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400`),children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M.error?(0,b.jsx)(v,{className:`h-4 w-4 shrink-0`}):(0,b.jsx)(c,{className:`h-4 w-4 shrink-0 text-emerald-400`}),(0,b.jsx)(`span`,{children:M.error?`Uji Coba Gagal: ${M.error}`:`Uji Coba Berhasil! Latensi respons: ${M.latencyMs} ms | Jawaban: "${M.data?.choices?.[0]?.message?.content||`OK`}"`})]}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>N(null),className:`text-[11px] underline opacity-80 hover:opacity-100`,children:`Tutup`})]})]}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 gap-3.5 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card p-4 shadow-xs transition-all hover:border-primary/30`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Endpoint Utama`}),(0,b.jsx)(fe,{className:`h-4 w-4 text-primary`})]}),(0,b.jsxs)(`div`,{className:`mt-2.5 flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-foreground font-mono`,children:typeof window<`u`&&window.location?.port?`:${window.location.port}/v1`:`/v1`}),(0,b.jsx)(`span`,{className:`text-[11px] text-emerald-400 font-medium`,children:`Port Aktif`})]}),(0,b.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,b.jsx)(`span`,{className:`truncate`,children:`OpenAI Compatible`}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(K,`metric-local`),className:`font-medium text-primary hover:underline flex items-center gap-1`,children:E===`metric-local`?`Disalin`:`Salin URL`})]})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card p-4 shadow-xs transition-all hover:border-primary/30`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Model Terhubung`}),(0,b.jsx)(oe,{className:`h-4 w-4 text-blue-400`})]}),(0,b.jsxs)(`div`,{className:`mt-2.5 flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-foreground`,children:Pe}),(0,b.jsx)(`span`,{className:`text-[11px] text-blue-400 font-medium`,children:`AI Models`})]}),(0,b.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground truncate`,children:`Gemini, Claude, Groq, OpenRouter, Combos`})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card p-4 shadow-xs transition-all hover:border-primary/30`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Kunci API Terdaftar`}),(0,b.jsx)(d,{className:`h-4 w-4 text-amber-400`})]}),(0,b.jsxs)(`div`,{className:`mt-2.5 flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-foreground`,children:Ne}),(0,b.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`/ `,J.length,` Kunci Aktif`]})]}),(0,b.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:U?`Status: Wajib Kunci (Terkunci)`:`Status: Akses Terbuka`})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card p-4 shadow-xs transition-all hover:border-primary/30`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Total Permintaan`}),(0,b.jsx)(me,{className:`h-4 w-4 text-emerald-400`})]}),(0,b.jsxs)(`div`,{className:`mt-2.5 flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-foreground`,children:Z?.totalRequests||Q.length||0}),(0,b.jsx)(`span`,{className:`text-[11px] text-emerald-400 font-medium`,children:`Permintaan`})]}),(0,b.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground truncate`,children:[((Z?.totalTokens||0)+(Z?.promptTokens||0)).toLocaleString(),` total token diproses`]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/80 bg-card p-5 sm:p-6 shadow-xs space-y-4`,children:[(0,b.jsx)(`div`,{className:`flex items-center justify-between border-b border-border/60 pb-3.5`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(u,{className:`h-4 w-4 text-primary`}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Saluran Akses & URL Endpoint`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Gunakan URL ini di aplikasi klien, script, atau extension AI Anda.`})]})]})}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 lg:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border/70 bg-muted/40 p-4 transition-colors hover:border-primary/40`,children:[(0,b.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-card border border-border text-foreground`,children:(0,b.jsx)(ae,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Endpoint Server`}),(0,b.jsx)(`span`,{className:`rounded-sm bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400 border border-emerald-500/20`,children:`Utama`})]}),(0,b.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Untuk tool di laptop ini`})]})]})}),(0,b.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border/80 bg-card px-3 py-1.5`,children:[(0,b.jsx)(`code`,{className:`font-mono text-xs text-foreground truncate select-all`,children:K}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(K,`local`),className:`ml-2 p-1 text-muted-foreground hover:text-foreground transition-colors`,title:`Salin endpoint`,children:E===`local`?(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,b.jsx)(l,{className:`h-3.5 w-3.5`})})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border/70 bg-muted/40 p-4 transition-colors hover:border-primary/40`,children:[(0,b.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-card border border-border text-foreground`,children:(0,b.jsx)(le,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Jaringan LAN / Wi-Fi`}),(0,b.jsx)(`span`,{className:`rounded-sm bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400 border border-blue-500/20`,children:`Lokal`})]}),(0,b.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Untuk HP / PC lain di Wi-Fi yang sama`})]})]})}),(0,b.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border/80 bg-card px-3 py-1.5`,children:[(0,b.jsx)(`code`,{className:`font-mono text-xs text-foreground truncate select-all`,children:q}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(q,`lan`),className:`ml-2 p-1 text-muted-foreground hover:text-foreground transition-colors`,title:`Salin endpoint`,children:E===`lan`?(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,b.jsx)(l,{className:`h-3.5 w-3.5`})})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border/70 bg-muted/40 p-4 transition-colors hover:border-primary/40`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-card border border-border text-foreground`,children:(0,b.jsx)(te,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Cloudflare Tunnel`}),(0,b.jsx)(`span`,{className:h(`rounded-sm px-1.5 py-0.5 text-[10px] font-medium border`,P?`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`:`bg-muted text-muted-foreground border-border`),children:P?`Aktif`:`Nonaktif`})]}),(0,b.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Akses aman publik via domain gratis`})]})]}),P?(0,b.jsx)(`button`,{type:`button`,onClick:()=>F(!1),className:`p-1 text-danger hover:brightness-110`,title:`Nonaktifkan tunnel`,children:(0,b.jsx)(p,{className:`h-4 w-4`})}):(0,b.jsx)(`button`,{type:`button`,onClick:()=>{L(`https://9router.trycloudflare.com`),F(!0),g.success(`Tunnel Cloudflare diaktifkan`)},className:`rounded-lg bg-primary px-2.5 py-1 text-[11px] font-semibold text-primary-foreground hover:bg-primary-light`,children:`Aktifkan`})]}),(0,b.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border/80 bg-card px-3 py-1.5`,children:[(0,b.jsx)(`code`,{className:`font-mono text-xs text-foreground truncate select-all`,children:P&&I?`${I}/v1`:`https://[tunnel].trycloudflare.com/v1`}),P&&(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(`${I}/v1`,`tunnel`),className:`ml-2 p-1 text-muted-foreground hover:text-foreground transition-colors`,children:E===`tunnel`?(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,b.jsx)(l,{className:`h-3.5 w-3.5`})})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border/70 bg-muted/40 p-4 transition-colors hover:border-primary/40`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-card border border-border text-foreground`,children:(0,b.jsx)(u,{className:`h-4 w-4 text-[#7052ff]`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Tailscale WireGuard`}),(0,b.jsx)(`span`,{className:h(`rounded-sm px-1.5 py-0.5 text-[10px] font-medium border`,R?`bg-[#7052ff]/10 text-[#8d75ff] border-[#7052ff]/20`:`bg-muted text-muted-foreground border-border`),children:R?`Terhubung`:`Nonaktif`})]}),(0,b.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Mesh VPN privat antar perangkat pribadi`})]})]}),R?(0,b.jsx)(`button`,{type:`button`,onClick:()=>z(!1),className:`p-1 text-danger hover:brightness-110`,title:`Nonaktifkan Tailscale`,children:(0,b.jsx)(p,{className:`h-4 w-4`})}):(0,b.jsx)(`button`,{type:`button`,onClick:()=>{V(`https://ekarouter.ts.net`),z(!0),g.success(`Tailscale diaktifkan`)},className:`rounded-lg bg-[#7052ff] px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-[#8165ff]`,children:`Aktifkan`})]}),(0,b.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border/80 bg-card px-3 py-1.5`,children:[(0,b.jsx)(`code`,{className:`font-mono text-xs text-foreground truncate select-all`,children:R&&B?`${B}/v1`:`https://ekarouter.ts.net/v1`}),R&&(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(`${B}/v1`,`tailscale`),className:`ml-2 p-1 text-muted-foreground hover:text-foreground transition-colors`,children:E===`tailscale`?(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,b.jsx)(l,{className:`h-3.5 w-3.5`})})]})]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/80 bg-card p-5 sm:p-6 shadow-xs space-y-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-border/60 pb-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(ne,{className:`h-4 w-4 text-primary`}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Integrasi Cepat (SDK & Code Snippets)`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Contoh konfigurasi siap pakai otomatis terisi dengan kunci aktif Anda.`})]})]}),(0,b.jsx)(`div`,{className:`flex items-center gap-1.5 bg-muted/70 p-1 rounded-lg border border-border/60`,children:[`curl`,`python`,`node`,`claude`,`cursor`].map(e=>(0,b.jsx)(`button`,{type:`button`,onClick:()=>Ce(e),className:h(`px-2.5 py-1 text-xs rounded-md font-medium capitalize transition-all`,k===e?`bg-card text-foreground shadow-xs font-semibold`:`text-muted-foreground hover:text-foreground`),children:e===`curl`?`cURL`:e===`node`?`Node.js`:e===`claude`?`Claude CLI`:e===`cursor`?`Cursor / Cline`:`Python`},e))})]}),(0,b.jsxs)(`div`,{className:`relative rounded-xl border border-border/80 bg-[#0d0f14] p-4 font-mono text-xs`,children:[(0,b.jsx)(`div`,{className:`absolute right-3 top-3`,children:(0,b.jsx)(`button`,{type:`button`,onClick:()=>G($[k],`snippet-${k}`),className:`inline-flex items-center gap-1.5 rounded-lg border border-border/60 bg-[#161922] px-2.5 py-1.5 text-xs text-zinc-300 hover:text-white hover:border-zinc-500 transition-colors shadow-xs`,children:E===`snippet-${k}`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,b.jsx)(`span`,{className:`text-emerald-400`,children:`Tersalin`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l,{className:`h-3.5 w-3.5`}),(0,b.jsx)(`span`,{children:`Salin Kode`})]})})}),(0,b.jsx)(`pre`,{className:`overflow-x-auto text-zinc-300 pr-24 leading-relaxed whitespace-pre-wrap`,children:$[k]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/80 bg-card p-5 sm:p-6 shadow-xs space-y-5`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between border-b border-border/60 pb-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(d,{className:`h-4 w-4 text-primary`}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Kunci API Gateway (Key Vault)`}),(0,b.jsxs)(`span`,{className:`rounded-full bg-primary/10 text-primary border border-primary/20 px-2 py-0.5 text-[11px] font-semibold`,children:[J.length,` Kunci`]})]}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Kunci otentikasi untuk menghubungkan SDK, IDE, dan tool CLI ke EkaRouter.`})]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`div`,{className:`relative w-48 sm:w-60`,children:[(0,b.jsx)(de,{className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,b.jsx)(`input`,{type:`text`,value:O,onChange:e=>Se(e.target.value),placeholder:`Cari kunci API...`,className:`h-8 w-full rounded-lg border border-border bg-muted/40 pl-8 pr-3 text-xs text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none`})]}),(0,b.jsxs)(`button`,{type:`button`,onClick:()=>{x(``),C(null),T(null),n(!0)},className:`inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary-light transition-all shrink-0`,children:[(0,b.jsx)(f,{className:`h-3.5 w-3.5 stroke-[2.5]`}),(0,b.jsx)(`span`,{children:`Kunci Baru`})]})]})]}),(0,b.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-border/70 bg-muted/30 p-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`div`,{className:`mt-0.5 flex h-7 w-7 items-center justify-center rounded-lg bg-card border border-border text-foreground`,children:U?(0,b.jsx)(ve,{className:`h-4 w-4 text-emerald-400`}):(0,b.jsx)(v,{className:`h-4 w-4 text-amber-400`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`Wajibkan Kunci API (Require API Key)`}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:U?`Proteksi aktif: Setiap request tanpa Authorization Header yang valid akan ditolak (401 Unauthorized).`:`Proteksi nonaktif: Endpoint terbuka di jaringan lokal tanpa perlu menyertakan API Key.`})]})]}),(0,b.jsx)(_,{checked:U,onCheckedChange:ke})]}),(0,b.jsx)(`div`,{className:`divide-y divide-border/60`,children:X.length===0?(0,b.jsxs)(`div`,{className:`py-12 text-center`,children:[(0,b.jsx)(d,{className:`mx-auto h-8 w-8 text-muted-foreground/50`}),(0,b.jsx)(`p`,{className:`mt-2 text-xs font-medium text-foreground`,children:`Tidak ada kunci API ditemukan`}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Coba ubah kata kunci pencarian atau buat kunci baru.`})]}):X.map(e=>{let t=be.has(e.id),n=e.createdAt?new Date(e.createdAt).toLocaleDateString(`id-ID`,{day:`numeric`,month:`short`,year:`numeric`}):`30 Agt 2026`;return(0,b.jsxs)(`div`,{className:`py-4 flex flex-col sm:flex-row sm:items-center justify-between gap-3 transition-colors hover:bg-hover/40 px-2 rounded-lg`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,b.jsx)(`span`,{className:`text-xs font-bold text-foreground`,children:e.name}),(0,b.jsx)(`span`,{className:h(`rounded-full px-2 py-0.5 text-[10px] font-medium border`,e.isActive?`border-emerald-500/20 bg-emerald-500/10 text-emerald-400`:`border-zinc-500/20 bg-zinc-500/10 text-zinc-400`),children:e.isActive?`Aktif`:`Dinonaktifkan`}),e.machineId&&(0,b.jsxs)(`span`,{className:`font-mono text-[10px] text-muted-foreground bg-muted/60 px-1.5 py-0.5 rounded border border-border/50`,children:[`ID: `,e.machineId]})]}),(0,b.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[(0,b.jsx)(`code`,{className:`rounded-md border border-border/80 bg-[#0e1015] px-2.5 py-1 font-mono text-xs text-zinc-300`,children:t?e.key:ye(e.key)}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>Oe(e.id),className:`rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors`,title:t?`Sembunyikan`:`Tampilkan`,children:t?(0,b.jsx)(re,{className:`h-3.5 w-3.5`}):(0,b.jsx)(ie,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(e.key,e.id),className:`rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors`,title:`Salin kunci`,children:E===e.id?(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,b.jsx)(l,{className:`h-3.5 w-3.5`})})]}),(0,b.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground flex items-center gap-1`,children:[(0,b.jsx)(_e,{className:`h-3 w-3`}),(0,b.jsxs)(`span`,{children:[`Dibuat pada `,n]})]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3 self-end sm:self-center shrink-0`,children:[(0,b.jsx)(_,{checked:e.isActive??!0,onCheckedChange:()=>Ae(e.id,e.isActive??!0)}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>je(e.id),className:`rounded-lg p-1.5 text-muted-foreground hover:text-danger hover:bg-danger/10 transition-colors`,title:`Hapus kunci API`,children:(0,b.jsx)(m,{className:`h-4 w-4`})})]})]},e.id)})})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/80 bg-card p-5 sm:p-6 shadow-xs space-y-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/60 pb-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(ge,{className:`h-4 w-4 text-emerald-400`}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Riwayat Aktivitas Gateway Terbaru`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Log inferensi yang baru saja melewati pipeline router.`})]})]}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>void e.invalidateQueries({queryKey:[`usage-history`]}),className:`p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded-lg transition-colors`,title:`Refresh log`,children:(0,b.jsx)(ue,{className:`h-3.5 w-3.5`})})]}),Q.length===0?(0,b.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:`Belum ada permintaan yang tercatat hari ini. Coba jalankan uji coba di atas!`}):(0,b.jsx)(`div`,{className:`overflow-x-auto`,children:(0,b.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-border/60 text-muted-foreground font-medium`,children:[(0,b.jsx)(`th`,{className:`pb-2.5 font-medium`,children:`Model`}),(0,b.jsx)(`th`,{className:`pb-2.5 font-medium`,children:`Provider`}),(0,b.jsx)(`th`,{className:`pb-2.5 font-medium`,children:`Token Input / Output`}),(0,b.jsx)(`th`,{className:`pb-2.5 font-medium`,children:`Waktu`}),(0,b.jsx)(`th`,{className:`pb-2.5 font-medium text-right`,children:`Status`})]})}),(0,b.jsx)(`tbody`,{className:`divide-y divide-border/40 font-mono`,children:Q.slice(0,6).map((e,t)=>(0,b.jsxs)(`tr`,{className:`hover:bg-hover/30 transition-colors`,children:[(0,b.jsx)(`td`,{className:`py-2.5 font-semibold text-foreground truncate max-w-[180px]`,children:e.model||`default`}),(0,b.jsx)(`td`,{className:`py-2.5 text-muted-foreground capitalize`,children:e.provider||`auto`}),(0,b.jsxs)(`td`,{className:`py-2.5 text-zinc-300`,children:[e.inputTokens||0,` in / `,e.outputTokens||0,` out`]}),(0,b.jsx)(`td`,{className:`py-2.5 text-muted-foreground text-[11px] font-sans`,children:e.createdAt?new Date(e.createdAt).toLocaleTimeString(`id-ID`):`Baru saja`}),(0,b.jsx)(`td`,{className:`py-2.5 text-right font-sans`,children:(0,b.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-semibold text-emerald-400 border border-emerald-500/20`,children:`200 OK`})})]},e.id||t))})]})})]}),t&&(0,b.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm`,onClick:()=>n(!1),children:(0,b.jsxs)(`div`,{className:`w-full max-w-[460px] overflow-hidden rounded-2xl border border-border bg-card shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/80 px-5 py-3.5 bg-muted/40`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S?`Kunci API Berhasil Dibuat`:`Buat Kunci API Baru`}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`rounded-lg p-1 text-muted-foreground hover:bg-hover hover:text-foreground`,children:(0,b.jsx)(pe,{className:`h-4 w-4`})})]}),(0,b.jsx)(`div`,{className:`p-5`,children:S?(0,b.jsxs)(`div`,{className:`space-y-4`,children:[(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:`Kunci rahasia Anda telah berhasil diterbitkan. Silakan salin sekarang karena kunci lengkap ini tidak akan ditampilkan lagi demi keamanan.`}),(0,b.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-border bg-[#0d0f14] px-3.5 py-2.5`,children:[(0,b.jsx)(`code`,{className:`font-mono text-xs text-primary break-all select-all`,children:S}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>G(S,`modal-created`),className:`ml-2 p-1.5 text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:E===`modal-created`?(0,b.jsx)(c,{className:`h-4 w-4 text-emerald-400`}):(0,b.jsx)(l,{className:`h-4 w-4`})})]}),(0,b.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,b.jsx)(`button`,{type:`button`,onClick:()=>{n(!1),C(null)},className:`rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground hover:bg-primary-light transition-all`,children:`Selesai`})})]}):(0,b.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),Me()},className:`space-y-4`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`label`,{className:`block text-xs font-medium text-foreground mb-1.5`,children:`Nama / Keterangan Kunci`}),(0,b.jsx)(`input`,{type:`text`,placeholder:`Contoh: Claude Code Laptop, Cursor Dev, Production`,value:s,onChange:e=>x(e.target.value),autoFocus:!0,className:`w-full rounded-lg border border-border bg-muted/40 px-3.5 py-2 text-xs text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none`})]}),w&&(0,b.jsx)(`p`,{className:`font-mono text-xs text-danger`,children:w}),(0,b.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`rounded-lg border border-border bg-card px-4 py-2 text-xs font-medium text-foreground hover:bg-hover transition-colors`,children:`Batal`}),(0,b.jsx)(`button`,{type:`submit`,className:`rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground hover:bg-primary-light transition-colors`,children:`Buat Sekarang`})]})]})})]})})]})}var S=x;export{S as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./jsx-runtime-B-hcVAMW.js";var n=e(t(),1),r={query:``,placeholder:`Search...`,visible:!1},i=new Set;function a(){i.forEach(e=>e())}var o={get:()=>r,subscribe:e=>(i.add(e),()=>i.delete(e)),setQuery:e=>{r={...r,query:e},a()},register:(e=`Search...`)=>{r={visible:!0,placeholder:e,query:``},a()},unregister:()=>{r={visible:!1,placeholder:``,query:``},a()}};function s(){return(0,n.useSyncExternalStore)(o.subscribe,o.get,o.get)}export{s as n,o as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]);export{t};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o(((e,t)=>{t.exports=f()}));export{l as a,s as i,d as n,o as r,p as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]);export{t};