@agent-spaces/server 0.3.63 → 0.3.65

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 (334) hide show
  1. package/dist/adapters/claude-code-runtime/index.js +68 -2
  2. package/dist/adapters/claude-code-runtime/message-format.js +27 -1
  3. package/dist/adapters/claude-code-runtime/sdk-config.js +12 -0
  4. package/dist/adapters/git.js +168 -57
  5. package/dist/agents/agent-designer.js +66 -12
  6. package/dist/agents/agent-message-parts.js +1 -1
  7. package/dist/agents/commit-agent.js +4 -2
  8. package/dist/agents/issue-task-controller.js +7 -3
  9. package/dist/app.js +56 -69
  10. package/dist/package.json +1 -1
  11. package/dist/routes/agent-commands.js +72 -0
  12. package/dist/routes/agent-sse.js +7 -0
  13. package/dist/routes/agent.js +18 -1
  14. package/dist/routes/database.js +346 -0
  15. package/dist/routes/git.js +198 -267
  16. package/dist/routes/kanban.js +39 -0
  17. package/dist/routes/robot-account.js +68 -0
  18. package/dist/services/agent-commands.js +168 -0
  19. package/dist/services/agent.js +36 -2
  20. package/dist/services/builtin-tools/command-tools.js +117 -0
  21. package/dist/services/builtin-tools/database-tools.js +578 -0
  22. package/dist/services/builtin-tools/index.js +5 -0
  23. package/dist/services/builtin-tools/input-helpers.js +26 -0
  24. package/dist/services/builtin-tools/issue-tools.js +209 -0
  25. package/dist/services/builtin-tools/kanban-tools.js +281 -0
  26. package/dist/services/database-vector.js +244 -0
  27. package/dist/services/git-operation-log.js +40 -0
  28. package/dist/services/global-wechat-qr.js +72 -0
  29. package/dist/services/hook-engine.js +175 -17
  30. package/dist/services/kanban.js +50 -0
  31. package/dist/services/notification-hub/bot-agent.js +3 -1
  32. package/dist/services/notification-hub/service.js +12 -2
  33. package/dist/services/robot-account.js +34 -0
  34. package/dist/services/workspace.js +2 -0
  35. package/dist/storage/database-store.js +365 -0
  36. package/dist/storage/kanban-store.js +142 -0
  37. package/dist/storage/robot-account-store.js +39 -0
  38. package/dist/web/404.html +1 -1
  39. package/dist/web/__next.__PAGE__.txt +4 -4
  40. package/dist/web/__next._full.txt +24 -31
  41. package/dist/web/__next._head.txt +4 -4
  42. package/dist/web/__next._index.txt +14 -14
  43. package/dist/web/__next._tree.txt +3 -8
  44. package/dist/web/_next/static/chunks/0-a.-hl3wv99k.js +1 -0
  45. package/dist/web/_next/static/chunks/{0ctg5qmw7uu.1.js → 0-pi.67w.ymsr.js} +3 -3
  46. package/dist/web/_next/static/chunks/0-v_p6j5u3_9l.js +1 -0
  47. package/dist/web/_next/static/chunks/0.-x29t-8gk0r.js +1 -0
  48. package/dist/web/_next/static/chunks/0.6b64sy0g5.3.js +3 -0
  49. package/dist/web/_next/static/chunks/0.l5e8~r7_0~p.js +1 -0
  50. package/dist/web/_next/static/chunks/00-syqzi-6zxr.js +1 -0
  51. package/dist/web/_next/static/chunks/{13~y-b.b9rrw4.js → 01~quun6sefgl.js} +1 -1
  52. package/dist/web/_next/static/chunks/02802taez976w.js +67 -0
  53. package/dist/web/_next/static/chunks/02j4sr9psucf-.js +1 -0
  54. package/dist/web/_next/static/chunks/033.awk90g6eh.js +1 -0
  55. package/dist/web/_next/static/chunks/06.kdsa9rr2h1.js +1 -0
  56. package/dist/web/_next/static/chunks/{0-oog4zg4_m~m.css → 062f9zqctzg.b.css} +0 -3
  57. package/dist/web/_next/static/chunks/06si8l0doqe8p.js +1 -0
  58. package/dist/web/_next/static/chunks/08ugbvzr20drp.js +2 -0
  59. package/dist/web/_next/static/chunks/{0kof5qdg8c2-k.js → 08x85faoz58i7.js} +37 -37
  60. package/dist/web/_next/static/chunks/0_cqojbge48kq.js +5 -0
  61. package/dist/web/_next/static/chunks/0_mvduwjsm35w.js +1 -0
  62. package/dist/web/_next/static/chunks/0d6~~lv0-6kex.js +3 -0
  63. package/dist/web/_next/static/chunks/{0ogpc3f3keopc.js → 0db14450oqzhg.js} +2 -2
  64. package/dist/web/_next/static/chunks/0fttswpzu69qx.js +1 -0
  65. package/dist/web/_next/static/chunks/0gdwop9cnpmtu.js +1 -0
  66. package/dist/web/_next/static/chunks/0ghx3j_.-gdyd.js +1 -0
  67. package/dist/web/_next/static/chunks/0j-l7l_k9jt45.js +1 -0
  68. package/dist/web/_next/static/chunks/0k4zdm72k_bfy.js +1 -0
  69. package/dist/web/_next/static/chunks/0kbvoxla7f751.js +1 -0
  70. package/dist/web/_next/static/chunks/{0aa6bcdmtpekn.js → 0l2w0qz1ea7ql.js} +2 -2
  71. package/dist/web/_next/static/chunks/0p3h-h3zj5ujg.js +30 -0
  72. package/dist/web/_next/static/chunks/0paaat8y96ayc.js +7 -0
  73. package/dist/web/_next/static/chunks/0pm-un~-sy3rl.js +1 -0
  74. package/dist/web/_next/static/chunks/0pq318f8xgafg.js +1 -0
  75. package/dist/web/_next/static/chunks/0t6s8of0qr6nc.js +1 -0
  76. package/dist/web/_next/static/chunks/0u6h-hqc_i52e.js +1 -0
  77. package/dist/web/_next/static/chunks/0uxzi~9b~k4mn.js +31 -0
  78. package/dist/web/_next/static/chunks/{002-dxhags4dj.js → 0v6hte2z-32ca.js} +2 -2
  79. package/dist/web/_next/static/chunks/{014x2qbuiszni.js → 0vis~lx0nxgn-.js} +3 -3
  80. package/dist/web/_next/static/chunks/{0y09i51u6ixq5.js → 0w7.tb29958zj.js} +1 -1
  81. package/dist/web/_next/static/chunks/0xbaakj0dfc0..js +1 -0
  82. package/dist/web/_next/static/chunks/0yd.m1afqg.2t.js +3 -0
  83. package/dist/web/_next/static/chunks/0yhbr8hl09b-5.js +1 -0
  84. package/dist/web/_next/static/chunks/0zncg76rgtbm-.js +1 -0
  85. package/dist/web/_next/static/chunks/0z~vqzbm_q371.js +1 -0
  86. package/dist/web/_next/static/chunks/0~~_ltu6dx_ch.js +1 -0
  87. package/dist/web/_next/static/chunks/{02c22g~xd-y30.js → 11cchuwoupmbf.js} +2 -2
  88. package/dist/web/_next/static/chunks/12jm4gwmvq-0q.js +90 -0
  89. package/dist/web/_next/static/chunks/12oxcgyhpaxw~.js +1 -0
  90. package/dist/web/_next/static/chunks/1452eibz62gs6.css +1 -0
  91. package/dist/web/_next/static/chunks/16zlreiems5cn.js +1 -0
  92. package/dist/web/_next/static/chunks/18awqjk9-o5m0.js +1 -0
  93. package/dist/web/_next/static/chunks/18c7g84y01mj0.js +1 -0
  94. package/dist/web/_next/static/chunks/{turbopack-0ndm2zc_pdptk.js → turbopack-11qjwlynmfc-n.js} +1 -1
  95. package/dist/web/_not-found/__next._full.txt +31 -30
  96. package/dist/web/_not-found/__next._head.txt +4 -4
  97. package/dist/web/_not-found/__next._index.txt +14 -14
  98. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  99. package/dist/web/_not-found/__next._not-found.txt +3 -3
  100. package/dist/web/_not-found/__next._tree.txt +3 -3
  101. package/dist/web/_not-found.html +1 -1
  102. package/dist/web/_not-found.txt +31 -30
  103. package/dist/web/index.html +1 -1
  104. package/dist/web/index.txt +24 -31
  105. package/dist/web/login/__next._full.txt +32 -36
  106. package/dist/web/login/__next._head.txt +4 -4
  107. package/dist/web/login/__next._index.txt +14 -14
  108. package/dist/web/login/__next._tree.txt +3 -8
  109. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  110. package/dist/web/login/__next.login.txt +3 -3
  111. package/dist/web/login.html +1 -1
  112. package/dist/web/login.txt +32 -36
  113. package/dist/web/settings/__next._full.txt +34 -38
  114. package/dist/web/settings/__next._head.txt +4 -4
  115. package/dist/web/settings/__next._index.txt +14 -14
  116. package/dist/web/settings/__next._tree.txt +3 -8
  117. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  118. package/dist/web/settings/__next.settings.txt +5 -5
  119. package/dist/web/settings/agents/__next._full.txt +27 -32
  120. package/dist/web/settings/agents/__next._head.txt +4 -4
  121. package/dist/web/settings/agents/__next._index.txt +14 -14
  122. package/dist/web/settings/agents/__next._tree.txt +3 -8
  123. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  124. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  125. package/dist/web/settings/agents/__next.settings.txt +5 -5
  126. package/dist/web/settings/agents.html +1 -1
  127. package/dist/web/settings/agents.txt +27 -32
  128. package/dist/web/settings/mcps/__next._full.txt +27 -32
  129. package/dist/web/settings/mcps/__next._head.txt +4 -4
  130. package/dist/web/settings/mcps/__next._index.txt +14 -14
  131. package/dist/web/settings/mcps/__next._tree.txt +3 -8
  132. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  133. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  134. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  135. package/dist/web/settings/mcps.html +1 -1
  136. package/dist/web/settings/mcps.txt +27 -32
  137. package/dist/web/settings/models/__next._full.txt +27 -32
  138. package/dist/web/settings/models/__next._head.txt +4 -4
  139. package/dist/web/settings/models/__next._index.txt +14 -14
  140. package/dist/web/settings/models/__next._tree.txt +3 -8
  141. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  142. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  143. package/dist/web/settings/models/__next.settings.txt +5 -5
  144. package/dist/web/settings/models.html +1 -1
  145. package/dist/web/settings/models.txt +27 -32
  146. package/dist/web/settings/output-styles/__next._full.txt +27 -32
  147. package/dist/web/settings/output-styles/__next._head.txt +4 -4
  148. package/dist/web/settings/output-styles/__next._index.txt +14 -14
  149. package/dist/web/settings/output-styles/__next._tree.txt +3 -8
  150. package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +4 -4
  151. package/dist/web/settings/output-styles/__next.settings.output-styles.txt +3 -3
  152. package/dist/web/settings/output-styles/__next.settings.txt +5 -5
  153. package/dist/web/settings/output-styles.html +1 -1
  154. package/dist/web/settings/output-styles.txt +27 -32
  155. package/dist/web/settings/prompts/__next._full.txt +27 -32
  156. package/dist/web/settings/prompts/__next._head.txt +4 -4
  157. package/dist/web/settings/prompts/__next._index.txt +14 -14
  158. package/dist/web/settings/prompts/__next._tree.txt +3 -8
  159. package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
  160. package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
  161. package/dist/web/settings/prompts/__next.settings.txt +5 -5
  162. package/dist/web/settings/prompts.html +1 -1
  163. package/dist/web/settings/prompts.txt +27 -32
  164. package/dist/web/settings/providers/__next._full.txt +27 -32
  165. package/dist/web/settings/providers/__next._head.txt +4 -4
  166. package/dist/web/settings/providers/__next._index.txt +14 -14
  167. package/dist/web/settings/providers/__next._tree.txt +3 -8
  168. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  169. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  170. package/dist/web/settings/providers/__next.settings.txt +5 -5
  171. package/dist/web/settings/providers.html +1 -1
  172. package/dist/web/settings/providers.txt +27 -32
  173. package/dist/web/settings/skills/__next._full.txt +27 -32
  174. package/dist/web/settings/skills/__next._head.txt +4 -4
  175. package/dist/web/settings/skills/__next._index.txt +14 -14
  176. package/dist/web/settings/skills/__next._tree.txt +3 -8
  177. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  178. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  179. package/dist/web/settings/skills/__next.settings.txt +5 -5
  180. package/dist/web/settings/skills.html +1 -1
  181. package/dist/web/settings/skills.txt +27 -32
  182. package/dist/web/settings/tools/__next._full.txt +38 -0
  183. package/dist/web/settings/tools/__next._head.txt +6 -0
  184. package/dist/web/settings/tools/__next._index.txt +15 -0
  185. package/dist/web/settings/tools/__next._tree.txt +3 -0
  186. package/dist/web/settings/tools/__next.settings.tools.__PAGE__.txt +9 -0
  187. package/dist/web/settings/tools/__next.settings.tools.txt +5 -0
  188. package/dist/web/settings/tools/__next.settings.txt +7 -0
  189. package/dist/web/settings/tools.html +1 -0
  190. package/dist/web/settings/tools.txt +38 -0
  191. package/dist/web/settings.html +1 -1
  192. package/dist/web/settings.txt +34 -38
  193. package/dist/web/workflows/__next._full.txt +32 -38
  194. package/dist/web/workflows/__next._head.txt +4 -4
  195. package/dist/web/workflows/__next._index.txt +14 -14
  196. package/dist/web/workflows/__next._tree.txt +3 -8
  197. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  198. package/dist/web/workflows/__next.workflows.txt +3 -3
  199. package/dist/web/workflows.html +1 -1
  200. package/dist/web/workflows.txt +32 -38
  201. package/dist/web/workspace/_/__next._full.txt +31 -36
  202. package/dist/web/workspace/_/__next._head.txt +4 -4
  203. package/dist/web/workspace/_/__next._index.txt +14 -14
  204. package/dist/web/workspace/_/__next._tree.txt +4 -8
  205. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
  206. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  207. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  208. package/dist/web/workspace/_.html +1 -1
  209. package/dist/web/workspace/_.txt +31 -36
  210. package/dist/web/workspaces/__next._full.txt +30 -37
  211. package/dist/web/workspaces/__next._head.txt +4 -4
  212. package/dist/web/workspaces/__next._index.txt +14 -14
  213. package/dist/web/workspaces/__next._tree.txt +3 -8
  214. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  215. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  216. package/dist/web/workspaces.html +1 -1
  217. package/dist/web/workspaces.txt +30 -37
  218. package/dist/ws/agent-prompt.js +45 -8
  219. package/dist/ws/agent-runner.js +88 -10
  220. package/package.json +1 -1
  221. package/dist/web/_next/static/chunks/0-1bfvfwifh-m.js +0 -1
  222. package/dist/web/_next/static/chunks/02mf61htij8g0.js +0 -31
  223. package/dist/web/_next/static/chunks/046me66nilkff.js +0 -1
  224. package/dist/web/_next/static/chunks/04v-pqqs-2lvp.css +0 -1
  225. package/dist/web/_next/static/chunks/06w~.izyfylap.js +0 -1
  226. package/dist/web/_next/static/chunks/09t62a89~jesc.js +0 -3
  227. package/dist/web/_next/static/chunks/09y_3krccdd~u.js +0 -1
  228. package/dist/web/_next/static/chunks/0_e~hmntdfop9.js +0 -1
  229. package/dist/web/_next/static/chunks/0_udc.6.tueey.js +0 -1
  230. package/dist/web/_next/static/chunks/0cke33d38fnby.js +0 -90
  231. package/dist/web/_next/static/chunks/0cyq~8xb~r5fc.js +0 -1
  232. package/dist/web/_next/static/chunks/0ewceguykiut5.js +0 -1
  233. package/dist/web/_next/static/chunks/0fxa1edqr7dve.js +0 -1
  234. package/dist/web/_next/static/chunks/0hra80eyuu37u.js +0 -1
  235. package/dist/web/_next/static/chunks/0ie7y4k2ncvnn.js +0 -1
  236. package/dist/web/_next/static/chunks/0igc~uli58ncw.js +0 -2
  237. package/dist/web/_next/static/chunks/0msb2mi3hiu5_.js +0 -67
  238. package/dist/web/_next/static/chunks/0p1n8bvfnpl41.js +0 -1
  239. package/dist/web/_next/static/chunks/0ppr271hz0xoq.js +0 -1
  240. package/dist/web/_next/static/chunks/0s_dva~eh2yhi.js +0 -3
  241. package/dist/web/_next/static/chunks/0typj55ox8d5i.js +0 -1
  242. package/dist/web/_next/static/chunks/0w2p4ldi2aymp.js +0 -1
  243. package/dist/web/_next/static/chunks/0zc0xgp5ourcn.js +0 -1
  244. package/dist/web/_next/static/chunks/0zmhdridea1s5.js +0 -90
  245. package/dist/web/_next/static/chunks/10.alq.6stmld.js +0 -1
  246. package/dist/web/_next/static/chunks/11b3zgk1etlkw.js +0 -7
  247. package/dist/web/_next/static/chunks/11qp8r5dotf7d.js +0 -1
  248. package/dist/web/_next/static/chunks/12mxlicp247c8.js +0 -1
  249. package/dist/web/_next/static/chunks/135w27dd8c19s.js +0 -5
  250. package/dist/web/_next/static/chunks/176dc-dtokxxi.js +0 -16
  251. package/dist/web/_next/static/chunks/17g-0pqre.anw.js +0 -1
  252. package/dist/web/_next/static/media/0a7740363b4d4863-s.1110aazvokzp..woff2 +0 -0
  253. package/dist/web/_next/static/media/0da9c7f357bd9d4d-s.0ek5sshv8wk3m.woff2 +0 -0
  254. package/dist/web/_next/static/media/1b99372b3eaef0c8-s.p.0gx2haw2tmll8.woff2 +0 -0
  255. package/dist/web/_next/static/media/41e95f694c5c4549-s.0r1jrq7neqdsq.woff2 +0 -0
  256. package/dist/web/_next/static/media/5c285b27cdda1fe8-s.p.0yo6-5yoeeudq.woff2 +0 -0
  257. package/dist/web/_next/static/media/5f9d24ebef5d5292-s.0esuu2f5si~v8.woff2 +0 -0
  258. package/dist/web/_next/static/media/6c55a692938ebbbc-s.0g6rbszwfgn9y.woff2 +0 -0
  259. package/dist/web/_next/static/media/8e6fa89aa22d24ec-s.p.0uvzar8hswo3p.woff2 +0 -0
  260. package/dist/web/_next/static/media/a218039a3287bcfd-s.p.17-1enzs_j91b.woff2 +0 -0
  261. package/dist/web/_next/static/media/b2ea385cb5ae8625-s.0kjod.kaq1k69.woff2 +0 -0
  262. package/dist/web/_next/static/media/bdc7e24a509eb931-s.0apt5mko2.qn3.woff2 +0 -0
  263. package/dist/web/_next/static/media/c3cb240f9c892514-s.163v2i5cux7-c.woff2 +0 -0
  264. package/dist/web/_next/static/media/e2334d715941921e-s.p.12skym0rqknxy.woff2 +0 -0
  265. package/public/output-styles/carmack-mode.md +0 -381
  266. package/public/output-styles/codex-rigor-mode.md +0 -114
  267. package/public/output-styles/dhh-mode.md +0 -265
  268. package/public/output-styles/evan-you-mode.md +0 -539
  269. package/public/output-styles/index.json +0 -37
  270. package/public/output-styles/jobs-mode.md +0 -369
  271. package/public/output-styles/linus-mode.md +0 -135
  272. package/public/output-styles/uncle-bob-mode.md +0 -221
  273. package/public/prompt/andrej-karpathy-skills.md +0 -65
  274. package/public/prompt/claude-token-efficient-coding.md +0 -35
  275. package/public/prompt/index.json +0 -12
  276. package/public/skills/index.json +0 -92
  277. package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +0 -243
  278. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +0 -44
  279. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +0 -46
  280. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +0 -124
  281. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +0 -124
  282. package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +0 -438
  283. package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +0 -29
  284. package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +0 -40
  285. package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +0 -58
  286. package/public/skills/superpowers/brainstorming/SKILL.md +0 -164
  287. package/public/skills/superpowers/brainstorming/scripts/frame-template.html +0 -214
  288. package/public/skills/superpowers/brainstorming/scripts/helper.js +0 -88
  289. package/public/skills/superpowers/brainstorming/scripts/server.cjs +0 -354
  290. package/public/skills/superpowers/brainstorming/scripts/start-server.sh +0 -148
  291. package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +0 -56
  292. package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +0 -49
  293. package/public/skills/superpowers/brainstorming/visual-companion.md +0 -287
  294. package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +0 -182
  295. package/public/skills/superpowers/executing-plans/SKILL.md +0 -70
  296. package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +0 -251
  297. package/public/skills/superpowers/receiving-code-review/SKILL.md +0 -213
  298. package/public/skills/superpowers/requesting-code-review/SKILL.md +0 -103
  299. package/public/skills/superpowers/requesting-code-review/code-reviewer.md +0 -168
  300. package/public/skills/superpowers/subagent-driven-development/SKILL.md +0 -279
  301. package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +0 -25
  302. package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +0 -113
  303. package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +0 -61
  304. package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +0 -119
  305. package/public/skills/superpowers/systematic-debugging/SKILL.md +0 -296
  306. package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +0 -158
  307. package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +0 -115
  308. package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +0 -122
  309. package/public/skills/superpowers/systematic-debugging/find-polluter.sh +0 -63
  310. package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +0 -169
  311. package/public/skills/superpowers/systematic-debugging/test-academic.md +0 -14
  312. package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +0 -58
  313. package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +0 -68
  314. package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +0 -69
  315. package/public/skills/superpowers/test-driven-development/SKILL.md +0 -371
  316. package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +0 -299
  317. package/public/skills/superpowers/using-git-worktrees/SKILL.md +0 -215
  318. package/public/skills/superpowers/using-superpowers/SKILL.md +0 -117
  319. package/public/skills/superpowers/using-superpowers/references/codex-tools.md +0 -59
  320. package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +0 -42
  321. package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +0 -51
  322. package/public/skills/superpowers/verification-before-completion/SKILL.md +0 -139
  323. package/public/skills/superpowers/writing-plans/SKILL.md +0 -152
  324. package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +0 -49
  325. package/public/skills/superpowers/writing-skills/SKILL.md +0 -655
  326. package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +0 -1150
  327. package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  328. package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +0 -172
  329. package/public/skills/superpowers/writing-skills/persuasion-principles.md +0 -187
  330. package/public/skills/superpowers/writing-skills/render-graphs.js +0 -168
  331. package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +0 -384
  332. /package/dist/web/_next/static/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_buildManifest.js +0 -0
  333. /package/dist/web/_next/static/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_clientMiddlewareManifest.js +0 -0
  334. /package/dist/web/_next/static/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_ssgManifest.js +0 -0
@@ -1,5 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,177053,e=>{"use strict";var t=e.i(344180),n=e.i(523592);{let e=window.fetch,t="__api_patched__";window[t]||(window[t]=!0,window.fetch=function(t,r){if("string"==typeof t&&t.startsWith("/api/")){let e=(0,n.getActiveServerUrl)();e&&(t=`${e}${t}`)}return e.call(window,t,r)})}var r=e.i(764556),a=e.i(799543),i=e.i(437122),s=e.i(233297),o=e.i(286117);e.s(["AuthGuard",0,function({children:e}){let n=(0,a.usePathname)(),l=(0,a.useRouter)(),[c,d]=(0,r.useState)(!1),u=(0,o.isLoginPath)(n);return((0,r.useEffect)(()=>{if(u)return void d(!0);if(!(0,i.isAuthenticated)())return void(0,s.tauriNavigate)(l,"/login",!0);let e=(0,i.getToken)();fetch("/api/auth/check",{headers:null!==e?{Authorization:`Bearer ${e}`}:{}}).then(e=>401===e.status||403===e.status?((0,i.removeToken)(),(0,s.tauriNavigate)(l,"/login",!0),null):e.ok?e.json():{authenticated:!0}).then(e=>{null!==e&&(e.authenticated?d(!0):((0,i.removeToken)(),(0,s.tauriNavigate)(l,"/login",!0)))}).catch(()=>d(!0))},[u,l]),u||c)?(0,t.jsx)(t.Fragment,{children:e}):null}],177053)},640376,e=>{"use strict";let t=(0,e.i(816709).create)((e,t)=>({open:!1,commands:[],setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open})),register:n=>(e(e=>e.commands.some(e=>e.id===n.id)?e:{commands:[...e.commands,n]}),()=>t().unregister(n.id)),registerMany:t=>{let n=new Set(t.map(e=>e.id));return e(e=>({commands:[...e.commands.filter(e=>!n.has(e.id)),...t]})),()=>e(e=>({commands:e.commands.filter(e=>!n.has(e.id))}))},unregister:t=>e(e=>({commands:e.commands.filter(e=>e.id!==t)}))}));e.s(["useCommandPalette",0,t])},478189,(e,t,n)=>{"use strict";t.exports="/__open-stack-frame-in-editor"},994876,e=>{"use strict";var t=e.i(344180),n=e.i(799543),r=e.i(764556),a=e.i(370383),i=e.i(928542),s=e.i(294237),o=e.i(564822),l=e.i(465458),c=e.i(260218),d=e.i(681622);e.i(362962);var u=e.i(14452);e.i(613087);var m=e.i(638322),f=e.i(433721);let p=(0,f.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),h="sidebar_state",g=r.createContext(null);function v(){let e=r.useContext(g);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function x({defaultOpen:e=!0,open:n,onOpenChange:a,className:i,style:s,children:c,...d}){let u=(0,o.useIsMobile)(),[m,f]=r.useState(!1),[p,v]=r.useState(e),b=n??p;r.useEffect(()=>{if(void 0!==n)return;let e=document.cookie.match(RegExp(`(?:^|; )${h}=([^;]*)`));e&&v("true"===e[1])},[n]);let w=r.useCallback(e=>{let t="function"==typeof e?e(b):e;a?a(t):v(t),document.cookie=`${h}=${t}; path=/; max-age=604800`},[a,b]),y=r.useCallback(()=>u?f(e=>!e):w(e=>!e),[u,w,f]);r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y]);let j=b||u&&m?"expanded":"collapsed",k=r.useMemo(()=>({state:j,open:b,setOpen:w,isMobile:u,openMobile:m,setOpenMobile:f,toggleSidebar:y}),[j,b,w,u,m,f,y]);return(0,t.jsx)(g.Provider,{value:k,children:(0,t.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...s},className:(0,l.cn)("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",i),...d,children:c})})}function b({side:e="left",variant:n="sidebar",collapsible:r="offcanvas",className:a,children:i,dir:s,...o}){let{isMobile:c,state:d,openMobile:m,setOpenMobile:f}=v();return"none"===r?(0,t.jsx)("div",{"data-slot":"sidebar",className:(0,l.cn)("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...o,children:i}):c?(0,t.jsx)(u.Sheet,{open:m,onOpenChange:f,...o,children:(0,t.jsxs)(u.SheetContent,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,t.jsxs)(u.SheetHeader,{className:"sr-only",children:[(0,t.jsx)(u.SheetTitle,{children:"Sidebar"}),(0,t.jsx)(u.SheetDescription,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,t.jsxs)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":"collapsed"===d?r:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[(0,t.jsx)("div",{"data-slot":"sidebar-gap",className:(0,l.cn)("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===n||"inset"===n?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,t.jsx)("div",{"data-slot":"sidebar-container","data-side":e,className:(0,l.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex","floating"===n||"inset"===n?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...o,children:(0,t.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col overflow-hidden group-data-[variant=floating]:rounded-xl group-data-[variant=floating]:bg-transparent",children:i})})]})}function w({className:e,onClick:n,...r}){let{toggleSidebar:a}=v();return(0,t.jsxs)(c.Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:(0,l.cn)(e),onClick:e=>{n?.(e),a()},...r,children:[(0,t.jsx)(p,{}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function y({className:e,...n}){return(0,t.jsx)("main",{"data-slot":"sidebar-inset",className:(0,l.cn)("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...n})}function j({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,l.cn)("flex flex-col gap-2 p-2 shrink-0",e),...n})}function k({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,l.cn)("flex flex-col gap-2 p-2 shrink-0",e),...n})}function N({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,l.cn)("flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function S({className:e,...n}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,l.cn)("flex w-full min-w-0 flex-col gap-0",e),...n})}function C({className:e,...n}){return(0,t.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,l.cn)("group/menu-item relative",e),...n})}let E=(0,s.cva)("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function D({render:e,isActive:n=!1,variant:r="default",size:s="default",tooltip:o,className:c,...d}){let{isMobile:u,state:f}=v(),p=(0,i.useRender)({defaultTagName:"button",props:(0,a.mergeProps)({className:(0,l.cn)(E({variant:r,size:s}),c)},d),render:o?(0,t.jsx)(m.TooltipTrigger,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:s,active:n}});return o?("string"==typeof o&&(o={children:o}),(0,t.jsxs)(m.Tooltip,{children:[p,(0,t.jsx)(m.TooltipContent,{side:"right",align:"center",hidden:"collapsed"!==f||u,...o})]})):p}function M({className:e,...n}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:(0,l.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...n})}function I({render:e,size:t="md",isActive:n=!1,className:r,...s}){return(0,i.useRender)({defaultTagName:"a",props:(0,a.mergeProps)({className:(0,l.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",r)},s),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}var P=e.i(244073),T=e.i(233297),A=e.i(341807),R=e.i(411649),L=e.i(451534);let O=(0,f.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var z=e.i(325443),_=e.i(990336),W=e.i(100559),F=e.i(962562),$=e.i(137340),B=e.i(244644),H=e.i(327962),U=e.i(415360),K=e.i(426022),V=e.i(191202);let q=(0,f.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var X=e.i(227634),Y=e.i(592039),G=e.i(164202),J=e.i(324216),Z=e.i(588591),Q=e.i(86477),ee=e.i(549705),et=e.i(238300),en=e.i(625873),er=e.i(756638),ea=e.i(841734),ei=e.i(22906),es=e.i(887836),eo=e.i(209988),el=e.i(191118),ec=e.i(226624),ed=e.i(917955),eu=e.i(188815),em=e.i(129981),ef=e.i(953700),ep=e.i(111343),eh=e.i(401058);let eg=(0,f.default)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);var ev=e.i(816709),ex=e.i(437122);let eb=(0,ev.create)(e=>({hooks:[],selectedName:null,loading:!1,fetchHooks:async t=>{e({loading:!0});try{let n=await (0,ex.fetchWithAuth)(`/api/workspaces/${t}/hooks`),r=await n.json();e({hooks:r,loading:!1})}catch{e({loading:!1})}},createHook:async(t,n)=>{let r={name:n,enabled:!0,hooks:{PreToolUse:[],PostToolUse:[]}};await (0,ex.fetchWithAuth)(`/api/workspaces/${t}/hooks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),e(e=>({hooks:[...e.hooks,r],selectedName:n}))},updateHook:async(t,n,r)=>{await (0,ex.fetchWithAuth)(`/api/workspaces/${t}/hooks/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),e(e=>({hooks:e.hooks.map(e=>e.name===n?r:e)}))},deleteHook:async(t,n)=>{await (0,ex.fetchWithAuth)(`/api/workspaces/${t}/hooks/${n}`,{method:"DELETE"}),e(e=>({hooks:e.hooks.filter(e=>e.name!==n),selectedName:e.selectedName===n?null:e.selectedName}))},uploadHook:async(t,n)=>{let r=await (0,ex.fetchWithAuth)(`/api/workspaces/${t}/hooks/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})}),a=await r.json();e(e=>({hooks:[...e.hooks,a],selectedName:a.name}))},applyToWorkspace:async(e,t,n)=>{await (0,ex.fetchWithAuth)(`/api/workspaces/${e}/hooks/${t}/apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetWorkspaceId:n})})},setSelectedName:t=>e({selectedName:t}),reset:()=>e({hooks:[],selectedName:null,loading:!1})}));var ew=e.i(361031);e.i(462506);let ey=(0,es.default)(()=>e.A(863812).then(e=>e.default),{loadableGenerated:{modules:[158480]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading editor..."})});function ej({open:e,onOpenChange:n,standalone:a}){(0,P.useTranslations)();let{hooks:i,selectedName:s,loading:o,fetchHooks:u,createHook:m,updateHook:f,deleteHook:p,uploadHook:h,applyToWorkspace:g,setSelectedName:v}=eb(),{workspaces:x}=(0,ew.useWorkspaceStore)(),b=x[0]?.id,[w,y]=(0,r.useState)(""),[j,k]=(0,r.useState)(""),[N,S]=(0,r.useState)(!1),[C,E]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&b&&u(b)},[e,b,u]);let I=i.find(e=>e.name===s);(0,r.useEffect)(()=>{I?(y(JSON.stringify(I,null,2)),M(!1)):y("")},[I]);let T=(0,r.useCallback)(async()=>{if(b&&s)try{let e=JSON.parse(w);await f(b,s,e),M(!1)}catch(e){console.error("Invalid JSON:",e instanceof Error?e.message:String(e))}},[b,s,w,f]),A=(0,r.useCallback)(async()=>{b&&j.trim()&&(await m(b,j.trim()),k(""),S(!1))},[b,j,m]),R=(0,r.useCallback)(async()=>{b&&s&&await p(b,s)},[b,s,p]),L=(0,r.useCallback)(()=>{let e=document.createElement("input");e.type="file",e.accept=".json",e.onchange=async e=>{let t=e.target.files?.[0];if(!t||!b)return;let n=await t.text();await h(b,n)},e.click()},[b,h]),O=(0,r.useCallback)(async e=>{b&&s&&(await g(b,s,e),E(!1))},[b,s,g]),z=(0,r.useCallback)(async(e,t)=>{if(!b)return;let n=i.find(t=>t.name===e);n&&await f(b,e,{...n,enabled:t})},[b,i,f]),_=(0,t.jsxs)("div",{className:"flex h-[500px]",children:[(0,t.jsxs)("div",{className:"w-52 border-r flex flex-col",children:[(0,t.jsxs)("div",{className:"p-2 border-b flex gap-1",children:[(0,t.jsx)(c.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>S(!0),children:(0,t.jsx)(ef.Plus,{className:"size-3.5"})}),(0,t.jsx)(c.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:L,children:(0,t.jsx)(em.Upload,{className:"size-3.5"})})]}),N&&(0,t.jsxs)("div",{className:"p-2 border-b flex gap-1",children:[(0,t.jsx)(d.Input,{value:j,onChange:e=>k(e.target.value),placeholder:"hook name",className:"h-7 text-xs",onKeyDown:e=>"Enter"===e.key&&A(),autoFocus:!0}),(0,t.jsx)(c.Button,{size:"sm",className:"h-7 text-xs",onClick:A,children:"OK"})]}),(0,t.jsx)(el.ScrollArea,{className:"flex-1",children:o?(0,t.jsx)("div",{className:"p-3 text-xs text-muted-foreground",children:"Loading..."}):0===i.length?(0,t.jsx)("div",{className:"p-3 text-xs text-muted-foreground",children:"No hooks"}):i.map(e=>(0,t.jsxs)("div",{className:(0,l.cn)("flex items-center gap-2 px-3 py-1.5 cursor-pointer text-xs hover:bg-accent",s===e.name&&"bg-accent"),onClick:()=>v(e.name),children:[(0,t.jsx)(ec.Switch,{checked:e.enabled,onCheckedChange:t=>z(e.name,t),className:"scale-75",onClick:e=>e.stopPropagation()}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.name})]},e.name))})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 border-b",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:I.name}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsxs)(c.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs gap-1",onClick:()=>E(!0),children:[(0,t.jsx)(eg,{className:"size-3"}),"Apply"]}),(0,t.jsxs)(c.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs gap-1",onClick:T,disabled:!D,children:[(0,t.jsx)(ep.Save,{className:"size-3"}),"Save"]}),(0,t.jsxs)(ed.DropdownMenu,{children:[(0,t.jsx)(ed.DropdownMenuTrigger,{children:(0,t.jsx)(c.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",children:(0,t.jsx)(eh.MoreVertical,{className:"size-3"})})}),(0,t.jsx)(ed.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(ed.DropdownMenuItem,{className:"text-destructive text-xs",onClick:R,children:[(0,t.jsx)($.Trash2,{className:"size-3 mr-1"})," Delete"]})})]})]})]}),C&&(0,t.jsxs)("div",{className:"px-3 py-2 border-b bg-muted/50",children:[(0,t.jsx)("div",{className:"text-xs mb-1",children:"Apply to workspace:"}),(0,t.jsx)(eu.SearchSelect,{options:x.filter(e=>e.id!==b).map(e=>({value:e.id,label:e.name})),value:"",onChange:O,placeholder:"Select workspace..."})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(ey,{height:"100%",language:"json",theme:"vs-dark",value:w,onChange:e=>{y(e||""),M(!0)},options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on"}})})]}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a hook to edit"})})]});return a?_:(0,t.jsx)(eo.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(eo.DialogContent,{className:"!max-w-[80vw] p-0 overflow-hidden",children:[(0,t.jsxs)(eo.DialogHeader,{className:"px-4 pt-4",children:[(0,t.jsx)(eo.DialogTitle,{children:"Hooks"}),(0,t.jsx)(eo.DialogDescription,{children:"Manage per-tool-call hooks for this workspace"})]}),_]})})}var ek=e.i(256186),eN=e.i(996652),eS=e.i(650654),eC=e.i(249673),eE=e.i(315775),eD=e.i(267624);function eM({routes:e}){let{state:a,isMobile:i,setOpenMobile:s}=v(),o="collapsed"===a,[c,d]=(0,r.useState)(new Set),u=(0,n.useRouter)(),m=(0,P.useTranslations)("common"),f=e=>{i&&s(!1),(0,T.tauriNavigate)(u,e)};return(0,t.jsx)(S,{children:e.map(e=>{let n=!o&&c.has(e.id),r=!!e.subs?.length,a=r||!!e.onAdd;return(0,t.jsx)(C,{children:a?o?(0,t.jsxs)(eN.Popover,{children:[(0,t.jsx)(eN.PopoverTrigger,{render:(0,t.jsx)(D,{className:"justify-center text-muted-foreground hover:bg-sidebar-muted hover:text-foreground",tooltip:e.title}),children:e.icon}),(0,t.jsxs)(eN.PopoverContent,{side:"right",sideOffset:8,className:"w-56 p-1.5",children:[(0,t.jsx)("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground mb-1",children:e.title}),e.subs?.map(n=>(0,t.jsxs)("div",{className:"group/sub relative flex items-center",children:[n.onClick?(0,t.jsxs)("button",{type:"button",onClick:n.onClick,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[n.icon,n.title]}):(0,t.jsxs)("button",{type:"button",onClick:()=>f(n.link),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[n.icon,n.title]}),n.menuItems&&n.menuItems.length>0&&(0,t.jsxs)(ed.DropdownMenu,{children:[(0,t.jsx)(ed.DropdownMenuTrigger,{className:"absolute right-1 flex items-center justify-center rounded-md p-0.5 opacity-0 group-hover/sub:opacity-100 hover:bg-accent transition-opacity cursor-pointer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(eE.MoreHorizontal,{className:"size-3.5 text-muted-foreground"})}),(0,t.jsx)(ed.DropdownMenuContent,{align:"end",side:"right",children:n.menuItems.map(e=>(0,t.jsxs)(ed.DropdownMenuItem,{variant:e.variant,onClick:e.onClick,children:[e.icon,e.label]},e.label))})]})]},`${e.id}-${n.title}`)),e.onAdd&&(0,t.jsxs)("button",{type:"button",onClick:e.onAdd,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground mt-0.5",children:[(0,t.jsx)(ef.Plus,{className:"size-3.5"}),e.addLabel??m("add")]}),e.manageLink&&(0,t.jsxs)("button",{type:"button",onClick:()=>f(e.manageLink),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground mt-0.5",children:[(0,t.jsx)(eD.LayoutGrid,{className:"size-3.5"}),m("manage")]})]})]}):(0,t.jsxs)(ek.Collapsible,{open:n,onOpenChange:t=>d(n=>{let r=new Set(n);return t?r.add(e.id):r.delete(e.id),r}),className:"w-full",children:[(0,t.jsxs)(ek.CollapsibleTrigger,{render:(0,t.jsx)(D,{className:(0,l.cn)("group/hdr flex flex-1 items-center rounded-lg px-2 transition-colors",n?"bg-sidebar-muted text-foreground":"text-muted-foreground hover:bg-sidebar-muted hover:text-foreground")}),children:[e.icon,(0,t.jsx)("span",{className:"ml-2 flex-1 text-sm font-medium",children:e.title}),r&&(0,t.jsx)("span",{children:n?(0,t.jsx)(eC.ChevronUp,{className:"size-4"}):(0,t.jsx)(eS.ChevronDown,{className:"size-4"})})]}),(0,t.jsx)(ek.CollapsibleContent,{children:(0,t.jsxs)(M,{className:"my-1 ml-3.5",children:[e.subs?.map(n=>(0,t.jsx)(C,{className:"h-auto",children:(0,t.jsxs)("div",{className:"group/sub relative flex items-center",children:[(0,t.jsx)(I,{render:n.onClick?(0,t.jsx)("button",{type:"button",onClick:n.onClick,className:"flex w-full items-center rounded-md px-4 py-1.5 text-sm font-medium text-muted-foreground hover:bg-sidebar-muted hover:text-foreground"}):(0,t.jsx)("button",{type:"button",onClick:()=>f(n.link),className:"flex w-full items-center rounded-md px-4 py-1.5 text-sm font-medium text-muted-foreground hover:bg-sidebar-muted hover:text-foreground"}),children:n.title}),n.menuItems&&n.menuItems.length>0&&(0,t.jsxs)(ed.DropdownMenu,{children:[(0,t.jsx)(ed.DropdownMenuTrigger,{className:"absolute right-1 flex items-center justify-center rounded-md p-0.5 opacity-0 group-hover/sub:opacity-100 hover:bg-sidebar-muted transition-opacity cursor-pointer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(eE.MoreHorizontal,{className:"size-3.5 text-muted-foreground"})}),(0,t.jsx)(ed.DropdownMenuContent,{align:"end",side:"right",children:n.menuItems.map(e=>(0,t.jsxs)(ed.DropdownMenuItem,{variant:e.variant,onClick:e.onClick,children:[e.icon,e.label]},e.label))})]})]})},`${e.id}-${n.title}`)),e.onAdd&&(0,t.jsx)(C,{children:(0,t.jsxs)("button",{type:"button",onClick:e.onAdd,className:"flex w-full items-center gap-2 rounded-md px-4 py-1.5 text-sm font-medium text-muted-foreground hover:bg-sidebar-muted hover:text-foreground",children:[(0,t.jsx)(ef.Plus,{className:"size-3.5"}),e.addLabel??m("add")]})}),e.manageLink&&(0,t.jsx)(C,{children:(0,t.jsxs)("button",{type:"button",onClick:()=>f(e.manageLink),className:"flex w-full items-center gap-2 rounded-md px-4 py-1.5 text-sm font-medium text-muted-foreground hover:bg-sidebar-muted hover:text-foreground",children:[(0,t.jsx)(eD.LayoutGrid,{className:"size-3.5"}),m("manage")]})})]})})]}):(0,t.jsxs)(D,{tooltip:e.title,render:(0,t.jsx)("button",{type:"button",onClick:()=>f(e.link),className:(0,l.cn)("flex items-center rounded-lg px-2 transition-colors text-muted-foreground hover:bg-sidebar-muted hover:text-foreground",o&&"justify-center")}),children:[e.icon,!o&&(0,t.jsx)("span",{className:"ml-2 text-sm font-medium",children:e.title})]})},e.id)})})}var eI=e.i(36539),eI=eI,eP=e.i(875350),eT=e.i(506037),eA=e.i(487122),eR=e.i(238153),eL=e.i(492421),eO=e.i(632713),ez=e.i(539392),e_=e.i(516467);function eW(e,t){let n=(0,e_.toDate)(e)-(0,e_.toDate)(t);return n<0?-1:n>0?1:n}var eF=e.i(511518),e$=e.i(731285),eB=e.i(936765);function eH(e,t){return function(e,t,n){var r;let a,i=(0,eL.getDefaultOptions)(),s=n?.locale??i.locale??eR.defaultLocale,o=eW(e,t);if(isNaN(o))throw RangeError("Invalid time value");let l=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[c,d]=(0,ez.normalizeDates)(n?.in,...o>0?[t,e]:[e,t]),u=(r=void 0,e=>{let t=(r?Math[r]:Math.trunc)(e);return 0===t?0:t})(((0,e_.toDate)(d)-(0,e_.toDate)(c))/1e3),m=Math.round((u-((0,eO.getTimezoneOffsetInMilliseconds)(d)-(0,eO.getTimezoneOffsetInMilliseconds)(c))/1e3)/60);if(m<2)if(n?.includeSeconds)if(u<5)return s.formatDistance("lessThanXSeconds",5,l);else if(u<10)return s.formatDistance("lessThanXSeconds",10,l);else if(u<20)return s.formatDistance("lessThanXSeconds",20,l);else if(u<40)return s.formatDistance("halfAMinute",0,l);else if(u<60)return s.formatDistance("lessThanXMinutes",1,l);else return s.formatDistance("xMinutes",1,l);else if(0===m)return s.formatDistance("lessThanXMinutes",1,l);else return s.formatDistance("xMinutes",m,l);if(m<45)return s.formatDistance("xMinutes",m,l);if(m<90)return s.formatDistance("aboutXHours",1,l);if(m<eF.minutesInDay){let e=Math.round(m/60);return s.formatDistance("aboutXHours",e,l)}if(m<2520)return s.formatDistance("xDays",1,l);else if(m<eF.minutesInMonth){let e=Math.round(m/eF.minutesInDay);return s.formatDistance("xDays",e,l)}else if(m<2*eF.minutesInMonth)return a=Math.round(m/eF.minutesInMonth),s.formatDistance("aboutXMonths",a,l);if((a=function(e,t){var n;let r,a,[i,s,o]=(0,ez.normalizeDates)(void 0,e,e,t),l=eW(s,o),c=Math.abs((0,e$.differenceInCalendarMonths)(s,o));if(c<1)return 0;1===s.getMonth()&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-l*c);let d=eW(s,o)===-l;+(r=(0,e_.toDate)(i,void 0),n=void 0,(a=(0,e_.toDate)(r,n?.in)).setHours(23,59,59,999),a)==+(0,eB.endOfMonth)(r,void 0)&&1===c&&1===eW(i,o)&&(d=!1);let u=l*(c-d);return 0===u?0:u}(d,c))<12){let e=Math.round(m/eF.minutesInMonth);return s.formatDistance("xMonths",e,l)}{let e=a%12,t=Math.trunc(a/12);return e<3?s.formatDistance("aboutXYears",t,l):e<9?s.formatDistance("overXYears",t,l):s.formatDistance("almostXYears",t+1,l)}}(e,(0,eA.constructFrom)(e,Date.now()),t)}let eU=(0,f.default)("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),eK={issue_completed:"✓",issue_failed:"✕",task_completed:"✓",task_failed:"✕"},eV={issue_completed:"text-green-600 bg-green-100 dark:bg-green-900/30 dark:text-green-400",issue_failed:"text-red-600 bg-red-100 dark:bg-red-900/30 dark:text-red-400",task_completed:"text-green-600 bg-green-100 dark:bg-green-900/30 dark:text-green-400",task_failed:"text-red-600 bg-red-100 dark:bg-red-900/30 dark:text-red-400"};function eq({open:e,onOpenChange:n,workspaceId:a,initialNotification:i}){let s=(0,P.useTranslations)("sidebar.notifications"),o=(0,eT.useNotificationStore)(e=>e.notifications),d=(0,eT.useNotificationStore)(e=>e.markRead),u=(0,eT.useNotificationStore)(e=>e.markAllRead),m=(0,eT.useNotificationStore)(e=>e.clearAll),[f,p]=(0,r.useState)(null),h=i&&!f?i:f;return(0,t.jsx)(eo.Dialog,{open:e,onOpenChange:e=>{e||p(null),n(e)},children:(0,t.jsxs)(eo.DialogContent,{className:"sm:max-w-lg max-h-[80vh] flex flex-col gap-0 overflow-hidden p-0",children:[(0,t.jsx)(eo.DialogHeader,{className:"px-6 py-4 border-b shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eo.DialogTitle,{children:s("centerTitle")}),o.some(e=>!e.read)&&(0,t.jsx)("span",{className:"inline-flex items-center justify-center size-5 rounded-full bg-blue-500 text-[10px] font-medium text-white",children:o.filter(e=>!e.read).length})]}),o.some(e=>!e.read)&&(0,t.jsxs)(c.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>u(a),children:[(0,t.jsx)(eU,{className:"size-3.5"}),s("markAllRead")]})]})}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h?(0,t.jsxs)("div",{className:"px-6 py-4",children:[(0,t.jsxs)("div",{className:(0,l.cn)("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium mb-3",eV[h.type]??""),children:[eK[h.type]??""," ",h.type]}),(0,t.jsx)("h3",{className:"text-lg font-semibold mb-2",children:h.title}),h.description&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:h.description}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eH(new Date(h.createdAt),{addSuffix:!0})}),Object.keys(h.data).length>0&&(0,t.jsx)("pre",{className:"mt-3 text-xs bg-muted rounded p-3 overflow-auto",children:JSON.stringify(h.data,null,2)})]}):0===o.length?(0,t.jsx)("div",{className:"px-6 py-12 text-center text-sm text-muted-foreground",children:s("empty")}):(0,t.jsx)("div",{className:"divide-y",children:o.map(e=>(0,t.jsxs)("button",{className:(0,l.cn)("flex w-full items-start gap-3 px-6 py-3.5 text-left hover:bg-accent/50 transition-colors",!e.read&&"bg-accent/30"),onClick:()=>{e.read||d(a,e.id),p(e)},children:[(0,t.jsx)("div",{className:(0,l.cn)("mt-1 size-2 rounded-full shrink-0",e.read?"bg-transparent":"bg-blue-500")}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:e.title}),e.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",children:e.description}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:eH(new Date(e.createdAt),{addSuffix:!0})})]})]},e.id))})}),o.length>0&&(0,t.jsx)("div",{className:"px-6 py-3 border-t shrink-0 flex justify-end",children:(0,t.jsxs)(c.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1 text-destructive",onClick:()=>{m(a),n(!1)},children:[(0,t.jsx)(eP.Trash2Icon,{className:"size-3.5"}),s("clearAll")]})})]})})}function eX({workspaceId:e}){let n=(0,P.useTranslations)("sidebar.notifications"),a=(0,eT.useNotificationStore)(e=>e.notifications),i=(0,eT.useNotificationStore)(e=>e.markRead),s=(0,eT.useNotificationStore)(e=>e.clearAll),o=a.filter(e=>!e.read).length,[d,u]=(0,r.useState)(!1),[m,f]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),g=a.slice(0,5);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(eN.Popover,{open:d,onOpenChange:u,children:[(0,t.jsxs)(eN.PopoverTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"rounded-full relative","aria-label":n("openAriaLabel")}),children:[(0,t.jsx)(eI.default,{className:"size-5"}),o>0&&(0,t.jsx)("span",{className:"absolute -top-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-red-500 text-[10px] font-medium text-white",children:o>9?"9+":o})]}),(0,t.jsxs)(eN.PopoverContent,{side:"right",className:"w-80 max-h-[70dvh] my-6 p-0",align:"start",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[(0,t.jsx)("span",{className:"text-sm font-semibold",children:n("title")}),a.length>0&&(0,t.jsx)("div",{className:"flex gap-1",children:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>s(e),title:n("clearAll"),children:(0,t.jsx)(eP.Trash2Icon,{className:"size-3.5"})})})]}),(0,t.jsx)(el.ScrollArea,{className:"max-h-[50dvh] overflow-hidden",children:0===g.length?(0,t.jsx)("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:n("empty")}):(0,t.jsx)("div",{className:"divide-y",children:g.map(n=>(0,t.jsxs)("button",{className:(0,l.cn)("flex w-full items-start gap-3 px-4 py-3 text-left hover:bg-accent/50 transition-colors",!n.read&&"bg-accent/30"),onClick:()=>{n.read||i(e,n.id),h(n),f(!0)},children:[(0,t.jsx)("div",{className:(0,l.cn)("mt-1 size-2 rounded-full shrink-0",n.read?"bg-transparent":"bg-blue-500")}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:n.title}),n.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-0.5",children:n.description}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:eH(new Date(n.createdAt),{addSuffix:!0})})]})]},n.id))})}),a.length>5&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"border-t"}),(0,t.jsx)("button",{className:"w-full px-4 py-2.5 text-sm text-muted-foreground hover:text-primary hover:bg-accent/30 transition-colors",onClick:()=>{h(null),u(!1),f(!0)},children:n("viewAll")})]})]})]}),(0,t.jsx)(eq,{open:m,onOpenChange:f,workspaceId:e,initialNotification:p})]})}var eY=e.i(344118);let eG=(0,f.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var eJ=e.i(210),eZ=e.i(523592);function eQ({open:e,onOpenChange:n,editingId:a,servers:i,onSave:s}){let o=(0,P.useTranslations)("sidebar"),l=(0,P.useTranslations)("common"),[u,m]=r.useState(""),[f,p]=r.useState(""),[h,g]=r.useState("");return r.useEffect(()=>{if(e&&a){let e=i.find(e=>e.id===a);e&&(m(e.name),p(e.url),g(e.secret||""))}else e&&(m(""),p(""),g(""))},[e,a,i]),(0,t.jsx)(eo.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(eo.DialogContent,{children:[(0,t.jsxs)(eo.DialogHeader,{children:[(0,t.jsx)(eo.DialogTitle,{children:o(a?"server.editServer":"server.addServer")}),(0,t.jsx)(eo.DialogDescription,{children:o(a?"server.editDescription":"server.addDescription")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:l("name")}),(0,t.jsx)(d.Input,{value:u,onChange:e=>m(e.target.value),placeholder:"My Server"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:o("server.url")}),(0,t.jsx)(d.Input,{value:f,onChange:e=>p(e.target.value),placeholder:"http://192.168.1.100:3100",onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:o("server.secret")}),(0,t.jsx)(d.Input,{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:o("server.secretPlaceholder"),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]})]}),(0,t.jsxs)(eo.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>n(!1),children:l("cancel")}),(0,t.jsx)(c.Button,{onClick:()=>{if(!u.trim()||!f.trim())return;let e=f.trim().replace(/\/$/,"");/^https?:\/\//.test(e)||(e="http://"+e),a?s(i.map(t=>t.id===a?{...t,name:u.trim(),url:e,secret:h.trim()||void 0}:t)):s([...i,{id:Date.now().toString(),name:u.trim(),url:e,secret:h.trim()||void 0}]),n(!1)},disabled:!u.trim()||!f.trim(),children:l(a?"save":"add")})]})]})})}var e0=e.i(894920),e1=e.i(691223);function e2(){let{isMobile:e}=v(),n=(0,P.useTranslations)("sidebar"),[a,i]=r.useState(eZ.loadServers),[s,o]=r.useState(eZ.loadActiveId),[l,c]=r.useState(!1),[d,u]=r.useState(null),[m,f]=r.useState(!1),p=a.find(e=>e.id===s)||a[0],h=r.useCallback(e=>{e1.useEditorStore.getState().resetEditorState(),o(e.id),(0,eZ.saveActiveId)(e.id),(0,eZ.setActiveServerCookie)(e.url),window.location.href="/"},[]),g=r.useCallback(e=>{if("default"===e)return;let t=a.filter(t=>t.id!==e);if(i(t),(0,eZ.saveServers)(t),s===e){let e=t.find(e=>"default"===e.id)||t[0];e&&h(e)}},[s,a,h]);return p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{children:(0,t.jsx)(C,{children:(0,t.jsxs)(ed.DropdownMenu,{children:[(0,t.jsxs)(ed.DropdownMenuTrigger,{render:(0,t.jsx)(D,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"}),children:[(0,t.jsx)("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-background text-foreground",children:(0,t.jsx)(W.Server,{className:"size-4"})}),(0,t.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,t.jsx)("span",{className:"truncate font-semibold",children:p.name}),(0,t.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:p.url.replace(/^https?:\/\//,"")})]}),(0,t.jsx)(eG,{className:"ml-auto"})]}),(0,t.jsxs)(ed.DropdownMenuContent,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg mb-4",align:"start",side:e?"bottom":"right",sideOffset:4,children:[(0,t.jsx)(ed.DropdownMenuGroup,{children:(0,t.jsx)(ed.DropdownMenuLabel,{className:"text-xs text-muted-foreground",children:n("server.servers")})}),a.map(e=>(0,t.jsxs)(ed.DropdownMenuItem,{onClick:()=>h(e),className:"gap-2 p-2",children:[(0,t.jsx)("div",{className:"flex size-6 items-center justify-center rounded-sm border",children:(0,t.jsx)(W.Server,{className:"size-3.5 shrink-0"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm truncate",children:e.name}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.url})]}),e.id===s&&(0,t.jsx)(eY.Check,{className:"size-4 text-primary shrink-0"})]},e.id)),(0,t.jsx)(ed.DropdownMenuSeparator,{}),(0,t.jsxs)(ed.DropdownMenuItem,{className:"gap-2 p-2",onClick:()=>{u(null),c(!0)},children:[(0,t.jsx)("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:(0,t.jsx)(ef.Plus,{className:"size-4"})}),(0,t.jsx)("div",{className:"font-medium text-muted-foreground",children:n("server.addServer")})]}),(0,t.jsxs)(ed.DropdownMenuItem,{className:"gap-2 p-2",onClick:()=>f(!0),children:[(0,t.jsx)("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:(0,t.jsx)(eJ.Settings2,{className:"size-4"})}),(0,t.jsx)("div",{className:"font-medium text-muted-foreground",children:n("server.manageServers")})]})]})]})})}),(0,t.jsx)(eQ,{open:l,onOpenChange:c,editingId:d,servers:a,onSave:e=>{i(e),(0,eZ.saveServers)(e);let t=d?e.find(e=>e.id===d):e[e.length-1];d&&t&&d===s&&(0,eZ.setActiveServerCookie)(t.url)}}),(0,t.jsx)(e0.ServerManagerDialog,{open:m,onOpenChange:f,servers:a,activeId:s,onUpdate:e=>{i(e),(0,eZ.saveServers)(e);let t=e.find(e=>e.id===s);t&&(0,eZ.setActiveServerCookie)(t.url)},onRemove:g,onSwitch:h})]}):null}var e3=e.i(524),e5=e.i(640376),e4=e.i(31807),e6=e.i(327964),e9=e.i(250226),e8=e.i(286117);function e7(e){return`/workspace/${e}`}function te(){let{state:e,toggleSidebar:a}=v(),i=(0,n.usePathname)(),s=(0,n.useRouter)(),c=(0,P.useTranslations)("sidebar"),d=(0,P.useTranslations)("common"),u="collapsed"===e,m=(0,e8.isWorkspacePath)(i),f=(0,o.useIsMobile)(),p=(0,e8.workspaceIdFromLocation)(i,window.location.search),h=(0,ew.useWorkspaceStore)(e=>e.workspaces),g=(0,ew.useWorkspaceStore)(e=>e.setWorkspaces),x=(0,ew.useWorkspaceStore)(e=>e.upsertWorkspace),y=(0,ew.useWorkspaceStore)(e=>e.removeWorkspace),[S,C]=(0,r.useState)(!1),[E,D]=(0,r.useState)(!1),[M,I]=(0,r.useState)(!1),[es,eo]=(0,r.useState)(!1),[el,ec]=(0,r.useState)(!1),[ed,eu]=(0,r.useState)(!1),[em,ef]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)(!1),[eg,ev]=(0,r.useState)(!1),[ex,eb]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)(null),[eN,eS]=(0,r.useState)(void 0),eC=(0,r.useCallback)(()=>{fetch("/api/workspaces").then(e=>e.json()).then(g).catch(()=>{})},[g]);(0,r.useEffect)(()=>{eC()},[eC]),(0,r.useEffect)(()=>{let e=()=>a(),t=e=>{let t=e.detail,n={agents:"/settings/agents",skills:"/settings/skills",prompts:"/settings/prompts","output-styles":"/settings/output-styles",mcps:"/settings/mcps",models:"/settings/models",providers:"/settings/providers",hooks:"/settings",settings:"/settings"};if(f&&n[t])return void s.push(n[t]);let r={agents:C,skills:ec,prompts:eu,"output-styles":ef,mcps:eh,models:I,providers:eo,hooks:ev,settings:D};r[t]&&r[t](!0)};return window.addEventListener("toggle-sidebar",e),window.addEventListener("open-dialog",t),()=>{window.removeEventListener("toggle-sidebar",e),window.removeEventListener("open-dialog",t)}},[a,f]);let eE=(0,e5.useCommandPalette)(e=>e.registerMany);(0,r.useEffect)(()=>{let e=(e,t)=>{f||!t?s.push(e):t(!0)};return eE([{id:"toggle-sidebar",label:"Toggle Sidebar",group:"View",icon:q,action:()=>a()},{id:"latest-channel",label:"Open Latest Channel",group:"Navigation",icon:X.Hash,action:()=>{let{channels:e,setActiveChannel:t}=e4.useChannelStore.getState();e.length>0&&(t(e[e.length-1].id),e9.useMobilePanelStore.getState().setActivePanel("chat"))}},{id:"latest-issue",label:"Open Latest Issue",group:"Navigation",icon:Y.CircleDot,action:()=>{let{issues:e,setActiveIssue:t}=e6.useIssueStore.getState();e.length>0&&(t(e[e.length-1].id),e9.useMobilePanelStore.getState().setActivePanel("issue-detail"))}},{id:"open-settings",label:"Open General Settings",group:"Settings",icon:O,action:()=>e("/settings",D)},{id:"open-agents",label:"Open Agent Settings",group:"Settings",icon:z.Bot,action:()=>e("/settings/agents",C)},{id:"open-skills",label:"Open Skills Settings",group:"Settings",icon:U.Sparkles,action:()=>e("/settings/skills",ec)},{id:"open-prompts",label:"Open Prompt Settings",group:"Settings",icon:K.MessageSquare,action:()=>e("/settings/prompts",eu)},{id:"open-output-styles",label:"Open Output Style Settings",group:"Settings",icon:F.Pencil,action:()=>e("/settings/output-styles",ef)},{id:"open-mcps",label:"Open MCP Settings",group:"Settings",icon:V.Plug,action:()=>e("/settings/mcps",eh)},{id:"open-models",label:"Open Model Settings",group:"Settings",icon:_.Brain,action:()=>{f?s.push("/settings/models"):(eS(void 0),I(!0))}},{id:"open-providers",label:"Open Provider Settings",group:"Settings",icon:W.Server,action:()=>e("/settings/providers",eo)},{id:"open-hooks",label:"Open Hook Settings",group:"Settings",icon:G.Zap,action:()=>{f?s.push("/settings"):ev(!0)}},{id:"open-workflows",label:"Open Workflow Settings",group:"Navigation",icon:H.GitBranch,action:()=>{s.push("/workflows")}}])},[eE,a,f]);let eD=async e=>{if(ey){let t=await fetch(`/api/workspaces/${ey.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});x(await t.json())}else{let t=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});x(await t.json())}},eI=async e=>{if(await fetch(`/api/workspaces/${e.id}`,{method:"DELETE"}),y(e.id),p===e.id){let t=h.filter(t=>t.id!==e.id);(0,T.tauriNavigate)(s,t.length>0?e7(t[0].id):"/")}},eP=[{id:"home",title:c("nav.home"),icon:(0,t.jsx)(R.Home,{className:"size-4"}),link:"/"},{id:"workspaces",title:c("nav.workspaces"),icon:(0,t.jsx)(L.FolderOpen,{className:"size-4"}),link:"/",onAdd:()=>{ek(null),eb(!0)},addLabel:c("nav.addWorkspace"),manageLink:"/workspaces",subs:[...h.map(e=>({title:e.name,link:e7(e.id),icon:(0,t.jsx)(L.FolderOpen,{className:"size-4"}),menuItems:[{label:d("edit"),icon:(0,t.jsx)(F.Pencil,{className:"size-3.5"}),onClick:()=>{ek(e),eb(!0)}},{label:d("open"),icon:(0,t.jsx)(B.FolderSearch,{className:"size-3.5"}),onClick:()=>fetch(`/api/workspaces/${e.id}/reveal`,{method:"POST"})},{label:d("delete"),icon:(0,t.jsx)($.Trash2,{className:"size-3.5"}),variant:"destructive",onClick:()=>eI(e)}]}))]},{id:"workflows",title:c("nav.workflows"),icon:(0,t.jsx)(H.GitBranch,{className:"size-4"}),link:"/workflows"},{id:"settings",title:c("nav.settings"),icon:(0,t.jsx)(O,{className:"size-4"}),link:"#",subs:f?[{title:c("nav.general"),link:"/settings"},{title:c("nav.agents"),link:"/settings/agents",icon:(0,t.jsx)(z.Bot,{className:"size-3.5"})},{title:c("nav.skills"),link:"/settings/skills",icon:(0,t.jsx)(U.Sparkles,{className:"size-3.5"})},{title:c("nav.prompts"),link:"/settings/prompts",icon:(0,t.jsx)(K.MessageSquare,{className:"size-3.5"})},{title:c("nav.outputStyles"),link:"/settings/output-styles",icon:(0,t.jsx)(F.Pencil,{className:"size-3.5"})},{title:c("nav.mcps"),link:"/settings/mcps",icon:(0,t.jsx)(V.Plug,{className:"size-3.5"})},{title:c("nav.models"),link:"/settings/models",icon:(0,t.jsx)(_.Brain,{className:"size-3.5"})},{title:c("nav.providers"),link:"/settings/providers",icon:(0,t.jsx)(W.Server,{className:"size-3.5"})}]:[{title:c("nav.general"),link:"#",onClick:()=>D(!0)},{title:c("nav.agents"),link:"#",icon:(0,t.jsx)(z.Bot,{className:"size-3.5"}),onClick:()=>C(!0)},{title:c("nav.skills"),link:"#",icon:(0,t.jsx)(U.Sparkles,{className:"size-3.5"}),onClick:()=>ec(!0)},{title:c("nav.prompts"),link:"#",icon:(0,t.jsx)(K.MessageSquare,{className:"size-3.5"}),onClick:()=>eu(!0)},{title:c("nav.outputStyles"),link:"#",icon:(0,t.jsx)(F.Pencil,{className:"size-3.5"}),onClick:()=>ef(!0)},{title:c("nav.mcps"),link:"#",icon:(0,t.jsx)(V.Plug,{className:"size-3.5"}),onClick:()=>eh(!0)},{title:c("nav.models"),link:"#",icon:(0,t.jsx)(_.Brain,{className:"size-3.5"}),onClick:()=>{eS(void 0),I(!0)}},{title:c("nav.providers"),link:"#",icon:(0,t.jsx)(W.Server,{className:"size-3.5"}),onClick:()=>eo(!0)},{title:c("nav.hooks"),link:"#",icon:(0,t.jsx)(G.Zap,{className:"size-3.5"}),onClick:()=>ev(!0)}]}];return(0,t.jsxs)(b,{variant:"floating",collapsible:"icon",className:(0,l.cn)("overflow-hidden",m&&"bg-[#f2f3f5] dark:bg-[#0f1117]"),children:[(0,t.jsxs)(j,{className:(0,l.cn)("flex shrink-0 rounded-xl border border-border bg-card mx-2 mt-2 px-3 py-2.5 shadow-[0_1px_3px_rgba(0,0,0,0.04)]",u?"flex-row items-center justify-between gap-y-4 md:flex-col md:items-center md:justify-center":"flex-row items-center justify-between"),children:[(0,t.jsx)("a",{href:"#",className:"flex items-center gap-2",children:(0,t.jsx)(J.UserIcon,{size:u?"sm":"md"})}),(0,t.jsxs)(A.motion.div,{className:(0,l.cn)("flex items-center gap-2",u?"flex-row md:flex-col-reverse":"flex-row"),initial:{opacity:0},animate:{opacity:1},transition:{duration:.8},children:[(0,t.jsx)(eX,{workspaceId:p??""}),(0,t.jsx)(w,{})]},u?"header-collapsed":"header-expanded")]}),(0,t.jsx)(N,{className:"min-h-0 overflow-y-auto group-data-[collapsible=icon]:overflow-y-auto gap-2 mx-2 my-2 rounded-xl border border-border bg-card p-2 shadow-[0_1px_3px_rgba(0,0,0,0.04)]",children:(0,t.jsx)(eM,{routes:eP})}),(0,t.jsx)(k,{className:"shrink-0 mx-2 mb-2 rounded-xl border border-border bg-card p-2 shadow-[0_1px_3px_rgba(0,0,0,0.04)]",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(Z.AgentDialog,{open:S,onOpenChange:C}),(0,t.jsx)(en.SkillsDialog,{open:el,onOpenChange:ec}),(0,t.jsx)(er.PromptsDialog,{open:ed,onOpenChange:eu}),(0,t.jsx)(ea.OutputStylesDialog,{open:em,onOpenChange:ef}),(0,t.jsx)(ei.McpsDialog,{open:ep,onOpenChange:eh}),(0,t.jsx)(ej,{open:eg,onOpenChange:ev}),(0,t.jsx)(et.SettingsDialog,{open:E,onOpenChange:D}),(0,t.jsx)(Q.ModelsDialog,{open:M,onOpenChange:I,initialProvider:eN}),(0,t.jsx)(ee.ProvidersDialog,{open:es,onOpenChange:eo,onAddModel:e=>{eS(e),I(!0)}}),(0,t.jsx)(e3.WorkspaceDialog,{open:ex,onOpenChange:eb,workspace:ey,onSubmit:eD})]})}function tt(){let e=(0,ew.useWorkspaceStore)(e=>e.workspaces),{toggleSidebar:r}=v(),a=(0,n.useRouter)(),i=(0,n.usePathname)(),s=(0,n.useSearchParams)(),o=(0,e8.workspaceIdFromLocation)(i,s.toString());return(0,t.jsxs)("div",{className:"flex items-center h-12 px-3 bg-transparent overflow-x-auto shrink-0",children:[(0,t.jsx)("button",{onClick:()=>r(),className:"flex items-center justify-center size-8 rounded-lg text-muted-foreground hover:bg-accent/50 transition-colors shrink-0 md:hidden",children:(0,t.jsx)(p,{size:16})}),(0,t.jsx)("div",{className:"flex items-center gap-1 rounded-xl p-1",children:e.map(e=>(0,t.jsx)("button",{onClick:()=>{var t;return(0,T.tauriNavigate)(a,(t=e.id,`/workspace/${t}`))},className:(0,l.cn)("flex items-center gap-1.5 px-3.5 h-7 text-[13px] font-medium rounded-lg transition-all whitespace-nowrap",o===e.id?"bg-primary text-primary-foreground shadow-[rgba(0,0,0,0.08)_0px_4px_6px]":"text-muted-foreground hover:text-foreground hover:bg-accent/50"),children:(0,t.jsx)("span",{className:"max-w-[160px] truncate",children:e.name})},e.id))})]})}e.i(8890);var tn=e.i(478189);function tr(){let[e,t]=(0,r.useState)(!1),[n,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{a(!0)},[]),(0,r.useEffect)(()=>{if(!e)return;let n=e=>{e.preventDefault(),e.stopPropagation();let n=e.target;if(!(n instanceof HTMLElement))return;let r=function(e){let t=e.closest("[data-inspector-relative-path]");if(t?.dataset.inspectorRelativePath)return{relativePath:t.dataset.inspectorRelativePath,lineNumber:t.dataset.inspectorLine??"1",columnNumber:t.dataset.inspectorColumn??"1"};let n=function e(t){if(!t)return;let n=Object.keys(t).find(e=>e.startsWith("__reactFiber$")||e.startsWith("__reactInternalInstance$"));return n?t[n]:e(t.parentElement)}(e);for(;n;){let e=n._debugSource??n._debugOwner?._debugSource;if(e?.fileName&&e.lineNumber)return{absolutePath:e.fileName,lineNumber:String(e.lineNumber),columnNumber:String(e.columnNumber??1)};n=n.return??void 0}}(n);console.debug("[react-dev-inspector] native click",r),t(!1),r?(e=>{if(!e)return;let t="codeInfo"in e?e.codeInfo:e,{lineNumber:n,columnNumber:r,relativePath:a,absolutePath:i}=t,s=!!a,o=s?a:i;if(!o)return console.error("[react-dev-inspector] Cannot open editor without source fileName",t);let l=s?`${tn.default}/relative`:tn.default;fetch(`${l}?${new URLSearchParams({fileName:o,lineNumber:n,colNumber:r})}`)})(r):console.warn("[react-dev-inspector] no React source info found",n)};return window.addEventListener("click",n,!0),()=>window.removeEventListener("click",n,!0)},[e]),null}e.s(["AppShell",0,function({children:e}){let a=(0,n.usePathname)(),[i,s]=(0,r.useState)(()=>{let e=localStorage.getItem("showWorkspaceTabs");return null===e||"false"!==e});return((0,r.useEffect)(()=>{let e=e=>s(e.detail);return window.addEventListener("workspace-tabs-visibility",e),()=>window.removeEventListener("workspace-tabs-visibility",e)},[]),(0,e8.isLoginPath)(a))?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tr,{}),(0,t.jsxs)(x,{className:"h-[var(--app-content-height)] min-h-0 bg-[#f2f3f5] dark:bg-[#0f1117]",children:[(0,t.jsx)(te,{}),(0,t.jsxs)(y,{className:"!bg-transparent",children:[i&&(0,t.jsx)(tt,{}),e]})]})]})}],994876)},984642,e=>{"use strict";var t=e.i(344180),n=e.i(640376),r=e.i(683640),a=e.i(764556);function i(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}let s=(0,a.forwardRef)(function({size:e=44,lsKey:n,onClick:r,children:s,className:o,style:l,visible:c=!0,snapThreshold:d=60,minimizeDelay:u=2e3,unhoverDelay:m=2e3,defaultPosition:f},p){let h=(0,a.useRef)({x:0,y:0}),[g,v]=(0,a.useState)({x:0,y:0}),[x,b]=(0,a.useState)(!1),[w,y]=(0,a.useState)(!1),j=(0,a.useRef)(!1),k=(0,a.useRef)({x:0,y:0}),N=(0,a.useRef)(!1),S=(0,a.useRef)(void 0),C=(0,a.useRef)(void 0),E=(0,a.useRef)("right"),D=(0,a.useRef)(null),M=e/2;(0,a.useEffect)(()=>{let t=function(e){try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}(n),r={x:f?.x??window.innerWidth-e-20,y:f?.y??window.innerHeight-e-28},a=t?{x:Math.min(t.x,window.innerWidth-e),y:Math.min(t.y,window.innerHeight-e)}:r;h.current=a,v(a),b(!0)},[n,e,f]);let I=(0,a.useCallback)(e=>{y(!0),h.current={x:"left"===e?-M:window.innerWidth-M,y:h.current.y},v(h.current)},[M]),P=(0,a.useCallback)(()=>{clearTimeout(S.current),S.current=void 0,clearTimeout(C.current),C.current=void 0},[]),T=(0,a.useCallback)(()=>{P(),y(!1);let t=window.innerWidth,r={x:h.current.x<t/2?12:t-e-12,y:h.current.y};h.current=r,v(r),i(n,r)},[P,e,n]),A=(0,a.useCallback)(()=>{w&&T(),clearTimeout(C.current),C.current=void 0},[w,T]),R=(0,a.useCallback)(()=>{D.current&&(C.current=setTimeout(()=>I(E.current),m))},[I,m]),L=(0,a.useCallback)(e=>{j.current=!0,N.current=!1,D.current=null,P(),w&&T(),k.current={x:e.clientX-h.current.x,y:e.clientY-h.current.y},e.target.setPointerCapture(e.pointerId)},[P,w,T]),O=(0,a.useCallback)(t=>{if(!j.current)return;N.current=!0;let n=Math.max(0,Math.min(window.innerWidth-e,t.clientX-k.current.x)),r=Math.max(0,Math.min(window.innerHeight-e,t.clientY-k.current.y));h.current={x:n,y:r},v({x:n,y:r})},[e]),z=(0,a.useCallback)(()=>{j.current=!1;let{x:t,y:a}=h.current,s=window.innerWidth,o=t<d,l=t>s-e-d,c=Math.max(12,Math.min(window.innerHeight-e-12,a));if(o||l){let t=o?"left":"right";E.current=t,D.current=t;let r={x:o?12:s-e-12,y:c};h.current=r,v(r),i(n,r),S.current=setTimeout(()=>I(t),u)}else D.current=null,h.current={x:t,y:c},v(h.current),i(n,{x:t,y:c});if(!N.current&&r){let e=t=>{t.stopPropagation(),t.preventDefault(),document.removeEventListener("click",e,!0)};document.addEventListener("click",e,!0),r()}},[r,I,e,d,u,n]);return((0,a.useEffect)(()=>{let t=()=>{P();let t=window.innerWidth;if(w){let n=h.current.x<t/2;h.current={x:n?-M:t-M,y:Math.min(h.current.y,window.innerHeight-e-12)}}else h.current={x:Math.min(h.current.x,t-e-12),y:Math.min(h.current.y,window.innerHeight-e-12)};v(h.current)};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[P,w,M,e]),(0,a.useEffect)(()=>P,[P]),c&&x)?(0,t.jsx)("div",{ref:p,onPointerDown:L,onPointerMove:O,onPointerUp:z,onMouseEnter:A,onMouseLeave:R,className:o,style:{position:"fixed",left:g.x,top:g.y,width:e,height:e,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:99999,touchAction:"none",userSelect:"none",transition:j.current?"none":"left 0.3s ease-out, top 0.3s ease-out",...l},children:s}):null});e.s(["ConsolePanel",0,function(){let e=(0,n.useCommandPalette)(e=>e.toggle),a=(0,n.useCommandPalette)(e=>e.open);return(0,t.jsx)(s,{lsKey:"console-panel:pos",onClick:e,visible:!a,style:{background:"#3b82f6",color:"white",boxShadow:"0 4px 12px rgba(59,130,246,0.4)"},children:(0,t.jsx)(r.Terminal,{size:18})})}],984642)},694819,e=>{"use strict";var t=e.i(764556),n=e.i(515104);function r(){let e=document.documentElement,t=window.visualViewport,r=(0,n.isNativeEnvironment)()&&/Android/i.test(navigator.userAgent)?window.__agentSpacesNativeInsets?.top??0:0,a=t?.height??window.innerHeight,i=t?Math.max(0,window.innerHeight-t.height-t.offsetTop):0,s=Math.max(i,(0,n.isNativeEnvironment)()&&/Android/i.test(navigator.userAgent)?window.__agentSpacesNativeInsets?.keyboard??0:0),o=i>0?a:Math.max(0,window.innerHeight-s),l=Math.max(0,o-r);e.style.setProperty("--app-viewport-height",`${o}px`),e.style.setProperty("--app-content-height",`${l}px`),e.style.setProperty("--keyboard-inset-height",`${s}px`),e.style.setProperty("--app-top-inset",`${r}px`)}e.s(["ViewportInsets",0,function(){return(0,t.useEffect)(()=>{r();let e=e=>(function(e){if(!(e instanceof HTMLElement&&e.matches("input, textarea, [contenteditable='true'], [contenteditable='']")))return;let t=()=>{r(),e.scrollIntoView({block:"nearest",inline:"nearest"})};t(),window.setTimeout(t,60),window.setTimeout(t,180),window.setTimeout(t,360)})(e.target),t=window.visualViewport;return t?.addEventListener("resize",r),t?.addEventListener("scroll",r),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),window.addEventListener("agent-spaces-native-insets",r),document.addEventListener("focusin",e),()=>{t?.removeEventListener("resize",r),t?.removeEventListener("scroll",r),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),window.removeEventListener("agent-spaces-native-insets",r),document.removeEventListener("focusin",e)}},[]),null}])},701341,e=>{"use strict";var t=e.i(344180),n=e.i(764556),r=e.i(515104);async function a(e){if(!(0,r.isFlutterEnvironment)())return;let t=window.__flutterBridge;if(t?.invoke)try{await t.invoke("setZoom",{scale:e/100})}catch{}}e.s(["ZoomWrapper",0,function({children:e}){return(0,n.useEffect)(()=>{let e=localStorage.getItem("pageZoom");if(e){let t=Number(e);t>=50&&t<=200&&a(t)}let t=e=>{let t=e.detail;"number"==typeof t&&t>=50&&t<=200&&a(t)};return window.addEventListener("zoom-change",t),()=>window.removeEventListener("zoom-change",t)},[]),(0,t.jsx)(t.Fragment,{children:e})}])},698679,e=>{"use strict";let t,n,r;var a,i,s,o,l,c,d,u,m,f=e.i(344180),p=e.i(764556),h=/[\\\/_+.#"@\[\(\{&]/,g=/[\\\/_+.#"@\[\(\{&]/g,v=/[\s-]/,x=/[\s-]/g;function b(e){return e.toLowerCase().replace(x," ")}function w(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function y(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function j(...e){return t=>{let n=!1,r=e.map(e=>{let r=y(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():y(e[t],null)}}}}function k(...e){return p.useCallback(j(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var N=globalThis?.document?p.useLayoutEffect:()=>{},S=p[" useId ".trim().toString()]||(()=>void 0),C=0;function E(e){let[t,n]=p.useState(S());return N(()=>{e||n(e=>e??String(C++))},[e]),e||(t?`radix-${t}`:"")}p[" useEffectEvent ".trim().toString()],p[" useInsertionEffect ".trim().toString()];var D=p[" useInsertionEffect ".trim().toString()]||N;Symbol("RADIX:SYNC_STATE");var M=e.i(106206);function I(e){var t;let n,r=(t=e,(n=p.forwardRef((e,t)=>{let{children:n,...r}=e;if(p.isValidElement(n)){var a;let e,i,s=(a=n,(i=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(i=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),o=function(e,t){let n={...t};for(let r in t){let a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...i}:"className"===r&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==p.Fragment&&(o.ref=t?j(t,s):s),p.cloneElement(n,o)}return p.Children.count(n)>1?p.Children.only(null):null})).displayName=`${t}.SlotClone`,n),a=p.forwardRef((e,t)=>{let{children:n,...a}=e,i=p.Children.toArray(n),s=i.find(T);if(s){let e=s.props.children,n=i.map(t=>t!==s?t:p.Children.count(e)>1?p.Children.only(null):p.isValidElement(e)?e.props.children:null);return(0,f.jsx)(r,{...a,ref:t,children:p.isValidElement(e)?p.cloneElement(e,void 0,n):null})}return(0,f.jsx)(r,{...a,ref:t,children:n})});return a.displayName=`${e}.Slot`,a}var P=Symbol("radix.slottable");function T(e){return p.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===P}var A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=I(`Primitive.${t}`),r=p.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,f.jsx)(a?n:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function R(e){let t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...e)=>t.current?.(...e),[])}var L="dismissableLayer.update",O=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z=p.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:o,...l}=e,c=p.useContext(O),[d,m]=p.useState(null),h=d?.ownerDocument??globalThis?.document,[,g]=p.useState({}),v=k(t,e=>m(e)),x=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=x.indexOf(b),j=d?x.indexOf(d):-1,N=c.layersWithOutsidePointerEventsDisabled.size>0,S=j>=y,C=function(e,t=globalThis?.document){let n=R(e),r=p.useRef(!1),a=p.useRef(()=>{});return p.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){W("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})},i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{let t=e.target,n=[...c.branches].some(e=>e.contains(t));S&&!n&&(a?.(e),s?.(e),e.defaultPrevented||o?.())},h),E=function(e,t=globalThis?.document){let n=R(e),r=p.useRef(!1);return p.useEffect(()=>{let e=e=>{e.target&&!r.current&&W("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{let t=e.target;![...c.branches].some(e=>e.contains(t))&&(i?.(e),s?.(e),e.defaultPrevented||o?.())},h);return!function(e,t=globalThis?.document){let n=R(e);p.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{j===c.layers.size-1&&(r?.(e),!e.defaultPrevented&&o&&(e.preventDefault(),o()))},h),p.useEffect(()=>{if(d)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(u=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),_(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=u)}},[d,h,n,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),_())},[d,c]),p.useEffect(()=>{let e=()=>g({});return document.addEventListener(L,e),()=>document.removeEventListener(L,e)},[]),(0,f.jsx)(A.div,{...l,ref:v,style:{pointerEvents:N?S?"auto":"none":void 0,...e.style},onFocusCapture:w(e.onFocusCapture,E.onFocusCapture),onBlurCapture:w(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:w(e.onPointerDownCapture,C.onPointerDownCapture)})});function _(){let e=new CustomEvent(L);document.dispatchEvent(e)}function W(e,t,n,{discrete:r}){let a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&a.addEventListener(e,t,{once:!0}),r)a&&M.flushSync(()=>a.dispatchEvent(i));else a.dispatchEvent(i)}z.displayName="DismissableLayer",p.forwardRef((e,t)=>{let n=p.useContext(O),r=p.useRef(null),a=k(t,r);return p.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,f.jsx)(A.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var F="focusScope.autoFocusOnMount",$="focusScope.autoFocusOnUnmount",B={bubbles:!1,cancelable:!0},H=p.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[o,l]=p.useState(null),c=R(a),d=R(i),u=p.useRef(null),m=k(t,e=>l(e)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let e=function(e){if(h.paused||!o)return;let t=e.target;o.contains(t)?u.current=t:V(u.current,{select:!0})},t=function(e){if(h.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||V(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&V(o)});return o&&n.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,o,h.paused]),p.useEffect(()=>{if(o){q.add(h);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(F,B);o.addEventListener(F,c),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(V(r,{select:t}),document.activeElement!==n)return}(U(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&V(o))}return()=>{o.removeEventListener(F,c),setTimeout(()=>{let t=new CustomEvent($,B);o.addEventListener($,d),o.dispatchEvent(t),t.defaultPrevented||V(e??document.body,{select:!0}),o.removeEventListener($,d),q.remove(h)},0)}}},[o,c,d,h]);let g=p.useCallback(e=>{if(!n&&!r||h.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){var i;let t,r=e.currentTarget,[s,o]=[K(t=U(i=r),i),K(t.reverse(),i)];s&&o?e.shiftKey||a!==o?e.shiftKey&&a===s&&(e.preventDefault(),n&&V(o,{select:!0})):(e.preventDefault(),n&&V(s,{select:!0})):a===r&&e.preventDefault()}},[n,r,h.paused]);return(0,f.jsx)(A.div,{tabIndex:-1,...s,ref:m,onKeyDown:g})});function U(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function K(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function V(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}H.displayName="FocusScope";var q=(r=[],{add(e){let t=r[0];e!==t&&t?.pause(),(r=X(r,e)).unshift(e)},remove(e){r=X(r,e),r[0]?.resume()}});function X(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var Y=p.forwardRef((e,t)=>{let{container:n,...r}=e,[a,i]=p.useState(!1);N(()=>i(!0),[]);let s=n||a&&globalThis?.document?.body;return s?M.default.createPortal((0,f.jsx)(A.div,{...r,ref:t}),s):null});Y.displayName="Portal";var G=e=>{var t;let n,r,{present:a,children:i}=e,s=function(e){var t,n;let[r,a]=p.useState(),i=p.useRef(null),s=p.useRef(e),o=p.useRef("none"),[l,c]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},p.useReducer((e,t)=>n[e][t]??e,t));return p.useEffect(()=>{let e=J(i.current);o.current="mounted"===l?e:"none"},[l]),N(()=>{let t=i.current,n=s.current;if(n!==e){let r=o.current,a=J(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):n&&r!==a?c("ANIMATION_OUT"):c("UNMOUNT"),s.current=e}},[e,c]),N(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let a=J(i.current).includes(CSS.escape(n.animationName));if(n.target===r&&a&&(c("ANIMATION_END"),!s.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},a=e=>{e.target===r&&(o.current=J(i.current))};return r.addEventListener("animationstart",a),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",a),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(e=>{i.current=e?getComputedStyle(e):null,a(e)},[])}}(a),o="function"==typeof i?i({present:s.isPresent}):p.Children.only(i),l=k(s.ref,(t=o,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof i||s.isPresent?p.cloneElement(o,{ref:l}):null};function J(e){return e?.animationName||"none"}G.displayName="Presence";var Z=0;function Q(){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}var ee=e.i(824627),et="right-scroll-bar-position",en="width-before-scroll-bar";function er(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ea="u">typeof window?p.useLayoutEffect:p.useEffect,ei=new WeakMap,es=(void 0===a&&(a={}),(void 0===i&&(i=function(e){return e}),s=[],o=!1,l={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:null},useMedium:function(e){var t=i(e,o);return s.push(t),function(){s=s.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(o=!0;s.length;){var t=s;s=[],t.forEach(e)}s={push:function(t){return e(t)},filter:function(){return s}}},assignMedium:function(e){o=!0;var t=[];if(s.length){var n=s;s=[],n.forEach(e),t=s}var r=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(r)};a(),s={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),s}}}}).options=(0,ee.__assign)({async:!0,ssr:!1},a),l),eo=function(){},el=p.forwardRef(function(e,t){var n,r,a,i,s=p.useRef(null),o=p.useState({onScrollCapture:eo,onWheelCapture:eo,onTouchMoveCapture:eo}),l=o[0],c=o[1],d=e.forwardProps,u=e.children,m=e.className,f=e.removeScrollBar,h=e.enabled,g=e.shards,v=e.sideCar,x=e.noRelative,b=e.noIsolation,w=e.inert,y=e.allowPinchZoom,j=e.as,k=e.gapMode,N=(0,ee.__rest)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=(n=[s,t],r=function(e){return n.forEach(function(t){return er(t,e)})},(a=(0,p.useState)(function(){return{value:null,callback:r,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=r,i=a.facade,ea(function(){var e=ei.get(i);if(e){var t=new Set(e),r=new Set(n),a=i.current;t.forEach(function(e){r.has(e)||er(e,null)}),r.forEach(function(e){t.has(e)||er(e,a)})}ei.set(i,n)},[n]),i),C=(0,ee.__assign)((0,ee.__assign)({},N),l);return p.createElement(p.Fragment,null,h&&p.createElement(v,{sideCar:es,removeScrollBar:f,shards:g,noRelative:x,noIsolation:b,inert:w,setCallbacks:c,allowPinchZoom:!!y,lockRef:s,gapMode:k}),d?p.cloneElement(p.Children.only(u),(0,ee.__assign)((0,ee.__assign)({},C),{ref:S})):p.createElement(void 0===j?"div":j,(0,ee.__assign)({},C,{className:m,ref:S}),u))});el.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},el.classNames={fullWidth:en,zeroRight:et};var ec=function(e){var t=e.sideCar,n=(0,ee.__rest)(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 p.createElement(r,(0,ee.__assign)({},n))};ec.isSideCarExport=!0;var ed=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=m||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,a;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eu=function(){var e=ed();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},em=function(){var e=eu();return function(t){return e(t.styles,t.dynamic),null}},ef={left:0,top:0,right:0,gap:0},ep=function(e){return parseInt(e||"",10)||0},eh=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[ep(n),ep(r),ep(a)]},eg=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return ef;var t=eh(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])}},ev=em(),ex="data-scroll-locked",eb=function(e,t,n,r){var a=e.left,i=e.top,s=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(o,"px ").concat(r,";\n }\n body[").concat(ex,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(et," {\n right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(en," {\n margin-right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(et," .").concat(et," {\n right: 0 ").concat(r,";\n }\n \n .").concat(en," .").concat(en," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ex,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},ew=function(){var e=parseInt(document.body.getAttribute(ex)||"0",10);return isFinite(e)?e:0},ey=function(){p.useEffect(function(){return document.body.setAttribute(ex,(ew()+1).toString()),function(){var e=ew()-1;e<=0?document.body.removeAttribute(ex):document.body.setAttribute(ex,e.toString())}},[])},ej=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;ey();var i=p.useMemo(function(){return eg(a)},[a]);return p.createElement(ev,{styles:eb(i,!t,a,n?"":"!important")})},ek=!1;if("u">typeof window)try{var eN=Object.defineProperty({},"passive",{get:function(){return ek=!0,!0}});window.addEventListener("test",eN,eN),window.removeEventListener("test",eN,eN)}catch(e){ek=!1}var eS=!!ek&&{passive:!1},eC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},eE=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),eD(e,r)){var a=eM(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},eD=function(e,t){return"v"===e?eC(t,"overflowY"):eC(t,"overflowX")},eM=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eI=function(e,t,n,r,a){var i,s=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),o=s*r,l=n.target,c=t.contains(l),d=!1,u=o>0,m=0,f=0;do{if(!l)break;var p=eM(e,l),h=p[0],g=p[1]-p[2]-s*h;(h||g)&&eD(e,l)&&(m+=g,f+=h);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l))return u&&(a&&1>Math.abs(m)||!a&&o>m)?d=!0:!u&&(a&&1>Math.abs(f)||!a&&-o>f)&&(d=!0),d},eP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eT=function(e){return[e.deltaX,e.deltaY]},eA=function(e){return e&&"current"in e?e.current:e},eR=0,eL=[];let eO=(c=function(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),a=p.useState(eR++)[0],i=p.useState(em)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(0,ee.__spreadArray)([e.lockRef.current],(e.shards||[]).map(eA),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=p.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var a,i=eP(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-i[0],c="deltaY"in e?e.deltaY:o[1]-i[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var m=window.getSelection(),f=m&&m.anchorNode;if(f&&(f===d||f.contains(d)))return!1;var p=eE(u,d);if(!p)return!0;if(p?a=u:(a="v"===u?"h":"v",p=eE(u,d)),!p)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=a),!a)return!0;var h=r.current||a;return eI(h,t,e,"h"===h?l:c,!0)},[]),l=p.useCallback(function(e){if(eL.length&&eL[eL.length-1]===i){var n="deltaY"in e?eT(e):eP(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var a=(s.current.shards||[]).map(eA).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?o(e,a[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=p.useCallback(function(e,n,r,a){var i={name:e,delta:n,target:r,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),d=p.useCallback(function(e){n.current=eP(e),r.current=void 0},[]),u=p.useCallback(function(t){c(t.type,eT(t),t.target,o(t,e.lockRef.current))},[]),m=p.useCallback(function(t){c(t.type,eP(t),t.target,o(t,e.lockRef.current))},[]);p.useEffect(function(){return eL.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,eS),document.addEventListener("touchmove",l,eS),document.addEventListener("touchstart",d,eS),function(){eL=eL.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,eS),document.removeEventListener("touchmove",l,eS),document.removeEventListener("touchstart",d,eS)}},[]);var f=e.removeScrollBar,h=e.inert;return p.createElement(p.Fragment,null,h?p.createElement(i,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,f?p.createElement(ej,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},es.useMedium(c),ec);var ez=p.forwardRef(function(e,t){return p.createElement(el,(0,ee.__assign)({},e,{ref:t,sideCar:eO}))});ez.classNames=el.classNames;var e_=new WeakMap,eW=new WeakMap,eF={},e$=0,eB=function(e){return e&&(e.host||eB(e.parentNode))},eH=function(e,t,n,r){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=eB(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eF[n]||(eF[n]=new WeakMap);var i=eF[n],s=[],o=new Set,l=new Set(a),c=function(e){!e||o.has(e)||(o.add(e),c(e.parentNode))};a.forEach(c);var d=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))d(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,l=(e_.get(e)||0)+1,c=(i.get(e)||0)+1;e_.set(e,l),i.set(e,c),s.push(e),1===l&&a&&eW.set(e,!0),1===c&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),o.clear(),e$++,function(){s.forEach(function(e){var t=e_.get(e)-1,a=i.get(e)-1;e_.set(e,t),i.set(e,a),t||(eW.has(e)||e.removeAttribute(r),eW.delete(e)),a||e.removeAttribute(n)}),--e$||(e_=new WeakMap,e_=new WeakMap,eW=new WeakMap,eF={})}},eU=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),eH(r,a,n,"aria-hidden")):function(){return null}},eK="Dialog",[eV,eq]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>p.createContext(e));return function(n){let r=n?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let a=p.createContext(r),i=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,o=n?.[e]?.[i]||a,l=p.useMemo(()=>s,Object.values(s));return(0,f.jsx)(o.Provider,{value:l,children:r})};return s.displayName=t+"Provider",[s,function(n,s){let o=s?.[e]?.[i]||a,l=p.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let a=n(e)[`__scope${r}`];return{...t,...a}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(eK),[eX,eY]=eV(eK),eG=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,o=p.useRef(null),l=p.useRef(null),[c,d]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[a,i,s]=function({defaultProp:e,onChange:t}){let[n,r]=p.useState(e),a=p.useRef(n),i=p.useRef(t);return D(()=>{i.current=t},[t]),p.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:a;{let t=p.useRef(void 0!==e);p.useEffect(()=>{let e=t.current;if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=o},[o,r])}return[l,p.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s.current?.(n)}else i(t)},[o,e,i,s])]}({prop:r,defaultProp:a??!1,onChange:i,caller:eK});return(0,f.jsx)(eX,{scope:t,triggerRef:o,contentRef:l,contentId:E(),titleId:E(),descriptionId:E(),open:c,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})};eG.displayName=eK;var eJ="DialogTrigger";p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=eY(eJ,n),i=k(t,a.triggerRef);return(0,f.jsx)(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ta(a.open),...r,ref:i,onClick:w(e.onClick,a.onOpenToggle)})}).displayName=eJ;var eZ="DialogPortal",[eQ,e0]=eV(eZ,{forceMount:void 0}),e1=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=eY(eZ,t);return(0,f.jsx)(eQ,{scope:t,forceMount:n,children:p.Children.map(r,e=>(0,f.jsx)(G,{present:n||i.open,children:(0,f.jsx)(Y,{asChild:!0,container:a,children:e})}))})};e1.displayName=eZ;var e2="DialogOverlay",e3=p.forwardRef((e,t)=>{let n=e0(e2,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=eY(e2,e.__scopeDialog);return i.modal?(0,f.jsx)(G,{present:r||i.open,children:(0,f.jsx)(e4,{...a,ref:t})}):null});e3.displayName=e2;var e5=I("DialogOverlay.RemoveScroll"),e4=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=eY(e2,n);return(0,f.jsx)(ez,{as:e5,allowPinchZoom:!0,shards:[a.contentRef],children:(0,f.jsx)(A.div,{"data-state":ta(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),e6="DialogContent",e9=p.forwardRef((e,t)=>{let n=e0(e6,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=eY(e6,e.__scopeDialog);return(0,f.jsx)(G,{present:r||i.open,children:i.modal?(0,f.jsx)(e8,{...a,ref:t}):(0,f.jsx)(e7,{...a,ref:t})})});e9.displayName=e6;var e8=p.forwardRef((e,t)=>{let n=eY(e6,e.__scopeDialog),r=p.useRef(null),a=k(t,n.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return eU(e)},[]),(0,f.jsx)(te,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault())})}),e7=p.forwardRef((e,t)=>{let n=eY(e6,e.__scopeDialog),r=p.useRef(!1),a=p.useRef(!1);return(0,f.jsx)(te,{...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,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),te=p.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,o=eY(e6,n),l=p.useRef(null),c=k(t,l);return p.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Q()),document.body.insertAdjacentElement("beforeend",e[1]??Q()),Z++,()=>{1===Z&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Z--}},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(H,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,f.jsx)(z,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":ta(o.open),...s,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(tl,{titleId:o.titleId}),(0,f.jsx)(tc,{contentRef:l,descriptionId:o.descriptionId})]})]})}),tt="DialogTitle";p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=eY(tt,n);return(0,f.jsx)(A.h2,{id:a.titleId,...r,ref:t})}).displayName=tt;var tn="DialogDescription";p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=eY(tn,n);return(0,f.jsx)(A.p,{id:a.descriptionId,...r,ref:t})}).displayName=tn;var tr="DialogClose";function ta(e){return e?"open":"closed"}p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=eY(tr,n);return(0,f.jsx)(A.button,{type:"button",...r,ref:t,onClick:w(e.onClick,()=>a.onOpenChange(!1))})}).displayName=tr;var ti="DialogTitleWarning",[ts,to]=(d={contentName:e6,titleName:tt,docsSlug:"dialog"},t=p.createContext(d),(n=e=>{let{children:n,...r}=e,a=p.useMemo(()=>r,Object.values(r));return(0,f.jsx)(t.Provider,{value:a,children:n})}).displayName=ti+"Provider",[n,function(e){let n=p.useContext(t);if(n)return n;if(void 0!==d)return d;throw Error(`\`${e}\` must be used within \`${ti}\``)}]),tl=({titleId:e})=>{let t=to(ti),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
-
3
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
-
5
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},tc=({contentRef:e,descriptionId:t})=>{let n=to("DialogDescriptionWarning"),r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return p.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},td='[cmdk-group=""]',tu='[cmdk-group-items=""]',tm='[cmdk-item=""]',tf=`${tm}:not([aria-disabled="true"])`,tp="cmdk-item-select",th="data-value",tg=(e,t,n)=>{var r;return r=e,function e(t,n,r,a,i,s,o){if(s===n.length)return i===t.length?1:.99;var l=`${i},${s}`;if(void 0!==o[l])return o[l];for(var c,d,u,m,f=a.charAt(s),p=r.indexOf(f,i),b=0;p>=0;)(c=e(t,n,r,a,p+1,s+1,o))>b&&(p===i?c*=1:h.test(t.charAt(p-1))?(c*=.8,(u=t.slice(i,p-1).match(g))&&i>0&&(c*=Math.pow(.999,u.length))):v.test(t.charAt(p-1))?(c*=.9,(m=t.slice(i,p-1).match(x))&&i>0&&(c*=Math.pow(.999,m.length))):(c*=.17,i>0&&(c*=Math.pow(.999,p-i))),t.charAt(p)!==n.charAt(s)&&(c*=.9999)),(c<.1&&r.charAt(p-1)===a.charAt(s+1)||a.charAt(s+1)===a.charAt(s)&&r.charAt(p-1)!==a.charAt(s))&&.1*(d=e(t,n,r,a,p+1,s+2,o))>c&&(c=.1*d),c>b&&(b=c),p=r.indexOf(f,p+1);return o[l]=b,b}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,b(r),b(t),0,0,{})},tv=p.createContext(void 0),tx=p.createContext(void 0),tb=p.createContext(void 0),tw=p.forwardRef((e,t)=>{let n=tI(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=tI(()=>new Set),a=tI(()=>new Map),i=tI(()=>new Map),s=tI(()=>new Set),o=tD(e),{label:l,children:c,value:d,onValueChange:u,filter:m,shouldFilter:f,loop:h,disablePointerSelection:g=!1,vimBindings:v=!0,...x}=e,b=E(),w=E(),y=E(),j=p.useRef(null),k=tA();tM(()=>{if(void 0!==d){let e=d.trim();n.current.value=e,N.emit()}},[d]),tM(()=>{k(6,P)},[]);let N=p.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var a,i,s,l;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)I(),D(),k(1,M);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(y);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(k(7,()=>{var e;n.current.selectedItemId=null==(e=T())?void 0:e.id,N.emit()}),r||k(5,P),(null==(i=o.current)?void 0:i.value)!==void 0){null==(l=(s=o.current).onValueChange)||l.call(s,null!=t?t:"");return}}N.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),S=p.useMemo(()=>({value:(e,t,r)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),k(2,()=>{D(),N.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),k(3,()=>{I(),D(),n.current.value||M(),N.emit()}),()=>{i.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=T();k(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&M(),N.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:b,inputId:y,labelId:w,listInnerRef:j}),[]);function C(e,t){var r,a;let i=null!=(a=null==(r=o.current)?void 0:r.filter)?a:tg;return e?i(e,n.current.search,t):0}function D(){if(!n.current.search||!1===o.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),i=0;r.forEach(t=>{i=Math.max(e.get(t),i)}),t.push([n,i])});let r=j.current;R().sort((t,n)=>{var r,a;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(a=e.get(i))?a:0)}).forEach(e=>{let t=e.closest(tu);t?t.appendChild(e.parentElement===t?e:e.closest(`${tu} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${tu} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=j.current)?void 0:t.querySelector(`${td}[${th}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function M(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(th);N.setState("value",t||void 0)}function I(){var e,t,s,l;if(!n.current.search||!1===o.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let c=0;for(let a of r.current){let r=C(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(l=null==(s=i.current.get(a))?void 0:s.keywords)?l:[]);n.current.filtered.items.set(a,r),r>0&&c++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function P(){var e,t,n;let r=T();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(td))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=j.current)?void 0:e.querySelector(`${tm}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=j.current)?void 0:e.querySelectorAll(tf))||[])}function L(e){let t=R()[e];t&&N.setState("value",t.getAttribute(th))}function O(e){var t;let n=T(),r=R(),a=r.findIndex(e=>e===n),i=r[a+e];null!=(t=o.current)&&t.loop&&(i=a+e<0?r[r.length-1]:a+e===r.length?r[0]:r[a+e]),i&&N.setState("value",i.getAttribute(th))}function z(e){let t=T(),n=null==t?void 0:t.closest(td),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,td):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,td))?void 0:n.querySelector(tf);r?N.setState("value",r.getAttribute(th)):O(e)}let _=()=>L(R().length-1),W=e=>{e.preventDefault(),e.metaKey?_():e.altKey?z(1):O(1)},F=e=>{e.preventDefault(),e.metaKey?L(0):e.altKey?z(-1):O(-1)};return p.createElement(A.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":v&&e.ctrlKey&&W(e);break;case"ArrowDown":W(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),L(0);break;case"End":e.preventDefault(),_();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(tp);t.dispatchEvent(e)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:tL},l),tR(e,e=>p.createElement(tx.Provider,{value:N},p.createElement(tv.Provider,{value:S},e))))}),ty=p.forwardRef((e,t)=>{var n,r;let a=E(),i=p.useRef(null),s=p.useContext(tb),o=p.useContext(tv),l=tD(e),c=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;tM(()=>{if(!c)return o.item(a,null==s?void 0:s.id)},[c]);let d=tT(a,i,[e.value,e.children,i],e.keywords),u=p.useContext(tx),m=tP(e=>e.value&&e.value===d.current),f=tP(e=>!!c||!1===o.filter()||!e.search||e.filtered.items.get(a)>0);function h(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function g(){u.setState("value",d.current,!0)}if(p.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(tp,h),()=>t.removeEventListener(tp,h)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:v,value:x,onSelect:b,forceMount:w,keywords:y,...k}=e;return p.createElement(A.div,{ref:j(i,t),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||o.getDisablePointerSelection()?void 0:g,onClick:v?void 0:h},e.children)}),tj=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,s=E(),o=p.useRef(null),l=p.useRef(null),c=E(),d=p.useContext(tv),u=tP(e=>!!a||!1===d.filter()||!e.search||e.filtered.groups.has(s));tM(()=>d.group(s),[]),tT(s,o,[e.value,e.heading,l]);let m=p.useMemo(()=>({id:s,forceMount:a}),[a]);return p.createElement(A.div,{ref:j(o,t),...i,"cmdk-group":"",role:"presentation",hidden:!u||void 0},n&&p.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),tR(e,e=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},p.createElement(tb.Provider,{value:m},e))))}),tk=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=p.useRef(null),i=tP(e=>!e.search);return n||i?p.createElement(A.div,{ref:j(a,t),...r,"cmdk-separator":"",role:"separator"}):null}),tN=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=null!=e.value,i=p.useContext(tx),s=tP(e=>e.search),o=tP(e=>e.selectedItemId),l=p.useContext(tv);return p.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),p.createElement(A.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),tS=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=p.useRef(null),s=p.useRef(null),o=tP(e=>e.selectedItemId),l=p.useContext(tv);return p.useEffect(()=>{if(s.current&&i.current){let e=s.current,t=i.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),p.createElement(A.div,{ref:j(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},tR(e,e=>p.createElement("div",{ref:j(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),tC=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...o}=e;return p.createElement(eG,{open:n,onOpenChange:r},p.createElement(e1,{container:s},p.createElement(e3,{"cmdk-overlay":"",className:a}),p.createElement(e9,{"aria-label":e.label,"cmdk-dialog":"",className:i},p.createElement(tw,{ref:t,...o}))))}),tE=Object.assign(tw,{List:tS,Item:ty,Input:tN,Group:tj,Separator:tk,Dialog:tC,Empty:p.forwardRef((e,t)=>tP(e=>0===e.filtered.count)?p.createElement(A.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:p.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return p.createElement(A.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},tR(e,e=>p.createElement("div",{"aria-hidden":!0},e)))})});function tD(e){let t=p.useRef(e);return tM(()=>{t.current=e}),t}var tM="u"<typeof window?p.useEffect:p.useLayoutEffect;function tI(e){let t=p.useRef();return void 0===t.current&&(t.current=e()),t}function tP(e){let t=p.useContext(tx),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function tT(e,t,n,r=[]){let a=p.useRef(),i=p.useContext(tv);return tM(()=>{var s;let o=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=r.map(e=>e.trim());i.value(e,o,l),null==(s=t.current)||s.setAttribute(th,o),a.current=o}),a}var tA=()=>{let[e,t]=p.useState(),n=tI(()=>new Map);return tM(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function tR({asChild:e,children:t},n){let r;return e&&p.isValidElement(t)?p.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var tL={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},tO=e.i(465458),tz=e.i(209988),t_=e.i(294237);function tW({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,tO.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}e.i(260218),e.i(681622),e.i(788010);let tF=(0,t_.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function t$({className:e,align:t="inline-start",...n}){return(0,f.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,tO.cn)(tF({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}(0,t_.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});var tB=e.i(367914);function tH({className:e,...t}){return(0,f.jsx)(tE,{"data-slot":"command",className:(0,tO.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function tU({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:a=!1,...i}){return(0,f.jsxs)(tz.Dialog,{...i,children:[(0,f.jsxs)(tz.DialogHeader,{className:"sr-only",children:[(0,f.jsx)(tz.DialogTitle,{children:e}),(0,f.jsx)(tz.DialogDescription,{children:t})]}),(0,f.jsx)(tz.DialogContent,{className:(0,tO.cn)("overflow-hidden rounded-xl! p-0",r),showCloseButton:a,children:n})]})}function tK({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,f.jsxs)(tW,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,f.jsx)(tE.Input,{"data-slot":"command-input",className:(0,tO.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,f.jsx)(t$,{children:(0,f.jsx)(tB.SearchIcon,{className:"size-4 shrink-0 opacity-50"})})]})})}function tV({className:e,...t}){return(0,f.jsx)(tE.List,{"data-slot":"command-list",className:(0,tO.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function tq({className:e,...t}){return(0,f.jsx)(tE.Empty,{"data-slot":"command-empty",className:(0,tO.cn)("py-6 text-center text-sm",e),...t})}function tX({className:e,...t}){return(0,f.jsx)(tE.Group,{"data-slot":"command-group",className:(0,tO.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function tY({className:e,children:t,...n}){return(0,f.jsx)(tE.Item,{"data-slot":"command-item",className:(0,tO.cn)("group/command-item relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...n,children:t})}function tG({className:e,...t}){return(0,f.jsx)("span",{"data-slot":"command-shortcut",className:(0,tO.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",e),...t})}var tJ=e.i(640376),tZ=e.i(227634),tQ=e.i(938306),t0=e.i(31807);let t1={prefix:"channel",aliases:["ch","c"],label:"Channel",icon:tZ.Hash,search:e=>{let{channels:t,setActiveChannel:n}=t0.useChannelStore.getState(),r=e.toLowerCase();return t.filter(e=>e.name.toLowerCase().includes(r)).map(e=>({id:e.id,label:e.name,description:e.type,icon:tQ.MessageCircle,action:()=>n(e.id)}))}};var t2=e.i(592039),t3=e.i(511800),t5=e.i(327964);let t4={prefix:"issue",aliases:["i","bug"],label:"Issue",icon:t2.CircleDot,search:e=>{let{issues:t,setActiveIssue:n}=t5.useIssueStore.getState(),r=e.toLowerCase();return t.filter(e=>e.title.toLowerCase().includes(r)||e.description?.toLowerCase().includes(r)).map(e=>({id:e.id,label:e.title,description:e.status,icon:t3.AlertCircle,action:()=>n(e.id)}))}};var t6=e.i(984178),t9=e.i(381253),t8=e.i(691223),t7=e.i(437122);let ne=new Set(["ts","tsx","js","jsx","py","rs","go","java","c","cpp","h","css","scss","html","json","yaml","yml","md","sql","sh"]),nt={prefix:"file",aliases:["f","open"],label:"File",icon:t6.FileIcon,search:async e=>{let{openFile:t}=t8.useEditorStore.getState(),{workspaceId:n}=t0.useChannelStore.getState();if(!n)return[];let r=await (0,t7.fetchWithAuth)(`/api/workspaces/${n}/search/files?q=${encodeURIComponent(e)}`);return r.ok?((await r.json()).results??[]).map(e=>{var r;let a;return{id:e.path,label:e.name,description:e.path,icon:(r=e.path,a=r.split(".").pop()?.toLowerCase()??"",ne.has(a)?t9.FileCode:t6.FileIcon),action:()=>t(n,e.path)}}):[]}};var nn=e.i(451534);let nr=(0,e.i(433721).default)("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);var na=e.i(361031),ni=e.i(233297);let ns={prefix:"workspace",aliases:["w","ws"],label:"Workspace",icon:nn.FolderOpen,search:e=>{let{workspaces:t}=na.useWorkspaceStore.getState(),n=e.toLowerCase();return t.filter(e=>e.name.toLowerCase().includes(n)||e.boundDirs.some(e=>e.toLowerCase().includes(n))).map(e=>({id:e.id,label:e.name,description:e.boundDirs[0],icon:nr,action:()=>{let t=(0,ni.toStaticHref)(`/workspace/${e.id}`);window.location.href=t}}))}};var no=e.i(100559),nl=e.i(882469),nc=e.i(523592);let nd=[t1,t4,nt,ns,{prefix:"server",aliases:["s","sv"],label:"Server",icon:no.Server,search:e=>{let t=(0,nc.loadServers)(),n=(0,nc.loadActiveId)(),r=e.toLowerCase();return t.filter(e=>e.name.toLowerCase().includes(r)||e.url.toLowerCase().includes(r)).map(e=>({id:e.id,label:e.name+(e.id===n?" (active)":""),description:e.url,icon:nl.Globe,action:()=>{t8.useEditorStore.getState().resetEditorState(),(0,nc.saveActiveId)(e.id),(0,nc.setActiveServerCookie)(e.url),window.location.reload()}}))}}];function nu(e){for(let t of nd)for(let n of[t.prefix,...t.aliases])if(e===n+" "||e.startsWith(n+" "))return{provider:t,keyword:e.slice(n.length+1)};return null}var nm=e.i(244073);e.s(["CommandPalette",0,function(){let e=(0,nm.useTranslations)("commandPalette"),{open:t,setOpen:n,toggle:r,commands:a}=(0,tJ.useCommandPalette)(),[i,s]=(0,p.useState)("");(0,p.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),r())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]),(0,p.useEffect)(()=>{if(!t){s("");let e=document.querySelector("[cmdk-input]");e&&(e.value="")}},[t]);let o=(0,p.useMemo)(()=>nu(i),[i]),[l,c]=(0,p.useState)([]),[d,u]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=nu(i);if(!e){c([]),u(!1);return}let t=e.provider.search(e.keyword);if(t instanceof Promise){u(!0);let e=!1;return t.then(t=>{e||c(t)}).finally(()=>{e||u(!1)}),()=>{e=!0}}c(t),u(!1)},[i]);let m=(0,p.useMemo)(()=>{let e=new Map;for(let t of a){let n=e.get(t.group)??[];n.push(t),e.set(t.group,n)}return e},[a]),h=(0,p.useMemo)(()=>nd.map(e=>({id:`hint:${e.prefix}`,label:e.prefix,description:[...e.aliases].join(", "),icon:e.icon})),[]),g=!!o;return(0,f.jsx)(tU,{open:t,onOpenChange:n,title:e("title"),description:e("description"),children:(0,f.jsxs)(tH,{shouldFilter:!o,children:[(0,f.jsx)(tK,{placeholder:e("placeholder"),value:i,onValueChange:s}),(0,f.jsxs)(tV,{children:[(0,f.jsx)(tq,{children:e("empty")}),g&&(0,f.jsx)(tX,{heading:o.provider.label,children:d?(0,f.jsx)("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"..."}):0===l.length?(0,f.jsx)("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:e("noResults")}):l.slice(0,10).map(e=>(0,f.jsxs)(tY,{value:e.label,onSelect:()=>{n(!1),e.action()},children:[e.icon&&(0,f.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,f.jsx)("span",{className:"truncate min-w-0",children:e.label}),e.description&&(0,f.jsx)("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground truncate max-w-[200px]",children:e.description})]},e.id))}),!o&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(tX,{heading:"Search",children:h.map(e=>(0,f.jsxs)(tY,{value:e.label,className:"data-selected:bg-transparent! [&>svg:last-child]:hidden!",onSelect:()=>s(e.label+" "),children:[e.icon&&(0,f.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,f.jsx)("span",{className:"truncate min-w-0",children:e.label}),e.description&&(0,f.jsx)("span",{className:"ml-auto text-xs text-muted-foreground text-right shrink-0",children:e.description})]},e.id))}),[...m.entries()].map(([e,t])=>(0,f.jsx)(tX,{heading:e,children:t.map(e=>(0,f.jsxs)(tY,{value:e.label,onSelect:()=>{n(!1),e.action()},children:[e.icon&&(0,f.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,f.jsx)("span",{className:"truncate min-w-0",children:e.label}),e.shortcut&&(0,f.jsx)(tG,{children:e.shortcut})]},e.id))},e))]})]})]})})}],698679)}]);
@@ -1,16 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,236634,725487,668316,964873,9174,223328,865332,834691,315806,e=>{"use strict";e.s([],236634),e.i(8890);var t,a,s,i=e.i(764556),n=e.i(535270),r=e.i(277642),o=e.i(29905),l=e.i(969490),c=e.i(756432),d=e.i(267805);let u=i.createContext(void 0);function p(){let e=i.useContext(u);if(void 0===e)throw Error((0,d.default)(64));return e}e.s(["TabsRootContext",0,u,"useTabsRootContext",0,p],725487);let f=((t={}).activationDirection="data-activation-direction",t.orientation="data-orientation",t),h={tabActivationDirection:e=>({[f.activationDirection]:e})};e.s(["tabsStateAttributesMapping",0,h],668316);var m=e.i(344180);let x=i.forwardRef(function(e,t){let{className:a,defaultValue:s=0,onValueChange:d,orientation:p="horizontal",render:f,value:x,style:v,...b}=e,j=Object.hasOwn(e,"defaultValue"),y=i.useRef([]),[w,k]=i.useState(()=>new Map),[N,S]=(0,n.useControlled)({controlled:x,default:s,name:"Tabs",state:"value"}),C=void 0!==x,[T,R]=i.useState(()=>new Map),I=i.useCallback(e=>{if(void 0===e)return null;for(let[t,a]of T.entries())if(null!=a&&e===(a.value??a.index))return t;return null},[T]),[E,A]=i.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:O,tabActivationDirection:L}=E,M=L,P=!1;O!==N&&(M=g(O,N,p,T),P=null!=O&&null!=N&&null==I(N));let D=P?O:N,_=O!==D||L!==M;(0,r.useIsoLayoutEffect)(()=>{_&&A({previousValue:D,tabActivationDirection:M})},[D,_,M]);let z=(0,o.useStableCallback)((e,t)=>{t.activationDirection=g(N,e,p,T),d?.(e,t),t.isCanceled||S(e)}),W=(0,o.useStableCallback)((e,t)=>{k(a=>{if(a.get(e)===t)return a;let s=new Map(a);return s.set(e,t),s})}),F=(0,o.useStableCallback)((e,t)=>{k(a=>{if(!a.has(e)||a.get(e)!==t)return a;let s=new Map(a);return s.delete(e),s})}),B=i.useCallback(e=>w.get(e),[w]),H=i.useCallback(e=>{for(let t of T.values())if(e===t?.value)return t?.id},[T]),$=i.useMemo(()=>({getTabElementBySelectedValue:I,getTabIdByPanelValue:H,getTabPanelIdByValue:B,onValueChange:z,orientation:p,registerMountedTabPanel:W,setTabMap:R,unregisterMountedTabPanel:F,tabActivationDirection:M,value:N}),[I,H,B,z,p,W,R,F,M,N]),K=i.useMemo(()=>{for(let e of T.values())if(null!=e&&e.value===N)return e},[T,N]),q=i.useMemo(()=>{for(let e of T.values())if(null!=e&&!e.disabled)return e.value},[T]);(0,r.useIsoLayoutEffect)(()=>{if(C||0===T.size)return;let e=K?.disabled,t=null==K&&null!==N;if(j&&e&&N===s||!e&&!t)return;let a=q??null;N!==a&&(S(a),A(e=>"none"===e.tabActivationDirection?e:{...e,tabActivationDirection:"none"}))},[s,q,j,C,K,S,T,N]);let U={orientation:p,tabActivationDirection:M},Y=(0,l.useRenderElement)("div",e,{state:U,ref:t,props:b,stateAttributesMapping:h});return(0,m.jsx)(u.Provider,{value:$,children:(0,m.jsx)(c.CompositeList,{elementsRef:y,children:Y})})});function g(e,t,a,s){if(null==e||null==t)return"none";let i=null,n=null;for(let[a,r]of s.entries()){if(null==r)continue;let s=r.value??r.index;if(e===s&&(i=a),t===s&&(n=a),null!=i&&null!=n)break}if(null==i||null==n)return i!==n&&("number"==typeof e||"string"==typeof e)&&typeof e==typeof t?"horizontal"===a?t>e?"right":"left":t>e?"down":"up":"none";let r=i.getBoundingClientRect(),o=n.getBoundingClientRect();if("horizontal"===a){if(o.left<r.left)return"left";if(o.left>r.left)return"right"}else{if(o.top<r.top)return"up";if(o.top>r.top)return"down"}return"none"}e.s(["TabsRoot",0,x],964873);var v=e.i(526850),b=e.i(139236),j=e.i(931709);let y="data-composite-item-active";e.s(["ACTIVE_COMPOSITE_ITEM",0,y],9174);var w=e.i(530909);let k=i.createContext(void 0);function N(){let e=i.useContext(k);if(void 0===e)throw Error((0,d.default)(65));return e}e.s(["TabsListContext",0,k,"useTabsListContext",0,N],223328);var S=e.i(602453),C=e.i(742665),T=e.i(410421);let R=i.forwardRef(function(e,t){let{className:a,disabled:s=!1,render:n,value:o,id:c,nativeButton:d=!0,style:u,...f}=e,{value:h,getTabPanelIdByValue:m,orientation:x}=p(),{activateOnFocus:g,highlightedTabIndex:k,onTabActivation:R,registerTabResizeObserverElement:I,setHighlightedTabIndex:E,tabsListElement:A}=N(),O=(0,b.useBaseUiId)(c),L=i.useMemo(()=>({disabled:s,id:O,value:o}),[s,O,o]),{compositeProps:M,compositeRef:P,index:D}=(0,w.useCompositeItem)({metadata:L}),_=o===h,z=i.useRef(!1),W=i.useRef(null);i.useEffect(()=>{let e=W.current;if(e)return I(e)},[I]),(0,r.useIsoLayoutEffect)(()=>{if(z.current){z.current=!1;return}if(_&&D>-1&&k!==D){if(null!=A){let e=(0,T.activeElement)((0,v.ownerDocument)(A));if(e&&(0,T.contains)(A,e))return}s||E(D)}},[_,D,k,E,s,A]);let{getButtonProps:F,buttonRef:B}=(0,j.useButton)({disabled:s,native:d,focusableWhenDisabled:!0}),H=m(o),$=i.useRef(!1),K=i.useRef(!1);return(0,l.useRenderElement)("button",e,{state:{disabled:s,active:_,orientation:x},ref:[t,B,P,W],props:[M,{role:"tab","aria-controls":H,"aria-selected":_,id:O,onClick:function(e){_||s||R(o,(0,S.createChangeEventDetails)(C.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){_||(D>-1&&!s&&E(D),!s&&g&&(!$.current||$.current&&K.current)&&R(o,(0,S.createChangeEventDetails)(C.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){_||s||($.current=!0,e.button&&0!==e.button||(K.current=!0,(0,v.ownerDocument)(e.currentTarget).addEventListener("pointerup",function(){$.current=!1,K.current=!1},{once:!0})))},[y]:_?"":void 0,onKeyDownCapture(){z.current=!0}},f,F]})});e.s(["TabsTab",0,R],865332);var I=e.i(730774),E=e.i(517432);let A=((a={}).activeTabLeft="--active-tab-left",a.activeTabRight="--active-tab-right",a.activeTabTop="--active-tab-top",a.activeTabBottom="--active-tab-bottom",a.activeTabWidth="--active-tab-width",a.activeTabHeight="--active-tab-height",a);var O=e.i(394394);let L={...h,activeTabPosition:()=>null,activeTabSize:()=>null},M=i.forwardRef(function(e,t){let{className:a,render:s,renderBeforeHydration:n=!1,style:r,...o}=e,{nonce:c}=(0,O.useCSPContext)(),{getTabElementBySelectedValue:d,orientation:u,tabActivationDirection:f,value:h}=p(),{tabsListElement:x,registerIndicatorUpdateListener:g}=N(),v=(0,E.useIsHydrating)(),b=function(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}();i.useEffect(()=>g(b),[g,b]);let j=0,y=0,w=0,k=0,S=0,C=0,T=!1;if(null!=h&&null!=x){let e=d(h);if(T=!0,null!=e){let{width:t,height:a}=(0,I.getCssDimensions)(e),{width:s,height:i}=(0,I.getCssDimensions)(x),n=e.getBoundingClientRect(),r=x.getBoundingClientRect(),o=s>0?r.width/s:1,l=i>0?r.height/i:1;if(Math.abs(o)>Number.EPSILON&&Math.abs(l)>Number.EPSILON){let e=n.left-r.left,t=n.top-r.top;j=e/o+x.scrollLeft-x.clientLeft,w=t/l+x.scrollTop-x.clientTop}else j=e.offsetLeft,w=e.offsetTop;S=t,C=a,y=x.scrollWidth-j-S,k=x.scrollHeight-w-C}}let R=i.useMemo(()=>T?{left:j,right:y,top:w,bottom:k}:null,[j,y,w,k,T]),M=i.useMemo(()=>T?{width:S,height:C}:null,[S,C,T]),P=i.useMemo(()=>{if(T)return{[A.activeTabLeft]:`${j}px`,[A.activeTabRight]:`${y}px`,[A.activeTabTop]:`${w}px`,[A.activeTabBottom]:`${k}px`,[A.activeTabWidth]:`${S}px`,[A.activeTabHeight]:`${C}px`}},[j,y,w,k,S,C,T]),D=T&&S>0&&C>0,_=(0,l.useRenderElement)("span",e,{state:{orientation:u,activeTabPosition:R,activeTabSize:M,tabActivationDirection:f},ref:t,props:[{role:"presentation",style:P,hidden:!D},o,{suppressHydrationWarning:!0}],stateAttributesMapping:L});return null==h?null:(0,m.jsxs)(i.Fragment,{children:[_,v&&n&&(0,m.jsx)("script",{nonce:c,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});e.s(["TabsIndicator",0,M],834691);var P=e.i(677822),D=e.i(282458),_=e.i(273598),z=e.i(254891),W=e.i(296615);let F=((s={}).index="data-index",s.activationDirection="data-activation-direction",s.orientation="data-orientation",s.hidden="data-hidden",s[s.startingStyle=D.TransitionStatusDataAttributes.startingStyle]="startingStyle",s[s.endingStyle=D.TransitionStatusDataAttributes.endingStyle]="endingStyle",s),B={...h,...D.transitionStatusMapping},H=i.forwardRef(function(e,t){let{className:a,value:s,render:n,keepMounted:o=!1,style:c,...d}=e,{value:u,getTabIdByPanelValue:f,orientation:h,tabActivationDirection:m,registerMountedTabPanel:x,unregisterMountedTabPanel:g}=p(),v=(0,b.useBaseUiId)(),j=i.useMemo(()=>({id:v,value:s}),[v,s]),{ref:y,index:w}=(0,W.useCompositeListItem)({metadata:j}),k=s===u,{mounted:N,transitionStatus:S,setMounted:C}=(0,z.useTransitionStatus)(k),T=!N,R=f(s),I=i.useRef(null),E=(0,l.useRenderElement)("div",e,{state:{hidden:T,orientation:h,tabActivationDirection:m,transitionStatus:S},ref:[t,y,I],props:[{"aria-labelledby":R,hidden:T,id:v,role:"tabpanel",tabIndex:k?0:-1,inert:(0,P.inertValue)(!k),[F.index]:w},d],stateAttributesMapping:B});return((0,_.useOpenChangeComplete)({open:k,ref:I,onComplete(){k||C(!1)}}),(0,r.useIsoLayoutEffect)(()=>{if((!T||o)&&null!=v)return x(s,v),()=>{g(s,v)}},[T,o,s,v,x,g]),o||N)?E:null});e.s(["TabsPanel",0,H],315806)},568769,e=>{"use strict";e.s(["isElementDisabled",0,function(e){return null==e||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")}])},812057,e=>{"use strict";var t=e.i(344180);e.i(236634);var a=e.i(964873),s=e.i(865332),i=e.i(834691),n=e.i(315806);e.i(8890);var r=e.i(764556),o=e.i(29905),l=e.i(863728),c=e.i(756432),d=e.i(568769),u=e.i(204133),p=e.i(100229),f=e.i(877580),h=e.i(9174),m=e.i(410421);let x=[];var g=e.i(352360),v=e.i(969490),b=e.i(189131);function j(e){let{render:a,className:s,style:i,refs:n=l.EMPTY_ARRAY,props:j=l.EMPTY_ARRAY,state:y=l.EMPTY_OBJECT,stateAttributesMapping:w,highlightedIndex:k,onHighlightedIndexChange:N,orientation:S,dense:C,itemSizes:T,loopFocus:R,onLoop:I,cols:E,enableHomeAndEndKeys:A,onMapChange:O,stopEventPropagation:L=!0,rootRef:M,disabledIndices:P,modifierKeys:D,highlightItemOnHover:_=!1,tag:z="div",...W}=e,{props:F,highlightedIndex:B,onHighlightedIndexChange:H,elementsRef:$,onMapChange:K,relayKeyboardEvent:q}=function(e){let{itemSizes:t,cols:a=1,loopFocus:s=!0,onLoop:i,dense:n=!1,orientation:l="both",direction:c,highlightedIndex:g,onHighlightedIndexChange:v,rootRef:b,enableHomeAndEndKeys:j=!1,stopEventPropagation:y=!1,disabledIndices:w,modifierKeys:k=x}=e,[N,S]=r.useState(0),C=a>1,T=r.useRef(null),R=(0,u.useMergedRefs)(T,b),I=r.useRef([]),E=r.useRef(!1),A=g??N,O=(0,o.useStableCallback)((e,t=!1)=>{if((v??S)(e),t){let t=I.current[e];(0,p.scrollIntoViewIfNeeded)(T.current,t,c,l)}}),L=(0,o.useStableCallback)(e=>{if(0===e.size||E.current)return;E.current=!0;let t=Array.from(e.keys()),a=t.find(e=>e?.hasAttribute(h.ACTIVE_COMPOSITE_ITEM))??null,s=a?t.indexOf(a):-1;-1!==s&&O(s),(0,p.scrollIntoViewIfNeeded)(T.current,a,c,l)}),M=(0,o.useStableCallback)((e,t,a)=>i?i?.(e,t,a,I):a),P=r.useMemo(()=>({"aria-orientation":"both"===l?void 0:l,ref:R,onFocus(e){let t=T.current,a=(0,m.getTarget)(e.nativeEvent);t&&null!=a&&(0,p.isNativeInput)(a)&&a.setSelectionRange(0,a.value.length??0)},onKeyDown(e){let r=j?p.ALL_KEYS:p.ARROW_KEYS;if(!r.has(e.key)||function(e,t){for(let a of p.MODIFIER_KEYS.values())if(!t.includes(a)&&e.getModifierState(a))return!0;return!1}(e,k)||!T.current)return;let o="rtl"===c,u=o?p.ARROW_LEFT:p.ARROW_RIGHT,h={horizontal:u,vertical:p.ARROW_DOWN,both:u}[l],x=o?p.ARROW_RIGHT:p.ARROW_LEFT,g={horizontal:x,vertical:p.ARROW_UP,both:x}[l],v=(0,m.getTarget)(e.nativeEvent);if(null!=v&&(0,p.isNativeInput)(v)&&!(0,d.isElementDisabled)(v)){let t=v.selectionStart,a=v.selectionEnd,s=v.value??"";if(null==t||e.shiftKey||t!==a||e.key!==g&&t<s.length||e.key!==h&&t>0)return}let b=A,N=(0,f.getMinListIndex)(I,w),S=(0,f.getMaxListIndex)(I,w);if(C){let i=t||Array.from({length:I.current.length},()=>({width:1,height:1})),r=(0,f.createGridCellMap)(i,a,n),c=r.findIndex(e=>null!=e&&!(0,f.isListIndexDisabled)(I.current,e,w)),d=r.reduce((e,t,a)=>null==t||(0,f.isListIndexDisabled)(I.current,t,w)?e:a,-1);b=r[(0,f.getGridNavigatedIndex)(r.map(e=>null!=e?I.current[e]:null),{event:e,orientation:l,loopFocus:s,onLoop:M,cols:a,disabledIndices:(0,f.getGridCellIndices)([...w||I.current.map((e,t)=>(0,f.isListIndexDisabled)(I.current,t)?t:void 0),void 0],r),minIndex:c,maxIndex:d,prevIndex:(0,f.getGridCellIndexOfCorner)(A>S?N:A,i,r,a,e.key===p.ARROW_DOWN?"bl":e.key===p.ARROW_RIGHT?"tr":"tl"),rtl:o})]}let R={horizontal:[u],vertical:[p.ARROW_DOWN],both:[u,p.ARROW_DOWN]}[l],E={horizontal:[x],vertical:[p.ARROW_UP],both:[x,p.ARROW_UP]}[l],L=C?r:({horizontal:j?p.HORIZONTAL_KEYS_WITH_EXTRA_KEYS:p.HORIZONTAL_KEYS,vertical:j?p.VERTICAL_KEYS_WITH_EXTRA_KEYS:p.VERTICAL_KEYS,both:r})[l];j&&(e.key===p.HOME?b=N:e.key===p.END&&(b=S)),b===A&&(R.includes(e.key)||E.includes(e.key))&&(s&&b===S&&R.includes(e.key)?(b=N,i&&(b=i(e,A,b,I))):s&&b===N&&E.includes(e.key)?(b=S,i&&(b=i(e,A,b,I))):b=(0,f.findNonDisabledListIndex)(I.current,{startingIndex:b,decrement:E.includes(e.key),disabledIndices:w})),b===A||(0,f.isIndexOutOfListBounds)(I.current,b)||(y&&e.stopPropagation(),L.has(e.key)&&e.preventDefault(),O(b,!0),queueMicrotask(()=>{I.current[b]?.focus()}))}}),[a,n,c,w,I,j,A,C,t,s,i,M,R,k,O,l,y]);return r.useMemo(()=>({props:P,highlightedIndex:A,onHighlightedIndexChange:O,elementsRef:I,disabledIndices:w,onMapChange:L,relayKeyboardEvent:P.onKeyDown}),[P,A,O,I,w,L])}({itemSizes:T,cols:E,loopFocus:R,onLoop:I,dense:C,orientation:S,highlightedIndex:k,onHighlightedIndexChange:N,rootRef:M,stopEventPropagation:L,enableHomeAndEndKeys:A,direction:(0,b.useDirection)(),disabledIndices:P,modifierKeys:D}),U=(0,v.useRenderElement)(z,e,{state:y,ref:n,props:[F,...j,W],stateAttributesMapping:w}),Y=r.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:H,highlightItemOnHover:_,relayKeyboardEvent:q}),[B,H,_,q]);return(0,t.jsx)(g.CompositeRootContext.Provider,{value:Y,children:(0,t.jsx)(c.CompositeList,{elementsRef:$,onMapChange:e=>{O?.(e),K(e)},children:U})})}var y=e.i(668316),w=e.i(725487),k=e.i(223328);let N=r.forwardRef(function(e,a){let{activateOnFocus:s=!1,className:i,loopFocus:n=!0,render:c,style:d,...u}=e,{onValueChange:p,orientation:f,value:h,setTabMap:m,tabActivationDirection:x}=(0,w.useTabsRootContext)(),[g,v]=r.useState(0),[b,N]=r.useState(null),S=r.useRef(new Set),C=r.useRef(new Set),T=r.useRef(null),R=(0,o.useStableCallback)(()=>{S.current.forEach(e=>{e()})});r.useEffect(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{S.current.size&&R()});return T.current=e,b&&e.observe(b),C.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),T.current=null}},[b,R]);let I=(0,o.useStableCallback)(e=>(S.current.add(e),()=>{S.current.delete(e)})),E=(0,o.useStableCallback)(e=>(C.current.add(e),T.current?.observe(e),()=>{C.current.delete(e),T.current?.unobserve(e)})),A=(0,o.useStableCallback)((e,t)=>{e!==h&&p(e,t)}),O=r.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:g,registerIndicatorUpdateListener:I,registerTabResizeObserverElement:E,onTabActivation:A,setHighlightedTabIndex:v,tabsListElement:b}),[s,g,I,E,A,v,b]);return(0,t.jsx)(k.TabsListContext.Provider,{value:O,children:(0,t.jsx)(j,{render:c,className:i,style:d,state:{orientation:f,tabActivationDirection:x},refs:[a,N],props:[{"aria-orientation":"vertical"===f?"vertical":void 0,role:"tablist"},u],stateAttributesMapping:y.tabsStateAttributesMapping,highlightedIndex:g,enableHomeAndEndKeys:!0,loopFocus:n,orientation:f,onHighlightedIndexChange:v,onMapChange:m,disabledIndices:l.EMPTY_ARRAY})})});e.s(["Indicator",()=>i.TabsIndicator,"List",0,N,"Panel",()=>n.TabsPanel,"Root",()=>a.TabsRoot,"Tab",()=>s.TabsTab],227146);var S=e.i(227146),S=S,C=e.i(294237),T=e.i(465458);let R=(0,C.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});e.s(["Tabs",0,function({className:e,orientation:a="horizontal",...s}){return(0,t.jsx)(S.Root,{"data-slot":"tabs","data-orientation":a,className:(0,T.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...s})},"TabsContent",0,function({className:e,...a}){return(0,t.jsx)(S.Panel,{"data-slot":"tabs-content",className:(0,T.cn)("flex-1 text-sm outline-none",e),...a})},"TabsList",0,function({className:e,variant:a="default",...s}){return(0,t.jsx)(S.List,{"data-slot":"tabs-list","data-variant":a,className:(0,T.cn)(R({variant:a}),e),...s})},"TabsTrigger",0,function({className:e,...a}){return(0,t.jsx)(S.Tab,{"data-slot":"tabs-trigger",className:(0,T.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...a})}],812057)},600304,759309,e=>{"use strict";let t=(0,e.i(433721).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["default",0,t],759309),e.s(["Send",0,t],600304)},583705,e=>{"use strict";let t=(0,e.i(433721).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["Info",0,t],583705)},244996,444741,294543,e=>{"use strict";var t=e.i(433721);let a=(0,t.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,a],444741),e.s(["CheckCircle2",0,a],244996);let s=(0,t.default)("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"}]]);e.s(["default",0,s],294543)},896841,e=>{"use strict";var t=e.i(344180),a=e.i(764556),s=e.i(244073),i=e.i(191118),n=e.i(31807),r=e.i(327964),o=e.i(355819),l=e.i(361031),c=e.i(588591),d=e.i(62669),u=e.i(515104),p=e.i(226624),f=e.i(817854),h=e.i(451534),m=e.i(227634),x=e.i(191441);function g({icon:e,label:a,value:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0",children:a}),(0,t.jsx)("span",{className:"truncate text-foreground ml-auto",title:s,children:s})]})}function v({workspace:e,channelCount:i,issueCount:n}){let r=(0,s.useTranslations)("projectSettings"),[o,l]=(0,a.useState)(!1!==e.autoProcessIssues),[c,u]=(0,a.useState)(!1!==e.hooksEnabled),[b,j]=(0,a.useState)(!1),y=async t=>{if(!b){j(!0);try{let a=await fetch(`/api/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoProcessIssues:t})}),s=await a.json();l(!1!==s.autoProcessIssues)}finally{j(!1)}}},w=async t=>{if(!b){j(!0);try{let a=await fetch(`/api/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({hooksEnabled:t})}),s=await a.json();u(!1!==s.hooksEnabled)}finally{j(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:r("info.title")}),(0,t.jsx)(g,{icon:(0,t.jsx)(h.FolderOpen,{size:14}),label:r("info.path"),value:e.boundDirs[0]??"-"}),(0,t.jsx)(g,{icon:(0,t.jsx)(m.Hash,{size:14}),label:r("info.channels"),value:String(i)}),(0,t.jsx)(g,{icon:(0,t.jsx)(x.ListChecks,{size:14}),label:r("info.issues"),value:String(n)})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:r("automation.title")}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(f.Label,{htmlFor:"auto-process",className:"text-sm font-medium",children:r("automation.autoProcess")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r("automation.autoProcessDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"auto-process",checked:o,onCheckedChange:y,disabled:b})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Hooks"}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(f.Label,{htmlFor:"hooks-enabled",className:"text-sm font-medium",children:"Enable Hooks"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enable per-tool-call hooks for this workspace"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"hooks-enabled",checked:c,onCheckedChange:w,disabled:b})]})]})]})]})}var b=e.i(260218),j=e.i(681622),y=e.i(812057),w=e.i(209988),k=e.i(36539),k=k,N=e.i(325443),S=e.i(244996),C=e.i(294543),C=C,T=e.i(92457);let R=(0,e.i(433721).default)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);var I=e.i(601039),E=e.i(600304),A=e.i(360112);let O=[{value:"issue_started",labelKey:"events.issueStarted"},{value:"issue_completed",labelKey:"events.issueCompleted"},{value:"issue_task_completed",labelKey:"events.taskCompleted"},{value:"channel_agent_completed",labelKey:"events.channelAgentCompleted"}];function L(){return{enabled:!1,provider:"lark",events:["issue_started","issue_completed","issue_task_completed"],lark:{},wechat:{}}}let M=`{
2
- "scopes": {
3
- "tenant": [
4
- "contact:contact.base:readonly",
5
- "im:chat:readonly",
6
- "im:chat.members:read",
7
- "im:message",
8
- "im:message.group_at_msg:readonly",
9
- "im:message.group_msg",
10
- "im:message.p2p_msg:readonly",
11
- "im:message:send_as_bot",
12
- "im:resource"
13
- ],
14
- "user": []
15
- }
16
- }`;function P(){let[e,s]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(M).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})},children:[e?(0,t.jsx)(S.CheckCircle2,{className:"mr-1.5 h-3.5 w-3.5 text-emerald-600"}):null,e?"已复制":"复制批量权限配置"]}),(0,t.jsxs)("details",{className:"group",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"展开查看权限详情"}),(0,t.jsx)("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:M})]})]})}function D({workspaceId:e,workspace:i,notificationDraft:n,setNotificationDraft:r,setWorkspace:o,botAgents:c,agentDialogOpen:h,setAgentDialogOpen:m}){var x;let g=(0,s.useTranslations)("projectSettings"),v=(0,s.useTranslations)("common"),[M,_]=(0,a.useState)(!1),[z,W]=(0,a.useState)(!1),[F,B]=(0,a.useState)(!1),[H,$]=(0,a.useState)(!1),[K,q]=(0,a.useState)({status:"idle"}),U=(0,a.useRef)(!1),[Y,G]=(0,a.useState)("default"),[V,J]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(!1),Z=!!(n.wechat?.token&&n.wechat?.accountId),ee=(0,l.useWorkspaceStore)(e=>e.upsertWorkspace);(0,a.useEffect)(()=>{if(!n.enabled||"wechat"!==n.provider||!["wait","scaned"].includes(K.status))return;let t=window.setInterval(()=>{U.current||(U.current=!0,fetch(`/api/workspaces/${e}/notifications/wechat/qr?poll=1`,{method:"POST"}).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||"Failed to poll WeChat QR status");q({status:t.status??"wait",qrcodeImgContent:t.qrcodeImgContent??K.qrcodeImgContent,accountId:t.accountId,baseUrl:t.baseUrl}),t.workspace&&(o(t.workspace),r(t.workspace.notificationSettings??L()),A.toast.success(g("wechat.connectedToast")))}).catch(e=>{A.toast.error(g("wechat.pollFailed"),{description:e instanceof Error?e.message:void 0})}).finally(()=>{U.current=!1}))},2e3);return()=>window.clearInterval(t)},[n.enabled,n.provider,r,o,g,K.qrcodeImgContent,K.status,e]),(0,a.useEffect)(()=>{J((0,u.isNativeAndroidEnvironment)()),(0,u.getNotificationPermission)().then(G)},[]);let et=async t=>{if(!i||M)return null;_(!0);try{let a=await fetch(`/api/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationSettings:t})});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error||"Failed to save notification settings")}let s=await a.json();return o(s),ee(s),r(s.notificationSettings??L()),s}catch(e){return A.toast.error(g("notifications.saveFailed"),{description:e instanceof Error?e.message:void 0}),null}finally{_(!1)}},ea=e=>{let t={...n,...e,lark:{...n.lark,...e.lark},wechat:{...n.wechat,...e.wechat},native:{...n.native,...e.native}};r(t),et(t)},es=async()=>{if(!z){W(!0);try{if(!await et(n))throw Error("Failed to save notification settings");let t=await fetch(`/api/workspaces/${e}/notifications/start`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to start notification service")}let a=await t.json();a.workspace?(o(a.workspace),r(a.workspace.notificationSettings??L())):r({...n,serviceRunning:!0}),A.toast.success(g("notifications.startSuccess"))}catch(e){A.toast.error(g("notifications.startFailed"),{description:e instanceof Error?e.message:void 0})}finally{W(!1)}}},ei=async()=>{if(!z){W(!0);try{let t=await fetch(`/api/workspaces/${e}/notifications/stop`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to stop notification service")}let a=await t.json();a.workspace?(o(a.workspace),r(a.workspace.notificationSettings??L())):r({...n,serviceRunning:!1}),A.toast.success(g("notifications.stopSuccess"))}catch(e){A.toast.error(g("notifications.stopFailed"),{description:e instanceof Error?e.message:void 0})}finally{W(!1)}}},en=async()=>{if(!F){B(!0);try{let t=await fetch(`/api/workspaces/${e}/notifications/test`,{method:"POST"}),a=await t.json().catch(()=>null);if(!t.ok)throw Error(a?.reason||a?.error||"Failed to send test notification");A.toast.success(g("notifications.testSuccess"))}catch(e){A.toast.error(g("notifications.testFailed"),{description:e instanceof Error?e.message:void 0})}finally{B(!1)}}},er=async()=>{if(!H){$(!0);try{if(!await et({...n,provider:"wechat"}))throw Error("Failed to save notification settings");let t=await fetch(`/api/workspaces/${e}/notifications/wechat/qr${Z?"?refresh=1":""}`,{method:"POST"}),a=await t.json().catch(()=>null);if(!t.ok)throw Error(a?.error||"Failed to get WeChat QR code");q({status:a.status??"wait",qrcodeImgContent:a.qrcodeImgContent,accountId:a.accountId,baseUrl:a.baseUrl}),a.workspace&&(o(a.workspace),r(a.workspace.notificationSettings??L()))}catch(e){A.toast.error(g("wechat.getQrFailed"),{description:e instanceof Error?e.message:void 0})}finally{$(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:g("notifications.title")}),(0,t.jsxs)("div",{className:"space-y-4 rounded-md border px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(f.Label,{htmlFor:"message-notifications",className:"text-sm font-medium",children:g("notifications.messageNotifications")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.messageNotificationsDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[M&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"message-notifications",checked:n.enabled,onCheckedChange:e=>ea({enabled:e}),disabled:M})]})]}),n.enabled&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(y.Tabs,{value:n.provider,onValueChange:e=>ea({provider:e}),className:"flex flex-col",children:[(0,t.jsxs)(y.TabsList,{className:"grid w-full grid-cols-3",children:[(0,t.jsx)(y.TabsTrigger,{value:"lark",children:g("notifications.lark")}),(0,t.jsx)(y.TabsTrigger,{value:"wechat",children:g("notifications.wechat")}),(0,t.jsx)(y.TabsTrigger,{value:"native",children:g("notifications.native")})]}),(0,t.jsxs)(y.TabsContent,{value:"lark",className:"space-y-3 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"飞书 Bot 配置"}),(0,t.jsxs)(b.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>X(!0),children:[(0,t.jsx)(C.default,{className:"h-3.5 w-3.5"}),"部署教程"]})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(f.Label,{htmlFor:"lark-app-id",className:"text-xs text-muted-foreground",children:g("notifications.appId")}),(0,t.jsx)(j.Input,{id:"lark-app-id",value:n.lark?.appId??"",onChange:e=>r({...n,lark:{...n.lark,appId:e.target.value}}),placeholder:"cli_xxx",disabled:z})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(f.Label,{htmlFor:"lark-app-secret",className:"text-xs text-muted-foreground",children:g("notifications.appSecret")}),(0,t.jsx)(j.Input,{id:"lark-app-secret",type:"password",value:n.lark?.appSecret??"",onChange:e=>r({...n,lark:{...n.lark,appSecret:e.target.value}}),placeholder:"app secret",disabled:z})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:n.serviceRunning?"outline":"default",onClick:n.serviceRunning?ei:es,disabled:z||M||!n.lark?.appId||!n.lark?.appSecret,children:[z?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(E.Send,{className:"mr-2 h-3.5 w-3.5"}),n.serviceRunning?g("notifications.stopService"):g("notifications.startService")]}),(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:en,disabled:F||M||!n.serviceRunning,children:[F&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),g("notifications.testSend")]})]})]}),(0,t.jsxs)(y.TabsContent,{value:"wechat",className:"space-y-3 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[Z?(0,t.jsx)(S.CheckCircle2,{className:"h-4 w-4 text-emerald-600"}):(0,t.jsx)(R,{className:"h-4 w-4"}),g("wechat.robot")]}),(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:Z?g("wechat.connected",{accountId:n.wechat?.accountId??""}):"scaned"===K.status?g("wechat.scanned"):"expired"===K.status?g("wechat.expired"):g("wechat.scanQr")})]}),(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:er,disabled:H||M||z,children:[H?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(I.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),Z?g("wechat.refreshLogin"):g("wechat.getQr")]})]}),K.qrcodeImgContent&&!Z&&(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-dashed px-3 py-3",children:[(0,t.jsx)("img",{src:(x=K.qrcodeImgContent,`https://api.qrserver.com/v1/create-qr-code/?size=180x180&margin=8&data=${encodeURIComponent(x)}`),alt:"WeChat robot login QR code",className:"h-36 w-36 shrink-0 rounded border bg-white p-2"}),(0,t.jsxs)("div",{className:"min-w-0 space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:g("wechat.status",{status:"scaned"===K.status?"scanned":K.status})}),(0,t.jsx)("p",{className:"break-all",children:g("wechat.loginUrl",{url:K.qrcodeImgContent})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:n.serviceRunning?"outline":"default",onClick:n.serviceRunning?ei:es,disabled:z||M||!Z,children:[z?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(E.Send,{className:"mr-2 h-3.5 w-3.5"}),n.serviceRunning?g("notifications.stopService"):g("notifications.startService")]}),(0,t.jsxs)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:en,disabled:F||M||!n.serviceRunning,children:[F&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),g("notifications.testSend")]})]})]}),(0,t.jsxs)(y.TabsContent,{value:"native",className:"space-y-3 pt-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.nativeDescription")}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(T.Monitor,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsxs)("span",{className:"font-medium",children:["granted"===Y&&(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(S.CheckCircle2,{className:"h-4 w-4 text-emerald-600"}),g("notifications.nativePermissionGranted")]}),"denied"===Y&&g("notifications.nativePermissionDenied"),"default"===Y&&g("notifications.nativePermissionDefault"),"unsupported"===Y&&g("notifications.nativePermissionUnsupported")]})]}),"unsupported"!==Y&&"granted"!==Y&&(0,t.jsx)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:async()=>{let e=await (0,u.requestNotificationPermission)();G(e),"granted"===e?(ea({native:{permissionGranted:!0}}),A.toast.success(g("notifications.nativePermissionGrantedToast"))):"denied"===e&&A.toast.error(g("notifications.nativePermissionDeniedToast"))},disabled:"denied"===Y,children:g("notifications.nativeRequestPermission")})]}),V&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(f.Label,{htmlFor:"android-ongoing-task-notification",className:"text-sm font-medium",children:g("notifications.androidOngoingTaskNotification")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.androidOngoingTaskNotificationDescription")})]}),(0,t.jsx)(p.Switch,{id:"android-ongoing-task-notification",checked:n.native?.androidOngoingTaskNotification??!1,onCheckedChange:e=>ea({native:{permissionGranted:n.native?.permissionGranted,androidOngoingTaskNotification:e}}),disabled:M||"granted"!==Y})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(0,t.jsx)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:async()=>{try{await (0,u.sendNativeNotification)("Agent Spaces",g("notifications.nativeTestSuccess")),A.toast.success(g("notifications.nativeTestSent"),{duration:5e3})}catch(e){A.toast.error(`${g("notifications.nativeTestFailed")}: ${e instanceof Error?e.message:e}`,{duration:5e3})}},disabled:"granted"!==Y,children:g("notifications.testSend")})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(N.Bot,{className:"h-3.5 w-3.5"}),g("botAgent.title")]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:n.botAgentId??"",onChange:e=>{ea({botAgentId:e.target.value||void 0})},disabled:M,className:"h-8 min-w-0 flex-1 rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:[(0,t.jsx)("option",{value:"",children:g("botAgent.selectAgent")}),c.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,t.jsx)(b.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>m(!0),children:v("manage")})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(k.default,{className:"h-3.5 w-3.5"}),g("events.title")]}),(0,t.jsx)("div",{className:"grid gap-2",children:O.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)("input",{type:"checkbox",className:"h-4 w-4 accent-primary",checked:n.events.includes(e.value),onChange:t=>{var a,s;let i;return a=e.value,s=t.target.checked,i=new Set(n.events),void(s?i.add(a):i.delete(a),ea({events:Array.from(i)}))},disabled:M}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.value))})]})]})]}),(0,t.jsx)(w.Dialog,{open:Q,onOpenChange:X,children:(0,t.jsxs)(w.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsx)(w.DialogTitle,{children:"创建飞书 Bot"}),(0,t.jsx)(w.DialogDescription,{children:"首次使用?按以下步骤在飞书开放平台创建机器人应用"})]}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"1. 创建自建应用"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["前往"," ",(0,t.jsx)("a",{href:"https://open.feishu.cn/app",target:"_blank",rel:"noreferrer",className:"underline underline-offset-3 hover:text-foreground",children:"飞书开放平台"})," ","(海外版:"," ",(0,t.jsx)("a",{href:"https://open.larksuite.com/app",target:"_blank",rel:"noreferrer",className:"underline underline-offset-3 hover:text-foreground",children:"Lark 开放平台"}),"),点击「创建自建应用」并填写名称描述。"]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"2. 获取凭证"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入详情页,在「凭证与基础信息」中找到 App ID 和 App Secret,复制到上方的配置表单。"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"3. 启用机器人能力"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「添加应用能力」页面,启用「机器人」能力。这样应用才能接收和发送飞书消息。"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"4. 配置权限"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「权限管理」页面,点击下方按钮复制权限配置 JSON,然后在飞书开放平台通过「批量开通」粘贴即可一键添加所有权限:"}),(0,t.jsx)(P,{})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"5. 配置事件订阅(关键步骤)"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「事件与回调」页面:"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-4 text-muted-foreground",children:[(0,t.jsx)("li",{children:"事件订阅方式选择「使用长连接接收事件」(而非 Webhook,无需公网 IP)"}),(0,t.jsxs)("li",{children:["添加事件 ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"im.message.receive_v1"}),"(接收消息)"]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"6. 发布应用"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「版本管理与发布」→ 创建版本 → 提交审核。需要企业管理员在管理后台审核通过后,机器人才能正常使用。"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"版本审核通过并发布后,在飞书中搜索机器人名称添加到聊天,即可通过飞书向 Proma Agent 发送指令。"})]})]})]})})]})}var _=e.i(788010),z=e.i(583705),W=e.i(638322);function F({workspaceId:e,initialPrompt:i}){let n=(0,s.useTranslations)("projectSettings"),[r,o]=(0,a.useState)(i),[l,c]=(0,a.useState)(i),[u,p]=(0,a.useState)(!1),h=r!==l,m=async()=>{if(!u){p(!0);try{let t=await fetch(`/api/workspaces/${e}/prompt`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:r})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to save workspace prompt")}let a=await t.json();o(a.prompt),c(a.prompt),A.toast.success(n("prompt.saveSuccess"))}catch(e){A.toast.error(n("prompt.saveFailed"),{description:e instanceof Error?e.message:void 0})}finally{p(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:n("prompt.title")}),(0,t.jsxs)("div",{className:"space-y-3 rounded-md border px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(f.Label,{htmlFor:"workspace-prompt",className:"text-sm font-medium",children:n("prompt.workspacePrompt")}),(0,t.jsx)(W.TooltipProvider,{delay:200,children:(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{className:"inline-flex",children:(0,t.jsx)(z.Info,{className:"h-3.5 w-3.5 text-muted-foreground cursor-help"})}),(0,t.jsx)(W.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsx)("p",{children:n("prompt.description")})})]})})]}),(0,t.jsx)(_.Textarea,{id:"workspace-prompt",value:r,onChange:e=>o(e.target.value),className:"min-h-36 resize-y text-sm"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(b.Button,{type:"button",size:"sm",onClick:m,disabled:u||!h,children:[u&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),n("prompt.savePrompt")]})})]})]})}e.s(["ProjectSettingsPanel",0,function({workspaceId:e}){let p=(0,s.useTranslations)("projectSettings"),[f,h]=(0,a.useState)(null),[m,x]=(0,a.useState)(""),[g,b]=(0,a.useState)(!0),[j,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(L()),N=(0,n.useChannelStore)(e=>e.channels),S=(0,r.useIssueStore)(e=>e.issues),C=(0,o.useAgentStore)(e=>e.agents).filter(e=>"bot"===e.role&&!1!==e.enabled),T=(0,l.useWorkspaceStore)(e=>e.upsertWorkspace);return((0,a.useEffect)(()=>{Promise.all([fetch(`/api/workspaces/${e}`).then(e=>e.json()),fetch(`/api/workspaces/${e}/prompt`).then(e=>e.json())]).then(([t,a])=>{h(t),T(t),x(a.prompt??"");let s=t.notificationSettings??L();k(s),b(!1),(0,u.getNotificationPermission)().then(t=>{if("granted"===t&&"native"===s.provider&&!s.native?.permissionGranted){let t={...s,native:{...s.native,permissionGranted:!0}};k(t),fetch(`/api/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationSettings:t})}).then(e=>e.json()).then(e=>{h(e),T(e)})}})}).catch(()=>b(!1))},[e,T]),g)?(0,t.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:[(0,t.jsx)(d.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),p("loading")]}):f?(0,t.jsxs)(i.ScrollArea,{className:"h-full",children:[(0,t.jsx)("div",{className:"flex items-center px-2 py-1.5 border-b text-xs font-medium text-muted-foreground",children:(0,t.jsx)("span",{children:p("title")})}),(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsx)(v,{workspace:f,channelCount:N.length,issueCount:S.length}),(0,t.jsx)(D,{workspaceId:e,workspace:f,notificationDraft:w,setNotificationDraft:k,setWorkspace:h,botAgents:C,agentDialogOpen:j,setAgentDialogOpen:y}),(0,t.jsx)(F,{workspaceId:e,initialPrompt:m})]}),(0,t.jsx)(c.AgentDialog,{open:j,onOpenChange:y,roleFilter:"bot"})]}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:p("workspaceNotFound")})}],896841)},985646,e=>{e.n(e.i(896841))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,386041,e=>{"use strict";let t=(0,e.i(433721).default)("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"}]]);e.s(["Code2",0,t],386041)},194228,e=>{"use strict";let t=(0,e.i(433721).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],194228)},363156,e=>{"use strict";var t=e.i(816709);let i=/not a git repository/i;function r(e){return e instanceof Error&&i.test(e.message)}let s=(0,t.create)(e=>({status:null,diffs:[],selectedFile:null,log:[],branches:[],loading:!1,error:null,notGitRepo:!1,loadStatus:async t=>{try{let i=await fetch(`/api/workspaces/${t}/git/status`);if(!i.ok)throw Error(await i.text());let r=await i.json();e({status:r,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:r(t)})}},loadDiffs:async(t,i)=>{e({loading:!0});try{let r=i?`/api/workspaces/${t}/git/diff?path=${encodeURIComponent(i)}`:`/api/workspaces/${t}/git/diff`,s=await fetch(r);if(!s.ok)throw Error(await s.text());let a=await s.json();e({diffs:a,loading:!1,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),loading:!1,notGitRepo:r(t)})}},loadLog:async t=>{try{let i=await fetch(`/api/workspaces/${t}/git/log`);if(!i.ok)throw Error(await i.text());let r=await i.json();e({log:r,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:r(t)})}},loadBranches:async t=>{try{let i=await fetch(`/api/workspaces/${t}/git/branches`);if(!i.ok)throw Error(await i.text());let r=await i.json();e({branches:r,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:r(t)})}},initRepo:async t=>{try{let i=await fetch(`/api/workspaces/${t}/git/init`,{method:"POST"});if(!i.ok)throw Error(await i.text());e({error:null,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t)})}},commit:async(t,i)=>{try{let e=await fetch(`/api/workspaces/${t}/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:i})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},discard:async(t,i)=>{try{let e=await fetch(`/api/workspaces/${t}/git/discard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},discardAll:async t=>{try{let e=await fetch(`/api/workspaces/${t}/git/discard-all`,{method:"POST"});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},checkout:async(t,i)=>{try{let e=await fetch(`/api/workspaces/${t}/git/checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:i})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},push:async e=>{let t=await fetch(`/api/workspaces/${e}/git/push`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Push failed"}))).error)},pull:async e=>{let t=await fetch(`/api/workspaces/${e}/git/pull`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Pull failed"}))).error)},getRemotes:async e=>{let t=await fetch(`/api/workspaces/${e}/git/remotes`);if(!t.ok)throw Error(await t.text());return t.json()},addRemote:async(e,t,i)=>{let r=await fetch(`/api/workspaces/${e}/git/remotes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,url:i})});if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to add remote"}))).error)},selectFile:t=>e({selectedFile:t}),checkoutDetached:async(e,t)=>{let i=await fetch(`/api/workspaces/${e}/git/checkout-detached`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:t})});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error)},cherryPick:async(e,t)=>{let i=await fetch(`/api/workspaces/${e}/git/cherry-pick`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:t})});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error)},createBranch:async(e,t,i)=>{let r=await fetch(`/api/workspaces/${e}/git/create-branch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,startPoint:i})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error)},deleteBranch:async(e,t,i)=>{let r=await fetch(`/api/workspaces/${e}/git/delete-branch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,force:i})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error)},createTag:async(e,t,i)=>{let r=await fetch(`/api/workspaces/${e}/git/create-tag`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,commitHash:i})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error)},getCommitDiff:async(e,t)=>{let i=await fetch(`/api/workspaces/${e}/git/commit-diff?hash=${encodeURIComponent(t)}`);if(!i.ok)throw Error((await i.json().catch(()=>({}))).error);return i.json()},getRemoteUrl:async e=>{let t=await fetch(`/api/workspaces/${e}/git/remote-url`);if(!t.ok)throw Error((await t.json().catch(()=>({}))).error);return(await t.json()).url},getMergeBase:async e=>{let t=await fetch(`/api/workspaces/${e}/git/merge-base`);if(!t.ok)throw Error((await t.json().catch(()=>({}))).error);return(await t.json()).hash}}));e.s(["useGitStore",0,s])},253307,e=>{"use strict";let t=(0,e.i(433721).default)("file-diff",[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);e.s(["FileDiff",0,t],253307)},524360,e=>{"use strict";var t=e.i(816709),i=e.i(360112);let r=new Map,s=(0,t.create)((e,t)=>({sessions:[],activeId:null,ws:null,workspaceId:null,_initialized:!1,_restored:!1,init:(s,a)=>{let o=t();if(o._initialized&&o.ws===s)return;let n=o.workspaceId!==s.workspaceId;n&&r.clear(),e({ws:s,workspaceId:s.workspaceId,sessions:n?[]:o.sessions,activeId:n?null:o.activeId,_initialized:!0,_restored:!1}),s.on("terminal.created",t=>{let{sessionId:i,cwd:r,shell:s}=t;e(e=>e.sessions.some(e=>e.id===i)?e:{sessions:[...e.sessions,{id:i,cwd:r,shell:s}],activeId:i})}),s.on("terminal.error",e=>{let{error:t}=e;i.toast.error(t)}),s.on("terminal.closed",t=>{let{sessionId:i}=t;e(e=>{let t=e.sessions.filter(e=>e.id!==i),r=e.activeId===i?t[0]?.id??null:e.activeId;return{sessions:t,activeId:r}})}),s.on("terminal.sessions",t=>{let{sessions:i}=t;e(e=>{let t=new Map(e.sessions.map(e=>[e.id,e])),s=i.map(e=>{let i=t.get(e.sessionId);return e.buffer&&r.set(e.sessionId,e.buffer),{...i,id:e.sessionId,cwd:e.cwd,shell:e.shell??i?.shell}}),a=!!e.activeId&&s.some(t=>t.id===e.activeId);for(let e of i)e.buffer||r.delete(e.sessionId);return{sessions:s,activeId:a?e.activeId:s[0]?.id??null,_restored:!0}}),a?.()})},createSession:(e,i)=>{let{ws:r}=t();r?.send("terminal.create",{sessionId:crypto.randomUUID?.()??crypto.getRandomValues(new Uint8Array(16)).reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),shell:e,cwd:i})},setActive:t=>e({activeId:t}),setSessionName:(t,i)=>e(e=>({sessions:e.sessions.map(e=>e.id===t?{...e,name:i}:e)})),removeSession:i=>{let{ws:r,sessions:s,activeId:a}=t();r?.send("terminal.close",{sessionId:i});let o=s.filter(e=>e.id!==i),n=a===i?o[0]?.id??null:a;e({sessions:o,activeId:n})},sendInput:(e,i)=>{t().ws?.send("terminal.input",{sessionId:e,data:i})},resize:(e,i,r)=>{t().ws?.send("terminal.resize",{sessionId:e,cols:i,rows:r})}}));e.s(["consumeSessionBuffer",0,function(e){let t=r.get(e);return r.delete(e),t},"useTerminalStore",0,s])},191441,e=>{"use strict";let t=(0,e.i(433721).default)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["ListChecks",0,t],191441)},404175,e=>{"use strict";var t=e.i(344180),i=e.i(227634),r=e.i(191441),s=e.i(451534),a=e.i(386041),o=e.i(426022),n=e.i(989484);let l=(0,e.i(433721).default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var c=e.i(253307),d=e.i(194228),h=e.i(210),p=e.i(255742);let u=[{id:"channel-list",icon:i.Hash,group:"channel"},{id:"chat",icon:o.MessageSquare,group:"channel"},{id:"issue-list",icon:r.ListChecks,group:"issue"},{id:"issue-detail",icon:c.FileDiff,group:"issue"},{id:"workfolder",icon:s.FolderOpen,group:"workfolder"},{id:"code-editor",icon:a.Code2,group:"workfolder"},{id:"terminal",icon:l,group:"tools"},{id:"git-commits",icon:d.GitCommitHorizontal,group:"git"},{id:"project-settings",icon:h.Settings2,group:"settings"},{id:"code-favorites",icon:p.Star,group:"workfolder"}],f={"channel-list":(0,t.jsx)(i.Hash,{size:16}),"issue-list":(0,t.jsx)(r.ListChecks,{size:16}),workfolder:(0,t.jsx)(s.FolderOpen,{size:16}),"code-editor":(0,t.jsx)(a.Code2,{size:16}),chat:(0,t.jsx)(o.MessageSquare,{size:16}),"issue-detail":(0,t.jsx)(n.FileText,{size:16}),terminal:(0,t.jsx)(l,{size:16}),"git-commits":(0,t.jsx)(d.GitCommitHorizontal,{size:16}),"project-settings":(0,t.jsx)(h.Settings2,{size:16}),"code-favorites":(0,t.jsx)(p.Star,{size:16}),...{}};function g(e,i,r,s,a){if("git-commits"===e&&i&&!i.clean){let e=i.insertions>0||i.deletions>0,r=(0,t.jsx)("span",{className:"ml-1 text-[10px] font-medium leading-none flex items-center gap-0.5",children:e?(0,t.jsxs)(t.Fragment,{children:[i.insertions>0&&(0,t.jsxs)("span",{className:"text-green-600",children:["+",i.insertions]}),i.deletions>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",i.deletions]})]}):(0,t.jsx)("span",{className:"text-orange-500",children:i.files.length})}),s=i.files.length;return{trailing:r,badge:s>0?(0,t.jsx)("span",{className:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] rounded-full bg-blue-500 text-white text-[9px] font-medium leading-none flex items-center justify-center px-0.5",children:s}):null}}if("terminal"===e&&r.length>0)return{trailing:null,badge:(0,t.jsx)("span",{className:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] rounded-full bg-green-500 text-white text-[9px] font-medium leading-none flex items-center justify-center px-0.5",children:r.length})};let o=(0,t.jsxs)("span",{className:"absolute -top-1 -right-1 flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]});return"channel-list"===e&&Object.values(s).some(e=>e.some(e=>"streaming"===e.status||"pending"===e.status))||"issue-detail"===e&&a.some(e=>"pending"===e.status||"running"===e.status||"retrying"===e.status||"waiting_review"===e.status)?{trailing:null,badge:o}:{trailing:null,badge:null}}e.s(["RIGHT_TO_LEFT_TAB_MAP",0,{"code-editor":"workfolder",chat:"channel-list","issue-detail":"issue-list"},"TAB_ITEMS",0,u,"getTabBadge",0,g,"renderTabIcon",0,function(e,i,r,s,a,o){let n=f[e];if(!n)return null;let{trailing:l,badge:c}=g(e,r,s,a,o);return(0,t.jsxs)("span",{title:i,className:"flex items-center justify-center",children:[(0,t.jsxs)("span",{className:"relative",children:[n,c]}),l]})}],404175)},217061,e=>{"use strict";var t=e.i(344180),i=e.i(250226),r=e.i(363156),s=e.i(524360),a=e.i(31807),o=e.i(873111),n=e.i(465458),l=e.i(404175);e.s(["MobileTabBar",0,function(){let{activePanel:e,setActivePanel:c}=(0,i.useMobilePanelStore)(),d=(0,r.useGitStore)(e=>e.status),h=(0,s.useTerminalStore)(e=>e.sessions),p=(0,a.useChannelStore)(e=>e.messages),u=(0,o.useTaskStore)(e=>e.tasks);return(0,t.jsx)("div",{className:"relative shrink-0 bg-background",children:(0,t.jsx)("div",{className:"flex items-center h-10 border-b px-1 gap-2 shrink-0 overflow-x-auto overflow-y-visible md:hidden",children:l.TAB_ITEMS.map((i,r)=>{let s=i.icon,a=r>0?l.TAB_ITEMS[r-1].group:null,o=null!==a&&a!==i.group,{trailing:f,badge:g}=(0,l.getTabBadge)(i.id,d,h,p,u);return(0,t.jsxs)("div",{className:"flex items-center shrink-0 overflow-visible",children:[o&&(0,t.jsx)("div",{className:"w-px h-4 bg-border mx-0.5"}),(0,t.jsxs)("button",{onClick:()=>{var e;c(e=i.id),l.RIGHT_TO_LEFT_TAB_MAP[e]},className:(0,n.cn)("relative flex items-center justify-center h-8 min-w-8 px-1 rounded-md transition-colors",e===i.id?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(s,{size:16}),g]}),f]})]},i.id)})})})}])},404069,e=>{e.n(e.i(217061))}]);