@winspan/claude-forge 3.7.7 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/autopilot/quality-gate-utils.d.ts +6 -0
  2. package/dist/autopilot/quality-gate-utils.d.ts.map +1 -0
  3. package/dist/autopilot/quality-gate-utils.js +48 -0
  4. package/dist/autopilot/quality-gate-utils.js.map +1 -0
  5. package/dist/autopilot/quality-gate.d.ts +0 -8
  6. package/dist/autopilot/quality-gate.d.ts.map +1 -1
  7. package/dist/autopilot/quality-gate.js +6 -61
  8. package/dist/autopilot/quality-gate.js.map +1 -1
  9. package/dist/cli/commands/convention.d.ts.map +1 -1
  10. package/dist/cli/commands/convention.js +1 -115
  11. package/dist/cli/commands/convention.js.map +1 -1
  12. package/dist/cli/commands/init/index.d.ts.map +1 -1
  13. package/dist/cli/commands/init/index.js +0 -14
  14. package/dist/cli/commands/init/index.js.map +1 -1
  15. package/dist/cli/commands/init/project-doctor.d.ts.map +1 -1
  16. package/dist/cli/commands/init/project-doctor.js +0 -63
  17. package/dist/cli/commands/init/project-doctor.js.map +1 -1
  18. package/dist/cli/tui.d.ts.map +1 -1
  19. package/dist/cli/tui.js +7 -131
  20. package/dist/cli/tui.js.map +1 -1
  21. package/dist/constants.d.ts +0 -6
  22. package/dist/constants.d.ts.map +1 -1
  23. package/dist/constants.js +0 -6
  24. package/dist/constants.js.map +1 -1
  25. package/dist/convention/convention-loader.js +2 -2
  26. package/dist/convention/convention-loader.js.map +1 -1
  27. package/dist/convention/convention-manager.d.ts +24 -2
  28. package/dist/convention/convention-manager.d.ts.map +1 -1
  29. package/dist/convention/convention-manager.js +62 -4
  30. package/dist/convention/convention-manager.js.map +1 -1
  31. package/dist/convention/index.d.ts +1 -2
  32. package/dist/convention/index.d.ts.map +1 -1
  33. package/dist/convention/index.js +0 -1
  34. package/dist/convention/index.js.map +1 -1
  35. package/dist/convention/types.d.ts +4 -14
  36. package/dist/convention/types.d.ts.map +1 -1
  37. package/dist/daemon/engine-registry/init-governance.d.ts +10 -0
  38. package/dist/daemon/engine-registry/init-governance.d.ts.map +1 -0
  39. package/dist/daemon/engine-registry/init-governance.js +22 -0
  40. package/dist/daemon/engine-registry/init-governance.js.map +1 -0
  41. package/dist/daemon/engine-registry.d.ts.map +1 -1
  42. package/dist/daemon/engine-registry.js +5 -6
  43. package/dist/daemon/engine-registry.js.map +1 -1
  44. package/dist/daemon/handler-context.d.ts +4 -2
  45. package/dist/daemon/handler-context.d.ts.map +1 -1
  46. package/dist/daemon/handlers/post-tool-use-handler.d.ts.map +1 -1
  47. package/dist/daemon/handlers/post-tool-use-handler.js +47 -11
  48. package/dist/daemon/handlers/post-tool-use-handler.js.map +1 -1
  49. package/dist/daemon/handlers/pre-tool-use-handler.d.ts.map +1 -1
  50. package/dist/daemon/handlers/pre-tool-use-handler.js +32 -22
  51. package/dist/daemon/handlers/pre-tool-use-handler.js.map +1 -1
  52. package/dist/daemon/handlers/session-cleanup.d.ts +0 -4
  53. package/dist/daemon/handlers/session-cleanup.d.ts.map +1 -1
  54. package/dist/daemon/handlers/session-cleanup.js +0 -81
  55. package/dist/daemon/handlers/session-cleanup.js.map +1 -1
  56. package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts.map +1 -1
  57. package/dist/daemon/handlers/stages/07-pipeline-reply.js +5 -1
  58. package/dist/daemon/handlers/stages/07-pipeline-reply.js.map +1 -1
  59. package/dist/daemon/handlers/stages/09-pipeline-active.d.ts.map +1 -1
  60. package/dist/daemon/handlers/stages/09-pipeline-active.js +5 -1
  61. package/dist/daemon/handlers/stages/09-pipeline-active.js.map +1 -1
  62. package/dist/daemon/handlers/stages/13-template-route.d.ts.map +1 -1
  63. package/dist/daemon/handlers/stages/13-template-route.js +5 -1
  64. package/dist/daemon/handlers/stages/13-template-route.js.map +1 -1
  65. package/dist/daemon/handlers/stages/18-complex-task.d.ts +5 -2
  66. package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +1 -1
  67. package/dist/daemon/handlers/stages/18-complex-task.js +87 -9
  68. package/dist/daemon/handlers/stages/18-complex-task.js.map +1 -1
  69. package/dist/daemon/handlers/stop-handler.d.ts.map +1 -1
  70. package/dist/daemon/handlers/stop-handler.js +1 -13
  71. package/dist/daemon/handlers/stop-handler.js.map +1 -1
  72. package/dist/daemon/index.d.ts.map +1 -1
  73. package/dist/daemon/index.js +15 -0
  74. package/dist/daemon/index.js.map +1 -1
  75. package/dist/goal/goal-classifier.d.ts.map +1 -1
  76. package/dist/goal/goal-classifier.js +12 -5
  77. package/dist/goal/goal-classifier.js.map +1 -1
  78. package/dist/goal/goal-types.d.ts +1 -3
  79. package/dist/goal/goal-types.d.ts.map +1 -1
  80. package/dist/goal/index.d.ts +1 -1
  81. package/dist/goal/index.d.ts.map +1 -1
  82. package/dist/governance/contract-builder.d.ts +39 -0
  83. package/dist/governance/contract-builder.d.ts.map +1 -0
  84. package/dist/governance/contract-builder.js +216 -0
  85. package/dist/governance/contract-builder.js.map +1 -0
  86. package/dist/governance/engine.d.ts +33 -0
  87. package/dist/governance/engine.d.ts.map +1 -0
  88. package/dist/governance/engine.js +183 -0
  89. package/dist/governance/engine.js.map +1 -0
  90. package/dist/governance/evidence-collector.d.ts +42 -0
  91. package/dist/governance/evidence-collector.d.ts.map +1 -0
  92. package/dist/governance/evidence-collector.js +136 -0
  93. package/dist/governance/evidence-collector.js.map +1 -0
  94. package/dist/governance/plugins/correction-plugin.d.ts +20 -0
  95. package/dist/governance/plugins/correction-plugin.d.ts.map +1 -0
  96. package/dist/governance/plugins/correction-plugin.js +113 -0
  97. package/dist/governance/plugins/correction-plugin.js.map +1 -0
  98. package/dist/governance/plugins/guidance-plugin.d.ts +21 -0
  99. package/dist/governance/plugins/guidance-plugin.d.ts.map +1 -0
  100. package/dist/governance/plugins/guidance-plugin.js +69 -0
  101. package/dist/governance/plugins/guidance-plugin.js.map +1 -0
  102. package/dist/governance/plugins/memory-plugin.d.ts +22 -0
  103. package/dist/governance/plugins/memory-plugin.d.ts.map +1 -0
  104. package/dist/governance/plugins/memory-plugin.js +106 -0
  105. package/dist/governance/plugins/memory-plugin.js.map +1 -0
  106. package/dist/governance/plugins/policy-plugin.d.ts +16 -0
  107. package/dist/governance/plugins/policy-plugin.d.ts.map +1 -0
  108. package/dist/governance/plugins/policy-plugin.js +69 -0
  109. package/dist/governance/plugins/policy-plugin.js.map +1 -0
  110. package/dist/governance/plugins/verification-plugin.d.ts +15 -0
  111. package/dist/governance/plugins/verification-plugin.d.ts.map +1 -0
  112. package/dist/governance/plugins/verification-plugin.js +65 -0
  113. package/dist/governance/plugins/verification-plugin.js.map +1 -0
  114. package/dist/governance/types.d.ts +202 -0
  115. package/dist/governance/types.d.ts.map +1 -0
  116. package/dist/governance/types.js +10 -0
  117. package/dist/governance/types.js.map +1 -0
  118. package/dist/pipeline/completion-engine.js +7 -7
  119. package/dist/pipeline/completion-engine.js.map +1 -1
  120. package/dist/pipeline/completion-gate.js +3 -3
  121. package/dist/pipeline/completion-gate.js.map +1 -1
  122. package/dist/pipeline/diagnosis-service.d.ts +2 -1
  123. package/dist/pipeline/diagnosis-service.d.ts.map +1 -1
  124. package/dist/pipeline/diagnosis-service.js.map +1 -1
  125. package/dist/pipeline/dynamic-node-executor.js +1 -1
  126. package/dist/pipeline/dynamic-node-executor.js.map +1 -1
  127. package/dist/pipeline/execution-engine.d.ts +1 -6
  128. package/dist/pipeline/execution-engine.d.ts.map +1 -1
  129. package/dist/pipeline/execution-engine.js +1 -1
  130. package/dist/pipeline/execution-engine.js.map +1 -1
  131. package/dist/pipeline/execution-plan.js +1 -1
  132. package/dist/pipeline/execution-plan.js.map +1 -1
  133. package/dist/pipeline/i-node-executor.d.ts +4 -0
  134. package/dist/pipeline/i-node-executor.d.ts.map +1 -1
  135. package/dist/pipeline/node-type-evolver.js +1 -1
  136. package/dist/pipeline/node-type-evolver.js.map +1 -1
  137. package/dist/pipeline/node-type-sync.d.ts.map +1 -1
  138. package/dist/pipeline/node-type-sync.js +10 -43
  139. package/dist/pipeline/node-type-sync.js.map +1 -1
  140. package/dist/pipeline/pattern-types.d.ts +3 -1
  141. package/dist/pipeline/pattern-types.d.ts.map +1 -1
  142. package/dist/retrospective/types.d.ts +2 -4
  143. package/dist/retrospective/types.d.ts.map +1 -1
  144. package/dist/skill-registry/evolver/index.js +6 -2
  145. package/dist/skill-registry/evolver/index.js.map +1 -1
  146. package/dist/skill-registry/index.d.ts +5 -0
  147. package/dist/skill-registry/index.d.ts.map +1 -1
  148. package/dist/skill-registry/index.js +6 -0
  149. package/dist/skill-registry/index.js.map +1 -1
  150. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts.map +1 -1
  151. package/dist/storage/repositories/dynamic-pipeline-repository.js +18 -6
  152. package/dist/storage/repositories/dynamic-pipeline-repository.js.map +1 -1
  153. package/dist/storage/repositories/node-attempt-repository.d.ts +1 -1
  154. package/dist/storage/repositories/node-attempt-repository.d.ts.map +1 -1
  155. package/dist/storage/repositories/node-attempt-repository.js +1 -1
  156. package/dist/storage/repositories/node-attempt-repository.js.map +1 -1
  157. package/dist/storage/repositories/pipeline-plan-repository.d.ts.map +1 -1
  158. package/dist/storage/repositories/pipeline-plan-repository.js +1 -1
  159. package/dist/storage/repositories/pipeline-plan-repository.js.map +1 -1
  160. package/dist/storage/repositories/template-evolution-repository.d.ts.map +1 -1
  161. package/dist/storage/repositories/template-evolution-repository.js.map +1 -1
  162. package/dist/web/routes/pipelines.d.ts.map +1 -1
  163. package/dist/web/routes/pipelines.js +16 -5
  164. package/dist/web/routes/pipelines.js.map +1 -1
  165. package/dist/web/routes/quality.d.ts.map +1 -1
  166. package/dist/web/routes/quality.js +18 -17
  167. package/dist/web/routes/quality.js.map +1 -1
  168. package/dist/web/server.d.ts.map +1 -1
  169. package/dist/web/server.js +0 -7
  170. package/dist/web/server.js.map +1 -1
  171. package/dist/web/sse-broadcaster.d.ts +1 -1
  172. package/dist/web/sse-broadcaster.d.ts.map +1 -1
  173. package/dist/web/sse-broadcaster.js.map +1 -1
  174. package/dist/web-static/assets/Analytics-Bo_OyY9A.js +36 -0
  175. package/dist/web-static/assets/BatchProgress-qW-6664M.js +1 -0
  176. package/dist/web-static/assets/Breadcrumb-C1Mua6se.js +1 -0
  177. package/dist/web-static/assets/Config-Dn-dtdo9.js +1 -0
  178. package/dist/web-static/assets/ConfirmDialog-bdDaAlT1.js +1 -0
  179. package/dist/web-static/assets/Conventions-ByV7r45c.js +1 -0
  180. package/dist/web-static/assets/Dashboard-C-7N8kYZ.js +1 -0
  181. package/dist/web-static/assets/ErrorState-CMLoMrQY.js +1 -0
  182. package/dist/web-static/assets/Events-DHuyQHQe.js +1 -0
  183. package/dist/web-static/assets/Evolution-Dzr5xOLD.js +1 -0
  184. package/dist/web-static/assets/Knowledge-ClwX4cnr.js +2 -0
  185. package/dist/web-static/assets/MiniCharts-DsV2Sqfk.js +1 -0
  186. package/dist/web-static/assets/NodeTypes-DFt8b5gi.js +1 -0
  187. package/dist/web-static/assets/Pagination-CR-eJz36.js +1 -0
  188. package/dist/web-static/assets/PipelineDetail-By1HJlaB.js +4 -0
  189. package/dist/web-static/assets/Pipelines--MGzCPtR.js +2 -0
  190. package/dist/web-static/assets/ProjectDetail-CrpekCeY.js +1 -0
  191. package/dist/web-static/assets/Projects-Dw1qYmjz.js +1 -0
  192. package/dist/web-static/assets/Quality-CYwODfQP.js +3 -0
  193. package/dist/web-static/assets/SessionDetail-c8MYnwnk.js +1 -0
  194. package/dist/web-static/assets/Sessions-BkDd4Mxb.js +2 -0
  195. package/dist/web-static/assets/Skeleton-DbL04wuz.js +1 -0
  196. package/dist/web-static/assets/Skills-2OPSAnaU.js +1 -0
  197. package/dist/web-static/assets/TemplateDetail-DbifRj4h.js +1 -0
  198. package/dist/web-static/assets/Templates-CDw-GGp8.js +1 -0
  199. package/dist/web-static/assets/Toast-CrwuIbKC.js +1 -0
  200. package/dist/web-static/assets/client-C_VWY70M.js +1 -0
  201. package/dist/web-static/assets/index-DD2Z15TY.css +2 -0
  202. package/dist/web-static/assets/index-DR3AaQnu.js +2 -0
  203. package/dist/web-static/assets/ui-DpI1N3yJ.js +1 -0
  204. package/dist/web-static/assets/useDebounce-BLryFdeo.js +1 -0
  205. package/dist/web-static/assets/vendor-2ObLXPrQ.js +9 -0
  206. package/dist/web-static/assets/vendor-motion-BryL_tAt.js +9 -0
  207. package/dist/web-static/assets/vendor-query-CjmRaY7o.js +4 -0
  208. package/dist/web-static/assets/vendor-react-DZi7brq3.js +11 -0
  209. package/dist/web-static/index.html +10 -13
  210. package/package.json +4 -8
  211. package/dist/convention/convention-distiller.d.ts +0 -28
  212. package/dist/convention/convention-distiller.d.ts.map +0 -1
  213. package/dist/convention/convention-distiller.js +0 -172
  214. package/dist/convention/convention-distiller.js.map +0 -1
  215. package/dist/convention/official-sync.d.ts +0 -21
  216. package/dist/convention/official-sync.d.ts.map +0 -1
  217. package/dist/convention/official-sync.js +0 -196
  218. package/dist/convention/official-sync.js.map +0 -1
  219. package/dist/daemon/handlers/stages/19-moderate-task.d.ts +0 -11
  220. package/dist/daemon/handlers/stages/19-moderate-task.d.ts.map +0 -1
  221. package/dist/daemon/handlers/stages/19-moderate-task.js +0 -78
  222. package/dist/daemon/handlers/stages/19-moderate-task.js.map +0 -1
  223. package/dist/web/routes/conventions.d.ts +0 -8
  224. package/dist/web/routes/conventions.d.ts.map +0 -1
  225. package/dist/web/routes/conventions.js +0 -308
  226. package/dist/web/routes/conventions.js.map +0 -1
  227. package/dist/web/routes/logs.d.ts +0 -4
  228. package/dist/web/routes/logs.d.ts.map +0 -1
  229. package/dist/web/routes/logs.js +0 -77
  230. package/dist/web/routes/logs.js.map +0 -1
  231. package/dist/web/routes/project-conventions.d.ts +0 -7
  232. package/dist/web/routes/project-conventions.d.ts.map +0 -1
  233. package/dist/web/routes/project-conventions.js +0 -145
  234. package/dist/web/routes/project-conventions.js.map +0 -1
  235. package/dist/web-static/assets/Analytics-txva5ugO.js +0 -1
  236. package/dist/web-static/assets/BatchProgress-BQ533tSf.js +0 -1
  237. package/dist/web-static/assets/Breadcrumb-DtfwnOx6.js +0 -1
  238. package/dist/web-static/assets/Config-CUb6-ddH.js +0 -1
  239. package/dist/web-static/assets/ConfirmDialog-BKfwMp04.js +0 -1
  240. package/dist/web-static/assets/Conventions-E_2yAYoB.js +0 -1
  241. package/dist/web-static/assets/Dashboard-Dskgf0jG.js +0 -1
  242. package/dist/web-static/assets/ErrorState-BOInXmfg.js +0 -1
  243. package/dist/web-static/assets/Events-CAY9kU9T.js +0 -1
  244. package/dist/web-static/assets/Evolution-Ck_BqRpt.js +0 -1
  245. package/dist/web-static/assets/Knowledge-BHLyFp2U.js +0 -2
  246. package/dist/web-static/assets/NodeTypes-B6wc7VnR.js +0 -1
  247. package/dist/web-static/assets/Pagination-lp8b_3NR.js +0 -1
  248. package/dist/web-static/assets/PipelineDetail-Bc6l2jqX.js +0 -4
  249. package/dist/web-static/assets/PipelineTemplates-sSL-9oRh.js +0 -1
  250. package/dist/web-static/assets/Pipelines-Drat9IqZ.js +0 -2
  251. package/dist/web-static/assets/ProjectDetail-Cx8VZp8O.js +0 -1
  252. package/dist/web-static/assets/Projects-qDolX6Y6.js +0 -1
  253. package/dist/web-static/assets/Quality-Bm7oRSun.js +0 -3
  254. package/dist/web-static/assets/SessionDetail-BMrqH8_W.js +0 -1
  255. package/dist/web-static/assets/Sessions-C0BmdDPK.js +0 -2
  256. package/dist/web-static/assets/Skeleton-B7PVDJJ_.js +0 -1
  257. package/dist/web-static/assets/Skills-B3c1_uFt.js +0 -1
  258. package/dist/web-static/assets/TemplateDetail-ep5h3Cu5.js +0 -1
  259. package/dist/web-static/assets/Templates-Dho__f4l.js +0 -1
  260. package/dist/web-static/assets/Toast-BbB3oD2a.js +0 -1
  261. package/dist/web-static/assets/client-BvVpIixG.js +0 -1
  262. package/dist/web-static/assets/index-CgfiGhyE.js +0 -2
  263. package/dist/web-static/assets/index-CqwJts5v.css +0 -2
  264. package/dist/web-static/assets/ui-CDL3BZ13.js +0 -1
  265. package/dist/web-static/assets/useDebounce-DNfPs3Tv.js +0 -1
  266. package/dist/web-static/assets/vendor-DRGPi8ui.js +0 -9
  267. package/dist/web-static/assets/vendor-charts-9eVsQvUV.js +0 -36
  268. package/dist/web-static/assets/vendor-editor-CYLOGES5.js +0 -11
  269. package/dist/web-static/assets/vendor-flow-CHpVij2M.css +0 -1
  270. package/dist/web-static/assets/vendor-flow-srkes8If.js +0 -7
  271. package/dist/web-static/assets/vendor-motion-CQmdgnI8.js +0 -9
  272. package/dist/web-static/assets/vendor-query-DqPOMnuX.js +0 -4
  273. package/dist/web-static/assets/vendor-react-DJI9oneq.js +0 -11
  274. /package/dist/web-static/assets/{exportCsv-Dm5Y5M_E.js → exportCsv-CO51kx6P.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$t as t,Bt as n,Dn as r,Ft as i,Gt as a,Hn as o,It as s,Mn as c,Pn as l,Qt as u,Ut as d,Vt as ee,Wt as f,Yn as p,Zt as m,ar as h,cn as te,cr as ne,dr as re,gr as g,kn as _,nr as v,pr as y,qn as b,rn as ie,s as x,tn as S,tr as C,yn as w}from"./vendor-DRGPi8ui.js";import{c as ae,l as oe}from"./vendor-react-DJI9oneq.js";import{a as se,n as T,r as E}from"./vendor-query-DqPOMnuX.js";import{c as D}from"./vendor-flow-srkes8If.js";import{$ as O,$t as k,B as ce,D as le,M as ue,N as A,Nt as de,Pt as fe,V as pe,_t as j,an as M,bt as me,en as he,gt as ge,p as N,vt as P,z as _e}from"./client-BvVpIixG.js";import{a as ve,c as ye,l as F,n as I,r as L,t as R}from"./ui-CDL3BZ13.js";import{n as z}from"./Toast-BbB3oD2a.js";import{t as be}from"./Pagination-lp8b_3NR.js";import{t as xe}from"./Breadcrumb-DtfwnOx6.js";var B=e(g(),1),V=D(),Se={spec:{label:`规格`,icon:c,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:m,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:l,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:f,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:i,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},H={fail:{label:`失败`,icon:b,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:n,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:p,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function Ce({level:e}){let t=H[e];if(!t)return(0,V.jsx)(R,{size:`sm`,children:e});let n=t.icon;return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,V.jsx)(n,{className:`h-3 w-3`}),t.label]})}function we({category:e}){let t=Se[e];if(!t)return(0,V.jsx)(R,{size:`sm`,children:e});let n=t.icon;return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,V.jsx)(n,{className:`h-3 w-3`}),t.label]})}function U(){let{encodedPath:e}=oe(),l=ae(),f=se(),[p,m]=(0,B.useState)(`sessions`),[ne,g]=(0,B.useState)(!1),[b,S]=(0,B.useState)(``),[w,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(``),[A,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(1),[P,Se]=(0,B.useState)(20),[H,U]=(0,B.useState)(null),Ee=async e=>{try{let t=await me(e);await navigator.clipboard.writeText(t.data.context),U(e),z(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>U(null),3e3)}catch{z(`复制失败`,`error`)}},W=e?encodeURIComponent(e):``,{data:G,isLoading:De,isError:Oe,error:ke}=E({queryKey:[`project`,e],queryFn:()=>ge(W).then(e=>e.data),enabled:!!e}),{data:K}=E({queryKey:[`claudemd`,e],queryFn:()=>_e(W).then(e=>e.data),enabled:!!e&&p===`claudemd`}),{data:q}=E({queryKey:[`claudemd-modules`,e],queryFn:()=>ce(W).then(e=>e.data),enabled:!!e&&p===`claudemd`}),Ae=T({mutationFn:()=>le(W),onSuccess:()=>{f.invalidateQueries({queryKey:[`projects`]}),l(`/projects`)},onError:e=>z(e.message||`删除失败`,`error`)}),je=T({mutationFn:e=>he(W,e),onSuccess:()=>{f.invalidateQueries({queryKey:[`claudemd`,e]}),D(!1)},onError:e=>z(e.message||`保存失败`,`error`)}),Me=T({mutationFn:()=>ue(W),onSuccess:t=>{f.invalidateQueries({queryKey:[`claudemd`,e]}),j({success:!0,message:t.data.distilled?`蒸馏完成,压缩 ${t.data.reduction}%(${t.data.before} → ${t.data.after} 字符):${t.data.summary}`:t.data.message??`无需蒸馏`})},onError:e=>{j({success:!1,message:e.message})}}),[J,Y]=(0,B.useState)(null),[Ne,Pe]=(0,B.useState)(!1),[Fe,Ie]=(0,B.useState)(!1),[X,Z]=(0,B.useState)(null),[Le,Re]=(0,B.useState)(!1),[Q,$]=(0,B.useState)(null);return Oe?(0,V.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,ke?.message||`未知错误`]}):De||!G?(0,V.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,V.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(xe,{items:[{label:`项目列表`,path:`/projects`},{label:G.projectName}]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:re,onClick:()=>l(`/projects`),children:`返回`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,V.jsx)(_,{className:`h-5 w-5 text-blue-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:G.projectName}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:G.projectPath})]})]})]}),(0,V.jsx)(I,{variant:`danger`,size:`sm`,icon:d,onClick:()=>g(!0),children:`删除项目`})]}),ne&&(0,V.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,V.jsxs)(L,{className:`max-w-md`,children:[(0,V.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,V.jsx)(n,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,V.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,V.jsx)(`strong`,{children:G.projectName}),` 的所有监控数据:`]}),(0,V.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,V.jsx)(`li`,{children:`所有会话记录`}),(0,V.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,V.jsx)(`li`,{children:`所有质量问题记录`}),(0,V.jsx)(`li`,{children:`所有事件日志`}),(0,V.jsx)(`li`,{children:`所有知识节点`})]}),(0,V.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,V.jsxs)(`div`,{className:`mb-4`,children:[(0,V.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,V.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:G.projectName}),` 以确认删除:`]}),(0,V.jsx)(`input`,{type:`text`,value:b,onChange:e=>S(e.target.value),placeholder:`输入项目名称`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,V.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>{g(!1),S(``)},children:`取消`}),(0,V.jsx)(I,{variant:`danger`,size:`sm`,disabled:b!==G.projectName,onClick:()=>{b===G.projectName&&(Ae.mutate(),g(!1),S(``))},children:`确认删除`})]})]})}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,V.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>m(`sessions`),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(y,{className:`h-8 w-8 text-blue-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:G.sessions.total}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,V.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>m(`pipelines`),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(r,{className:`h-8 w-8 text-green-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:G.pipelines.total}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,V.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>m(`api`),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(a,{className:`h-8 w-8 text-purple-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:G.events.total}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,V.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>m(`quality`),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(u,{className:`h-8 w-8 text-orange-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:G.quality.total}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,V.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>m(`knowledge`),children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(h,{className:`h-8 w-8 text-pink-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:G.knowledge.total}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,V.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit flex-wrap`,children:[{key:`sessions`,label:`会话`},{key:`pipelines`,label:`Pipeline`},{key:`quality`,label:`质量问题`},{key:`knowledge`,label:`知识文档`},{key:`rules`,label:`规则管理`},{key:`convention`,label:`自定义规范`},{key:`claudemd`,label:`CLAUDE.md`},{key:`environment`,label:`环境初始化`}].map(e=>(0,V.jsx)(`button`,{onClick:()=>m(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${p===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),p===`sessions`&&(0,V.jsxs)(L,{children:[(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,V.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let e=G.sessions.items;return Math.ceil(e.length/P),(0,V.jsxs)(V.Fragment,{children:[e.slice((M-1)*P,M*P).map(e=>(0,V.jsxs)(`tr`,{onClick:()=>l(`/sessions/${e.session_id}`,{state:{from:`/projects/${W}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,V.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:e.session_id.slice(0,12)}),(0,V.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:e.first_requirement,children:e.first_requirement?e.first_requirement:`(无对话记录)`}),(0,V.jsx)(`td`,{className:`py-3`,children:(0,V.jsx)(R,{size:`sm`,className:ye(e.status),children:e.status})}),(0,V.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.start_time),`MM-dd HH:mm`)})]},e.session_id)),e.length===0&&(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=G.sessions.items,t=Math.ceil(e.length/P);return e.length>P?(0,V.jsx)(`div`,{className:`mt-4`,children:(0,V.jsx)(be,{currentPage:M,totalPages:t,onPageChange:N,pageSize:P,onPageSizeChange:e=>{Se(e),N(1)},totalItems:e.length})}):null})()]}),p===`pipelines`&&(0,V.jsx)(L,{children:(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,V.jsx)(`tbody`,{className:`text-sm`,children:G.pipelines.items.map(e=>(0,V.jsxs)(`tr`,{onClick:()=>l(`/pipelines/${e.id}`,{state:{from:`/projects/${W}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,V.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,V.jsx)(`td`,{className:`py-3`,children:(0,V.jsx)(R,{size:`sm`,children:e.phase})}),(0,V.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.updated_at),`MM-dd HH:mm`)})]},e.id))})]})})}),p===`quality`&&(0,V.jsxs)(L,{children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,V.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,G.quality.total,` 个质量问题`]})}),(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,V.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,V.jsx)(`tbody`,{className:`text-sm`,children:G.quality.items.map(e=>(0,V.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,V.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,V.jsx)(`td`,{className:`py-3`,children:(0,V.jsx)(Ce,{level:e.level})}),(0,V.jsx)(`td`,{className:`py-3`,children:(0,V.jsx)(we,{category:e.category})}),(0,V.jsx)(`td`,{className:`py-3`,children:(0,V.jsx)(R,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,V.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.created_at),`MM-dd HH:mm`)}),(0,V.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,V.jsxs)(`button`,{onClick:()=>Ee(e.id),className:`flex items-center gap-1 px-2 py-1 text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors`,title:`复制上下文到剪贴板`,children:[H===e.id?(0,V.jsx)(v,{className:`h-3.5 w-3.5 text-green-500`}):(0,V.jsx)(o,{className:`h-3.5 w-3.5`}),H===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),p===`knowledge`&&(0,V.jsx)(L,{children:(0,V.jsx)(`div`,{className:`space-y-3`,children:G.knowledge.items.map(e=>(0,V.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,V.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,V.jsx)(R,{size:`sm`,children:e.node_type}),(0,V.jsxs)(`span`,{children:[`更新于 `,x(F(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),p===`rules`&&(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(L,{title:`意图识别规则`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:G.rules.intentRules.slice(0,10).map(e=>(0,V.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(R,{size:`sm`,children:e.rule_type}),(0,V.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,V.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,V.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,V.jsx)(L,{title:`任务模式`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:G.rules.taskPatterns.slice(0,10).map(e=>(0,V.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,V.jsx)(R,{size:`sm`,children:e.task_type}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,V.jsx)(ee,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,V.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,V.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),p===`convention`&&e&&(0,V.jsx)(Te,{encodedPath:W}),p===`claudemd`&&(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(L,{children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-blue-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:K?.exists?`${(K.size/1024).toFixed(1)} KB · ${K.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:ie,onClick:()=>f.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),K?.exists&&(0,V.jsx)(I,{variant:`secondary`,size:`sm`,icon:i,onClick:()=>{j(null),Me.mutate()},disabled:Me.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:Me.isPending?`蒸馏中...`:`蒸馏`}),K?.exists&&!w&&(0,V.jsx)(I,{size:`sm`,icon:te,onClick:()=>{k(K.content||``),D(!0)},children:`编辑`})]})]})}),A&&(0,V.jsx)(L,{children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsx)(`p`,{className:`text-sm ${A.success?`text-gray-900`:`text-red-600`}`,children:A.message}),(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>j(null)})]})}),w&&(0,V.jsxs)(L,{children:[(0,V.jsx)(`textarea`,{className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-md font-mono h-96 resize-y`,value:O,onChange:e=>k(e.target.value)}),(0,V.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>D(!1),children:`取消`}),(0,V.jsx)(I,{size:`sm`,icon:C,onClick:()=>je.mutate(O),children:`保存`})]})]}),!w&&K?.exists&&(0,V.jsx)(L,{title:`内容预览`,children:(0,V.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 p-4 rounded-md overflow-auto max-h-96 whitespace-pre-wrap font-mono`,children:K.content})}),(0,V.jsx)(L,{title:`子模块 (${q?.total??0})`,children:q?.items.length===0?(0,V.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,V.jsx)(`div`,{className:`space-y-2`,children:q?.items.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(_,{className:`h-4 w-4 text-gray-400`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,V.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,V.jsx)(R,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),p===`environment`&&(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(L,{children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,V.jsx)(I,{variant:`secondary`,size:`sm`,icon:t,onClick:async()=>{Pe(!0),Y(null);try{Y((await pe(W)).data.profile)}catch(e){Y({error:String(e)})}finally{Pe(!1)}},disabled:Ne,children:Ne?`检测中...`:`环境检测`}),(0,V.jsx)(I,{size:`sm`,icon:i,onClick:async()=>{Ie(!0),Z(null);try{let t=await fe(W);Z({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),Y(t.data.profile),f.invalidateQueries({queryKey:[`claudemd`,e]}),f.invalidateQueries({queryKey:[`project`,e]})}catch(e){Z({success:!1,message:String(e)})}finally{Ie(!1)}},disabled:Fe,children:Fe?`初始化中...`:`一键初始化`}),(0,V.jsx)(I,{size:`sm`,icon:c,onClick:async()=>{Re(!0),$(null);try{let t=await de(W);$({success:t.data.success,message:t.data.message}),t.data.skipped||(f.invalidateQueries({queryKey:[`conventions`,e]}),f.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){$({success:!1,message:String(e)})}finally{Re(!1)}},disabled:Le,children:Le?`生成中...`:`初始化规范`})]})]})}),X&&(0,V.jsx)(L,{children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-2`,children:[X.success?(0,V.jsx)(C,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,V.jsx)(s,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium ${X.success?`text-gray-900`:`text-red-600`}`,children:X.message}),X.claudeMdGenerated&&(0,V.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>Z(null)})]})}),Q&&(0,V.jsx)(L,{children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-2`,children:[Q.success?(0,V.jsx)(C,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,V.jsx)(s,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,V.jsx)(`p`,{className:ve(`text-sm font-medium`,Q.success?`text-gray-900`:`text-red-600`),children:Q.message})]}),(0,V.jsx)(I,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>$(null)})]})}),J&&!(`error`in J)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(L,{title:`技术栈`,children:(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.projectName})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.packageManager||`未检测到`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.testFramework||`未检测到`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.buildTool||`未检测到`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.linter||`未检测到`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,V.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.formatter||`未检测到`})]})]})}),J.languages.length>0&&(0,V.jsx)(L,{title:`检测到的语言`,children:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.languages.map((e,t)=>(0,V.jsxs)(R,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),J.frameworks.length>0&&(0,V.jsx)(L,{title:`检测到的框架`,children:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.frameworks.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,V.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(J.scripts).length>0&&(0,V.jsx)(L,{title:`常用脚本`,children:(0,V.jsx)(`div`,{className:`space-y-1`,children:Object.entries(J.scripts).map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,V.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,V.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),J.keyDirectories.length>0&&(0,V.jsx)(L,{title:`关键目录`,children:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.keyDirectories.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,V.jsx)(_,{className:`h-3.5 w-3.5 text-gray-400`}),(0,V.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),J&&`error`in J&&(0,V.jsx)(L,{children:(0,V.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,J.error]})})]})]})}function Te({encodedPath:e}){let[t,n]=(0,B.useState)(`bindings`),[r,a]=(0,B.useState)(!1),[o,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(!1),d=se(),{data:ee,isLoading:f}=E({queryKey:[`project-conventions`,e],queryFn:()=>j(e).then(e=>e.data)}),{data:p}=E({queryKey:[`global-conventions`],queryFn:()=>O().then(e=>e.data),enabled:r}),{data:m}=E({queryKey:[`project-custom-yaml`,e],queryFn:()=>P(e).then(e=>e.data),enabled:l}),h=T({mutationFn:t=>N(e,t).then(e=>e.data),onSuccess:t=>{z(`已绑定:${t.convention.name}`,`success`),a(!1),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),re=T({mutationFn:t=>k(e,t).then(e=>e.data),onSuccess:()=>{z(`已解绑`,`success`),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),g=T({mutationFn:()=>A(e).then(e=>e.data),onSuccess:t=>{z(t.isIncremental?`增量蒸馏完成,版本 ${t.convention.version}`:`蒸馏完成,生成 ${t.convention.name}`,`success`),d.invalidateQueries({queryKey:[`project-conventions`,e]}),n(`custom`)}}),_=T({mutationFn:t=>M(e,t).then(e=>e.data),onSuccess:()=>{z(`保存成功`,`success`),u(!1),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),v=ee?.bindings||[],y=ee?.custom,b=(p?.items||[]).filter(e=>!v.some(t=>t.id===e.id)),x={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},C={official:`官方`,user:`用户`,community:`社区`};return f?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,V.jsx)(ie,{className:`h-6 w-6 animate-spin text-blue-500`})}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 bg-gray-100 rounded-lg p-1`,children:[`bindings`,`custom`].map(e=>(0,V.jsx)(`button`,{onClick:()=>n(e),className:`px-4 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-1.5 ${t===e?`bg-white text-gray-900 shadow-sm`:`text-gray-500 hover:text-gray-700`}`,children:e===`bindings`?`绑定的规范 (${v.length})`:(0,V.jsxs)(V.Fragment,{children:[`蒸馏规范`,y&&(0,V.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700`,children:`实际生效`})]})},e))}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[t===`bindings`&&(0,V.jsxs)(`button`,{onClick:()=>a(!r),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,V.jsx)(w,{className:`h-3.5 w-3.5`}),`绑定规范`]}),t===`custom`&&(0,V.jsxs)(`button`,{onClick:()=>g.mutate(),disabled:g.isPending||v.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,title:v.length===0?`请先绑定至少一个规范`:``,children:[(0,V.jsx)(i,{className:`h-3.5 w-3.5 ${g.isPending?`animate-pulse`:``}`}),g.isPending?`蒸馏中...`:y?`重新蒸馏`:`生成蒸馏规范`]})]})]}),r&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-blue-200 p-4 space-y-3`,children:[(0,V.jsx)(`div`,{className:`text-sm font-medium text-gray-700`,children:`从全局规范库选择绑定`}),b.length===0?(0,V.jsx)(`p`,{className:`text-sm text-gray-400`,children:`所有全局规范已全部绑定`}):(0,V.jsx)(`div`,{className:`grid gap-2`,children:b.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 rounded-lg`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:C[e.source]||e.source}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:e.description})]}),(0,V.jsx)(`button`,{onClick:()=>h.mutate(e.id),disabled:h.isPending,className:`px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:`绑定`})]},e.id))}),(0,V.jsx)(`button`,{onClick:()=>a(!1),className:`text-xs text-gray-400 hover:text-gray-600`,children:`关闭`})]}),t===`bindings`&&(0,V.jsx)(`div`,{className:`space-y-3`,children:v.length===0?(0,V.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,V.jsx)(ne,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未绑定任何规范`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「绑定规范」从全局规范库选择`})]}):v.map(e=>(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full font-medium ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:C[e.source]||e.source}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:e.description}),(0,V.jsxs)(`div`,{className:`flex gap-3 mt-2 text-xs text-gray-400`,children:[(0,V.jsxs)(`span`,{children:[e.roles?Object.keys(e.roles).length:0,` 个角色`]}),(0,V.jsxs)(`span`,{children:[e.quality_standards?.length||0,` 条质量标准`]})]})]}),(0,V.jsx)(`button`,{onClick:()=>re.mutate(e.id),disabled:re.isPending,className:`ml-4 p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`解绑`,children:(0,V.jsx)(s,{className:`h-4 w-4`})})]})},e.id))}),t===`custom`&&(0,V.jsx)(`div`,{className:`space-y-4`,children:y?(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 border-b border-gray-100`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-semibold text-gray-900`,children:y.name}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,y.version]}),(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-200`,children:`项目真实规范`})]}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:y.description})]}),!l&&(0,V.jsxs)(`button`,{onClick:()=>{c(m?.yaml||``),u(!0)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors`,children:[(0,V.jsx)(te,{className:`h-3.5 w-3.5`}),`编辑 YAML`]})]}),(0,V.jsx)(`div`,{className:`p-5`,children:l?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`textarea`,{value:o||m?.yaml||``,onChange:e=>c(e.target.value),rows:24,className:`w-full px-3 py-2 text-xs border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>_.mutate(o),disabled:_.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,V.jsx)(S,{className:`h-3.5 w-3.5`}),_.isPending?`保存中...`:`保存`]}),(0,V.jsx)(`button`,{onClick:()=>u(!1),className:`px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}):(0,V.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[y.principles&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`核心原则`}),(0,V.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 rounded-lg p-3 whitespace-pre-wrap border border-gray-100 max-h-48 overflow-y-auto`,children:typeof y.principles==`string`?y.principles:JSON.stringify(y.principles,null,2)})]}),y.quality_standards&&y.quality_standards.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:[`质量标准 (`,y.quality_standards.length,`)`]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[y.quality_standards.slice(0,5).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-gray-600`,children:[(0,V.jsx)(`span`,{className:`mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-yellow-50 text-yellow-600`:`bg-gray-100 text-gray-500`}`,children:e.severity||`rule`}),(0,V.jsx)(`span`,{children:e.rule||String(e)})]},t)),y.quality_standards.length>5&&(0,V.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`...还有 `,y.quality_standards.length-5,` 条`]})]})]})]})})]}):(0,V.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,V.jsx)(i,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未生成蒸馏规范`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:v.length>0?`点击「生成蒸馏规范」将绑定的规范融合为项目专属规范`:`请先绑定至少一个规范,再生成蒸馏规范`})]})})]})}export{U as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$t as t,Dn as n,Gn as r,It as i,Kt as a,Qt as ee,Rn as o,Ut as s,Yt as te,ar as ne,en as c,fr as l,gr as u,kn as d,lr as re,pr as ie,qt as ae,s as f}from"./vendor-DRGPi8ui.js";import{c as p}from"./vendor-react-DJI9oneq.js";import{a as oe,n as m,r as h}from"./vendor-query-DqPOMnuX.js";import{c as g}from"./vendor-flow-srkes8If.js";import{D as _,r as v,yt as se}from"./client-BvVpIixG.js";import{a as y,l as ce,r as b,t as x}from"./ui-CDL3BZ13.js";import{t as S}from"./vendor-motion-CQmdgnI8.js";import{n as C}from"./Toast-BbB3oD2a.js";import{t as w}from"./exportCsv-Dm5Y5M_E.js";import{t as T}from"./Pagination-lp8b_3NR.js";var E=e(u(),1),D=g();function O(){let e=p(),u=oe(),[g,O]=(0,E.useState)(``),[k,A]=(0,E.useState)(1),[j,le]=(0,E.useState)(12),[M,ue]=(0,E.useState)(`lastActivity`),[N,P]=(0,E.useState)(!1),[F,I]=(0,E.useState)(!1),[L,R]=(0,E.useState)(null),[z,B]=(0,E.useState)(``),[V,H]=(0,E.useState)(``),[U,W]=(0,E.useState)(new Set),[de,G]=(0,E.useState)(!1),[K,q]=(0,E.useState)(``),[J,Y]=(0,E.useState)(!1),{data:fe}=h({queryKey:[`project-meta-all`],queryFn:()=>v.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),X=fe||{},Z=m({mutationFn:({projectPath:e,meta:t})=>v.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{u.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>C(e.message||`操作失败`,`error`)}),Q=(e,t)=>{t.stopPropagation();let n=X[e]||{notes:``,tags:[],archived:!1};B(n.notes),H(n.tags.join(`, `)),R(e)},pe=()=>{if(!L)return;let e=X[L]||{notes:``,tags:[],archived:!1};Z.mutate({projectPath:L,meta:{notes:z.trim(),tags:V.split(`,`).map(e=>e.trim()).filter(Boolean),archived:e.archived}}),R(null)},me=(e,t)=>{t.stopPropagation();let n=X[e]||{notes:``,tags:[],archived:!1};Z.mutate({projectPath:e,meta:{...n,archived:!n.archived}})},he=(e,t)=>{t.stopPropagation(),W(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ge=()=>{for(let e of U){let t=X[e]||{notes:``,tags:[],archived:!1};Z.mutate({projectPath:e,meta:{...t,archived:!0}})}C(`已归档 ${U.size} 个项目`,`success`),W(new Set)},_e=async()=>{Y(!0);let e=0;for(let t of U)try{await _(encodeURIComponent(t)),e++}catch{}Y(!1),G(!1),q(``),W(new Set),u.invalidateQueries({queryKey:[`projects`]}),C(`已删除 ${e} 个项目`,`success`)},{data:ve,isLoading:ye}=h({queryKey:[`projects`],queryFn:()=>se({limit:1e3}).then(e=>e.data)});if(ye)return(0,D.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,D.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let be=ve?.items||[],xe=e=>{M===e?P(e=>!e):(ue(e),P(!1)),A(1)},$=be.filter(e=>{if(X[e.projectPath]?.archived&&!F)return!1;if(!g)return!0;let t=g.toLowerCase();return e.projectName.toLowerCase().includes(t)||e.projectPath.toLowerCase().includes(t)}).sort((e,t)=>{let n=0;return M===`name`?n=e.projectName.localeCompare(t.projectName):M===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):M===`sessionCount`?n=e.sessionCount-t.sessionCount:M===`totalEvents`&&(n=e.totalEvents-t.totalEvents),N?n:-n}),Se=Math.ceil($.length/j),Ce=$.slice((k-1)*j,k*j);return(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,D.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-3`,children:U.size>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(x,{variant:`info`,children:[U.size,` 个已选`]}),(0,D.jsxs)(`button`,{onClick:ge,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,D.jsx)(l,{className:`h-4 w-4`}),`批量归档`]}),(0,D.jsxs)(`button`,{onClick:()=>G(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors`,children:[(0,D.jsx)(s,{className:`h-4 w-4`}),`批量删除`]}),(0,D.jsxs)(`button`,{onClick:()=>W(new Set),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,D.jsx)(i,{className:`h-4 w-4`}),`取消选择`]})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(x,{variant:`info`,children:[$.length,` 个项目`]}),(0,D.jsxs)(`button`,{onClick:()=>I(!F),className:y(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,F?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,D.jsx)(l,{className:`h-4 w-4`}),F?`隐藏归档`:`显示归档`]}),(0,D.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=$.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);w(`projects-${new Date().toISOString().slice(0,10)}.csv`,e,t)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,D.jsx)(o,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,D.jsx)(b,{children:(0,D.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1`,children:[(0,D.jsx)(c,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`搜索项目名称或路径...`,value:g,onChange:e=>{O(e.target.value),A(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(`span`,{className:`text-gray-500`,children:`排序:`}),[{key:`name`,label:`名称`},{key:`lastActivity`,label:`活动时间`},{key:`sessionCount`,label:`会话数`},{key:`totalEvents`,label:`事件数`}].map(({key:e,label:t})=>(0,D.jsxs)(`button`,{onClick:()=>xe(e),className:y(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,M===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,M===e&&(0,D.jsx)(re,{className:y(`h-3 w-3`,N&&`rotate-180`)})]},e))]})]})}),(0,D.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Ce.map((i,o)=>{let s=i.projectPath,c=X[s]||{notes:``,tags:[],archived:!1};return(0,D.jsx)(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:o*.03},children:(0,D.jsx)(b,{className:y(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,c.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(s)}`),children:(0,D.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,D.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,D.jsx)(d,{className:`h-5 w-5 text-blue-600`})}),(0,D.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:i.projectName}),c.archived&&(0,D.jsx)(l,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:s}),c.tags.length>0&&(0,D.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:c.tags.map(e=>(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-blue-50 text-blue-600 text-xs rounded`,children:[(0,D.jsx)(a,{className:`h-2.5 w-2.5`}),e]},e))}),c.notes&&(0,D.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:c.notes})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,D.jsx)(`button`,{onClick:e=>he(s,e),className:y(`p-1 rounded transition-colors`,U.has(s)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:U.has(s)?(0,D.jsx)(te,{className:`h-3.5 w-3.5`}):(0,D.jsx)(ae,{className:`h-3.5 w-3.5`})}),(0,D.jsx)(`button`,{onClick:e=>me(s,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:c.archived?`取消归档`:`归档`,children:(0,D.jsx)(l,{className:`h-3.5 w-3.5`})}),(0,D.jsx)(`button`,{onClick:e=>Q(s,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,D.jsx)(t,{className:`h-3.5 w-3.5`})})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(ie,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[i.sessionCount,` 会话`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(n,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[i.pipelineCount,` Pipeline`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(ee,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[i.qualityIssueCount,` 质量`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(ne,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[i.totalEvents,` 事件`]})]})]}),i.lastActivity&&(0,D.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,D.jsx)(r,{className:`h-3 w-3 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[`最近活动:`,f(ce(i.lastActivity),`MM-dd HH:mm`)]})]})]})})},s)})}),$.length===0&&(0,D.jsxs)(`div`,{className:`text-center py-12`,children:[(0,D.jsx)(d,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,D.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,D.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),$.length>0&&(0,D.jsx)(T,{currentPage:k,totalPages:Se,onPageChange:A,pageSize:j,onPageSizeChange:e=>{le(e),A(1)},totalItems:$.length}),de&&(0,D.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{G(!1),q(``)},children:(0,D.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,D.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,D.jsx)(s,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,D.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,D.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,D.jsxs)(`strong`,{children:[U.size,` 个项目`]}),` 的所有监控数据:`]}),(0,D.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,D.jsx)(`li`,{children:`所有会话记录`}),(0,D.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,D.jsx)(`li`,{children:`所有质量问题记录`}),(0,D.jsx)(`li`,{children:`所有事件日志`}),(0,D.jsx)(`li`,{children:`所有知识节点`})]}),(0,D.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,D.jsxs)(`div`,{className:`mb-4`,children:[(0,D.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,D.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,D.jsx)(`input`,{type:`text`,value:K,onChange:e=>q(e.target.value),placeholder:`输入「删除」二字`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,D.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,D.jsx)(`button`,{onClick:()=>{G(!1),q(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,D.jsx)(`button`,{disabled:K!==`删除`||J,onClick:_e,className:`px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed`,children:J?`删除中...`:`确认删除`})]})]})}),L&&(0,D.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>R(null),children:(0,D.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,D.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,D.jsx)(`button`,{onClick:()=>R(null),className:`text-gray-400 hover:text-gray-600`,children:(0,D.jsx)(i,{className:`h-5 w-5`})})]}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:L}),(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,D.jsx)(`input`,{type:`text`,value:V,onChange:e=>H(e.target.value),placeholder:`前端, 工具, 实验...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,D.jsx)(`textarea`,{value:z,onChange:e=>B(e.target.value),rows:3,placeholder:`项目说明、注意事项...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`})]})]}),(0,D.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,D.jsx)(`button`,{onClick:()=>R(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,D.jsx)(`button`,{onClick:pe,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}export{O as default};
@@ -1,3 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{An as t,Bt as n,Ft as r,Hn as i,It as a,Mn as o,On as ee,Pn as s,Qn as c,Rn as te,Wt as ne,Yn as re,Zt as l,en as ie,er as u,gr as d,nr as ae,qn as f,s as p,tr as m,vn as oe}from"./vendor-DRGPi8ui.js";import{a as se,n as h,r as g}from"./vendor-query-DqPOMnuX.js";import{c as _}from"./vendor-flow-srkes8If.js";import{Ht as ce,Ut as le,bt as ue,f as de,j as fe,jt as pe,u as me,xt as v}from"./client-BvVpIixG.js";import{a as y,l as b,n as x,r as S,t as C}from"./ui-CDL3BZ13.js";import{n as w,t as T}from"./vendor-motion-CQmdgnI8.js";import{t as he}from"./useDebounce-DNfPs3Tv.js";import{n as ge}from"./Toast-BbB3oD2a.js";import{t as _e}from"./ErrorState-BOInXmfg.js";import{t as ve}from"./exportCsv-Dm5Y5M_E.js";import{t as ye}from"./ConfirmDialog-BKfwMp04.js";import{t as be}from"./Pagination-lp8b_3NR.js";var E=e(d(),1),D=_(),O={spec:{label:`规格`,icon:o,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:l,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:s,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:ne,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:r,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},k={fail:{label:`失败`,icon:f,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:n,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:re,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function A({level:e}){let t=k[e];if(!t)return(0,D.jsx)(C,{size:`sm`,children:e});let n=t.icon;return(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,D.jsx)(n,{className:`h-3 w-3`}),t.label]})}function j({category:e}){let t=O[e];if(!t)return(0,D.jsx)(C,{size:`sm`,children:e});let n=t.icon;return(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,D.jsx)(n,{className:`h-3 w-3`}),t.label]})}function M(){let e=se(),[n,r]=(0,E.useState)(``),o=he(n),[s,ne]=(0,E.useState)(``),[l,d]=(0,E.useState)(``),[f,_]=(0,E.useState)(``),[M,xe]=(0,E.useState)(``),[N,Se]=(0,E.useState)(!1),[P,F]=(0,E.useState)(1),[I,Ce]=(0,E.useState)(20),[L,R]=(0,E.useState)(null),[z,B]=(0,E.useState)(null),[V,H]=(0,E.useState)(new Set),[U,W]=(0,E.useState)(`list`),[we,Te]=(0,E.useState)(new Set),[G,K]=(0,E.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:Ee,isError:De,refetch:Oe}=g({queryKey:[`quality-unresolved`],queryFn:()=>pe().then(e=>e.data)}),{data:ke}=g({queryKey:[`quality-history`,s,l,f,M,o],queryFn:()=>v({limit:500,level:s||void 0,category:l||void 0,resolved:f===`resolved`?!0:f===`unresolved`?!1:void 0,project_path:M||void 0,search:o||void 0}).then(e=>e.data)}),{data:q}=g({queryKey:[`quality-history`,`all`],queryFn:()=>v({limit:500}).then(e=>e.data)}),J=h({mutationFn:e=>le(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),Y=h({mutationFn:e=>fe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),Ae=h({mutationFn:()=>ce(),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),je=h({mutationFn:e=>me(e),onSuccess:t=>{H(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]}),t.failed.length>0&&alert(`忽略完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
2
- `)}`)}}),Me=h({mutationFn:e=>de(e),onSuccess:t=>{H(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]}),t.failed.length>0&&alert(`解决完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
3
- `)}`)}}),Ne=async e=>{try{let t=await ue(e);await navigator.clipboard.writeText(t.data.context),B(e),ge(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>B(null),3e3)}catch{ge(`复制失败`,`error`)}},X=ke?.items||[],Pe=X.reduce((e,t)=>{let n=t.project_path?.split(`/`).pop()||`未知项目`;return e[n]||(e[n]=[]),e[n].push(t),e},{}),Fe=Math.ceil(X.length/I),Z=X.slice((P-1)*I,P*I),Ie=q?.total||0,Q=Ee?.total||0,Le=X.filter(e=>e.level===`fail`).length,Re=X.filter(e=>e.level===`warn`).length,ze=Array.from(new Set(q?.items.map(e=>e.level)||[])),Be=Array.from(new Set(q?.items.map(e=>e.category)||[])),Ve=Array.from(new Set(q?.items.map(e=>e.project_path?.split(`/`).pop()||``).filter(Boolean)||[])),$=[s,l,f,M].filter(Boolean).length,He=()=>{let e=[`级别`,`类别`,`消息`,`项目`,`状态`,`创建时间`],t=X.map(e=>[e.level,e.category,e.message,e.project_path?.split(`/`).pop()||``,e.resolved?`已解决`:`未解决`,e.created_at?p(b(e.created_at),`yyyy-MM-dd HH:mm:ss`):``]);ve(`quality-issues-${p(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return De?(0,D.jsx)(_e,{message:`质量数据加载失败`,onRetry:()=>Oe()}):(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(S,{children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1`,children:[(0,D.jsx)(ie,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`搜索问题描述...`,value:n,onChange:e=>{r(e.target.value),F(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,D.jsxs)(`button`,{onClick:()=>Se(e=>!e),className:y(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,N||$>0?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,D.jsx)(ee,{className:`h-4 w-4`}),`筛选`,$>0&&(0,D.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:$}),(0,D.jsx)(u,{className:y(`h-3.5 w-3.5 transition-transform`,N&&`rotate-180`)})]}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[V.size>0&&(0,D.jsxs)(x,{variant:`secondary`,size:`sm`,icon:m,onClick:()=>K({open:!0,title:`批量解决问题`,description:`确认将选中的 ${V.size} 个问题标记为已解决?`,count:V.size,onConfirm:()=>{Me.mutate(Array.from(V)),K(e=>({...e,open:!1}))}}),loading:Me.isPending,children:[`解决 (`,V.size,`)`]}),V.size>0&&(0,D.jsxs)(x,{variant:`secondary`,size:`sm`,icon:a,onClick:()=>K({open:!0,title:`批量忽略问题`,description:`确认忽略选中的 ${V.size} 个问题?`,count:V.size,onConfirm:()=>{je.mutate(Array.from(V)),K(e=>({...e,open:!1}))}}),loading:je.isPending,children:[`忽略 (`,V.size,`)`]}),Q>0&&(0,D.jsx)(x,{variant:`primary`,size:`sm`,icon:m,onClick:()=>K({open:!0,title:`全部标记已修复`,description:`确认将 ${Q} 个问题全部标记为已修复?`,onConfirm:()=>{Ae.mutate(),K(e=>({...e,open:!1}))}}),loading:Ae.isPending,children:`全部已修复`}),(0,D.jsx)(x,{variant:`secondary`,size:`sm`,icon:te,onClick:()=>X.length>0&&He(),children:`导出`}),(0,D.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,D.jsx)(`button`,{onClick:()=>W(`list`),className:y(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,U===`list`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`列表视图`,children:(0,D.jsx)(oe,{className:`h-4 w-4`})}),(0,D.jsx)(`button`,{onClick:()=>W(`group`),className:y(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,U===`group`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`按项目分组`,children:(0,D.jsx)(t,{className:`h-4 w-4`})})]})]})]}),N&&(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,D.jsxs)(`select`,{value:s,onChange:e=>{ne(e.target.value),F(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,D.jsx)(`option`,{value:``,children:`全部级别`}),ze.map(e=>(0,D.jsx)(`option`,{value:e,children:k[e]?.label||e},e))]}),(0,D.jsxs)(`select`,{value:l,onChange:e=>{d(e.target.value),F(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,D.jsx)(`option`,{value:``,children:`全部类别`}),Be.map(e=>(0,D.jsx)(`option`,{value:e,children:O[e]?.label||e},e))]}),(0,D.jsxs)(`select`,{value:f,onChange:e=>{_(e.target.value),F(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,D.jsx)(`option`,{value:``,children:`全部状态`}),(0,D.jsx)(`option`,{value:`resolved`,children:`已解决`}),(0,D.jsx)(`option`,{value:`unresolved`,children:`未解决`})]}),(0,D.jsxs)(`select`,{value:M,onChange:e=>{xe(e.target.value),F(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,D.jsx)(`option`,{value:``,children:`全部项目`}),Ve.map(e=>(0,D.jsx)(`option`,{value:e,children:e},e))]})]})]})}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,D.jsxs)(S,{className:`text-center`,children:[(0,D.jsx)(`div`,{className:`text-3xl font-bold text-red-600`,children:Le}),(0,D.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`失败`})]}),(0,D.jsxs)(S,{className:`text-center`,children:[(0,D.jsx)(`div`,{className:`text-3xl font-bold text-amber-600`,children:Re}),(0,D.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`警告`})]}),(0,D.jsxs)(S,{className:`text-center`,children:[(0,D.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:Q}),(0,D.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`未解决`})]}),(0,D.jsxs)(S,{className:`text-center`,children:[(0,D.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:Ie}),(0,D.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总检查`})]})]}),(0,D.jsxs)(S,{title:`问题列表 (${X.length})`,action:X.length>0?(0,D.jsx)(`button`,{onClick:()=>{let e=U===`list`?Z.filter(e=>!e.resolved).map(e=>String(e.id)):X.filter(e=>!e.resolved).map(e=>String(e.id));V.size===e.length&&e.length>0?H(new Set):H(new Set(e))},className:`text-xs text-blue-600 hover:underline`,children:V.size>0?`取消全选`:U===`list`?`全选当前页未解决`:`全选所有未解决`}):void 0,children:[U===`list`?(0,D.jsx)(`div`,{className:`space-y-2`,children:Z.map((e,t)=>{let n=L===String(e.id||t);return(0,D.jsxs)(`div`,{className:`rounded-lg border border-gray-100 overflow-hidden`,children:[(0,D.jsxs)(T.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.02},className:y(`flex items-center gap-3 p-4 cursor-pointer transition-all`,V.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>R(n?null:String(e.id||t)),children:[e.resolved?(0,D.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,D.jsx)(`input`,{type:`checkbox`,checked:V.has(String(e.id)),onChange:t=>{t.stopPropagation(),H(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,D.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-5 gap-3 items-center min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,D.jsx)(A,{level:e.level}),(0,D.jsx)(j,{category:e.category})]}),(0,D.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,D.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,D.jsx)(`div`,{className:`text-sm text-gray-500 truncate`,children:e.project_path?.split(`/`).pop()||`-`}),(0,D.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,D.jsx)(C,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,D.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?p(b(e.created_at),`MM-dd HH:mm`):``}),n?(0,D.jsx)(u,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,D.jsx)(c,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,D.jsx)(w,{children:n&&(0,D.jsx)(T.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,D.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,D.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,D.jsxs)(`div`,{className:`flex gap-6`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?p(b(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1`,children:p(b(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,D.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:z===String(e.id)?ae:i,onClick:t=>{t.stopPropagation(),Ne(String(e.id))},children:z===String(e.id)?`已复制`:`复制上下文`}),(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:m,onClick:t=>{t.stopPropagation(),J.mutate(String(e.id))},loading:J.isPending,children:`标记已修复`}),(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:a,onClick:t=>{t.stopPropagation(),Y.mutate(String(e.id))},loading:Y.isPending,children:`忽略`})]})]})})})]},e.id||t)})}):(0,D.jsx)(`div`,{className:`space-y-3`,children:Object.entries(Pe).map(([e,t])=>{let n=we.has(e),r=t.filter(e=>!e.resolved).length;return(0,D.jsxs)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:[(0,D.jsx)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors`,onClick:()=>Te(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,D.jsx)(u,{className:`h-4 w-4 text-gray-500`}):(0,D.jsx)(c,{className:`h-4 w-4 text-gray-500`}),(0,D.jsx)(`span`,{className:`font-medium text-gray-900`,children:e}),(0,D.jsxs)(C,{size:`sm`,children:[t.length,` 个问题`]}),r>0&&(0,D.jsxs)(C,{size:`sm`,variant:`warning`,children:[r,` 未解决`]})]})}),(0,D.jsx)(w,{children:n&&(0,D.jsx)(T.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,D.jsx)(`div`,{className:`divide-y divide-gray-100`,children:t.map((e,t)=>{let n=L===String(e.id||t);return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(T.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:t*.01},className:y(`flex items-center gap-3 p-3 cursor-pointer transition-all`,V.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>R(n?null:String(e.id||t)),children:[e.resolved?(0,D.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,D.jsx)(`input`,{type:`checkbox`,checked:V.has(String(e.id)),onChange:t=>{t.stopPropagation(),H(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,D.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-4 gap-3 items-center min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,D.jsx)(A,{level:e.level}),(0,D.jsx)(j,{category:e.category})]}),(0,D.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,D.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,D.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,D.jsx)(C,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,D.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?p(b(e.created_at),`MM-dd HH:mm`):``}),n?(0,D.jsx)(u,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,D.jsx)(c,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,D.jsx)(w,{children:n&&(0,D.jsx)(T.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,D.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,D.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,D.jsxs)(`div`,{className:`flex gap-6`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?p(b(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,D.jsx)(`span`,{className:`text-gray-700 ml-1`,children:p(b(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,D.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:z===String(e.id)?ae:i,onClick:t=>{t.stopPropagation(),Ne(String(e.id))},children:z===String(e.id)?`已复制`:`复制上下文`}),(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:m,onClick:t=>{t.stopPropagation(),J.mutate(String(e.id))},loading:J.isPending,children:`标记已修复`}),(0,D.jsx)(x,{variant:`ghost`,size:`sm`,icon:a,onClick:t=>{t.stopPropagation(),Y.mutate(String(e.id))},loading:Y.isPending,children:`忽略`})]})]})})})]},e.id||t)})})})})]},e)})}),X.length===0&&(0,D.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,D.jsx)(re,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`没有符合条件的记录`]}),X.length>0&&U===`list`&&(0,D.jsx)(be,{currentPage:P,totalPages:Fe,onPageChange:F,pageSize:I,onPageSizeChange:e=>{Ce(e),F(1)},totalItems:X.length})]}),(0,D.jsx)(ye,{open:G.open,title:G.title,description:G.description,count:G.count,variant:`warning`,onConfirm:G.onConfirm,onCancel:()=>K({...G,open:!1})})]})}export{M as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Gn as t,Gt as n,Lt as r,Nn as i,Qn as a,dr as o,en as s,er as c,gr as l,s as u}from"./vendor-DRGPi8ui.js";import{S as d,d as f,f as p,g as m,l as h,m as g,p as _,s as v,y}from"./vendor-charts-9eVsQvUV.js";import{c as b,l as x,s as S}from"./vendor-react-DJI9oneq.js";import{r as C}from"./vendor-query-DqPOMnuX.js";import{c as w}from"./vendor-flow-srkes8If.js";import{Ct as T}from"./client-BvVpIixG.js";import{a as E,l as D,n as O,o as k,r as A,t as j}from"./ui-CDL3BZ13.js";import{t as M}from"./vendor-motion-CQmdgnI8.js";import{t as N}from"./Breadcrumb-DtfwnOx6.js";var P=e(l(),1),F=w();function I(){let{id:e}=x(),l=b(),w=S(),[I,L]=(0,P.useState)(null),[R,z]=(0,P.useState)(`phases`),B=w.state?.from||`/sessions`,{data:V,isLoading:H,isError:U,error:W}=C({queryKey:[`session`,e],queryFn:()=>T(e).then(e=>e.data),enabled:!!e});if(U)return(0,F.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,W?.message||`未知错误`]});if(H||!V)return(0,F.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let{session:G,phases:K,dataFlow:q,timeline:J,stats:Y}=V,X=Object.entries(Y.toolUsage).sort((e,t)=>t[1]-e[1]).slice(0,12).map(([e,t])=>({name:e,value:t}));return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(N,{items:[{label:`会话列表`,path:`/sessions`},{label:G.session_id.slice(0,8)+`...`}]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(O,{variant:`ghost`,size:`sm`,icon:o,onClick:()=>l(B),children:`返回`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:`会话详情`}),(0,F.jsx)(`p`,{className:`text-sm text-gray-500 font-mono`,children:G.session_id})]}),(0,F.jsx)(j,{variant:G.status===`active`?`success`:`info`,children:G.status})]}),V.pipeline&&(0,F.jsx)(O,{variant:`secondary`,size:`sm`,onClick:()=>l(`/pipelines/${V.pipeline.id}`,{state:{from:B}}),children:`查看关联 Pipeline`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(t,{className:`h-5 w-5 text-blue-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:k(Y.duration)}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`持续时间`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(r,{className:`h-5 w-5 text-green-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.totalEvents}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`总事件数`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(i,{className:`h-5 w-5 text-purple-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.writeOps}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`写入操作`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(s,{className:`h-5 w-5 text-orange-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.readOps}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`读取操作`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(n,{className:`h-5 w-5 text-red-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:K.length}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`交互轮次`})]})]}),(0,F.jsx)(A,{title:`事件密度时间线`,children:(0,F.jsx)(d,{width:`100%`,height:120,children:(0,F.jsxs)(v,{data:J,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`timelineGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.4}),(0,F.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]})}),(0,F.jsx)(m,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,F.jsx)(p,{dataKey:`time`,tick:!1}),(0,F.jsx)(f,{hide:!0}),(0,F.jsx)(y,{formatter:e=>[`${e} 事件`,`数量`]}),(0,F.jsx)(g,{type:`monotone`,dataKey:`count`,stroke:`#3b82f6`,fill:`url(#timelineGrad)`})]})})}),(0,F.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`phases`,`flow`,`events`].map(e=>(0,F.jsx)(`button`,{onClick:()=>z(e),className:E(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,R===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{phases:`阶段视图`,flow:`数据流图`,events:`事件列表`}[e]},e))}),R===`phases`&&(0,F.jsx)(`div`,{className:`space-y-3`,children:K.map((e,t)=>(0,F.jsx)(M.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},children:(0,F.jsxs)(A,{className:`!p-0 overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between p-4 cursor-pointer hover:bg-gray-50 transition-colors`,onClick:()=>L(I===t?null:t),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-white font-bold text-sm`,children:t+1}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-semibold text-gray-900`,children:e.name}),(0,F.jsxs)(`div`,{className:`text-sm text-gray-500`,children:[e.toolCalls,` 工具调用 · `,e.writeOps,` 写入 · `,e.artifacts.length,` 产物`]})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[e.duration&&(0,F.jsx)(`span`,{className:`text-sm text-gray-500`,children:k(e.duration)}),(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[e.artifacts.slice(0,3).map((e,t)=>(0,F.jsx)(j,{variant:`success`,size:`sm`,children:e},t)),e.artifacts.length>3&&(0,F.jsxs)(j,{variant:`default`,size:`sm`,children:[`+`,e.artifacts.length-3]})]}),I===t?(0,F.jsx)(c,{className:`h-5 w-5 text-gray-400`}):(0,F.jsx)(a,{className:`h-5 w-5 text-gray-400`})]})]}),I===t&&(0,F.jsx)(M.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`border-t border-gray-100`,children:(0,F.jsx)(`div`,{className:`p-4 max-h-96 overflow-y-auto space-y-2`,children:e.events.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,F.jsx)(`div`,{className:`text-gray-400 font-mono w-20 flex-shrink-0`,children:u(D(e.time),`HH:mm:ss`)}),(0,F.jsx)(j,{size:`sm`,variant:e.hookType===`PostToolUse`?`success`:e.hookType===`PreToolUse`?`info`:e.hookType===`UserPromptSubmit`?`warning`:`default`,children:e.hookType}),e.toolName&&(0,F.jsx)(`span`,{className:`font-mono text-gray-700 font-medium`,children:e.toolName}),e.input&&(0,F.jsx)(`span`,{className:`text-gray-500 truncate max-w-md`,children:e.input})]},t))})})]})},t))}),R===`flow`&&(0,F.jsx)(A,{title:`数据流图 (${q.nodes.length} 节点)`,children:(0,F.jsx)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:q.nodes.map((e,t)=>(0,F.jsxs)(M.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:t*.02},className:`flex items-center gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-center w-8`,children:[t>0&&(0,F.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`}),(0,F.jsx)(`div`,{className:E(`w-3 h-3 rounded-full border-2`,e.type===`intent`?`bg-blue-500 border-blue-500`:e.type===`artifact`?`bg-green-500 border-green-500`:e.type===`quality`?`bg-yellow-500 border-yellow-500`:`bg-gray-400 border-gray-400`)}),t<q.nodes.length-1&&(0,F.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`})]}),(0,F.jsxs)(`div`,{className:E(`flex-1 flex items-center gap-3 p-2 rounded-lg text-sm`,e.type===`intent`?`bg-blue-50`:e.type===`artifact`?`bg-green-50`:e.type===`quality`?`bg-yellow-50`:`bg-gray-50`),children:[(0,F.jsx)(`span`,{className:`font-mono text-xs text-gray-400`,children:u(D(e.time),`HH:mm:ss`)}),(0,F.jsx)(j,{size:`sm`,variant:e.type===`intent`?`info`:e.type===`artifact`?`success`:e.type===`quality`?`warning`:`default`,children:e.label}),e.detail&&(0,F.jsx)(`span`,{className:`text-gray-600 truncate`,children:e.detail})]})]},e.id))})}),R===`events`&&(0,F.jsx)(A,{title:`全部事件 (${V.events.length})`,children:(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(`table`,{className:`w-full`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`工具`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`详情`})]})}),(0,F.jsx)(`tbody`,{className:`text-sm`,children:V.events.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50`,children:[(0,F.jsx)(`td`,{className:`py-2 font-mono text-gray-500`,children:u(D(e.timestamp),`HH:mm:ss`)}),(0,F.jsx)(`td`,{className:`py-2`,children:(0,F.jsx)(j,{size:`sm`,variant:e.hook_type===`PostToolUse`?`success`:e.hook_type===`UserPromptSubmit`?`warning`:`default`,children:e.hook_type})}),(0,F.jsx)(`td`,{className:`py-2 font-mono`,children:e.tool_name||`-`}),(0,F.jsx)(`td`,{className:`py-2 text-gray-500 truncate max-w-md`,children:typeof e.tool_input==`string`?e.tool_input.slice(0,80):``})]},e.id))})]})})}),(0,F.jsx)(A,{title:`工具使用分布`,children:(0,F.jsx)(d,{width:`100%`,height:250,children:(0,F.jsxs)(h,{data:X,layout:`vertical`,children:[(0,F.jsx)(m,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,F.jsx)(p,{type:`number`}),(0,F.jsx)(f,{dataKey:`name`,type:`category`,width:80,tick:{fontSize:12}}),(0,F.jsx)(y,{}),(0,F.jsx)(_,{dataKey:`value`,fill:`#3b82f6`,radius:[0,4,4,0]})]})})})]})}export{I as default};
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Fn as t,Gn as n,On as r,Rn as i,Ut as a,en as o,er as ee,fr as s,gr as c,ir as te,lr as ne,o as l,pr as u,s as d}from"./vendor-DRGPi8ui.js";import{c as f}from"./vendor-react-DJI9oneq.js";import{a as p,n as m,r as h,t as re}from"./vendor-query-DqPOMnuX.js";import{c as g}from"./vendor-flow-srkes8If.js";import{O as ie,c as _,on as v,wt as y}from"./client-BvVpIixG.js";import{a as b,l as x,n as S,r as C,t as w}from"./ui-CDL3BZ13.js";import{t as T}from"./ErrorState-BOInXmfg.js";import{t as E}from"./exportCsv-Dm5Y5M_E.js";import{t as D}from"./ConfirmDialog-BKfwMp04.js";import{n as ae,r as oe}from"./Skeleton-B7PVDJJ_.js";import{t as se}from"./BatchProgress-BQ533tSf.js";var O=e(c(),1),k=g();function A(e,t){let n=t.getTime()-e.getTime();if(n<0)return`-`;let r=Math.floor(n/6e4),i=Math.floor(r/60);return i>0?`${i}h ${r%60}m`:r>0?`${r}m`:`${Math.floor(n/1e3)}s`}function j(){let e=p(),[c,g]=(0,O.useState)(``),[j,M]=(0,O.useState)(``),[N,P]=(0,O.useState)(``),[F,I]=(0,O.useState)(`all`),[L,R]=(0,O.useState)(new Set),[z,B]=(0,O.useState)(`start_time`),[V,H]=(0,O.useState)(!1),[U,W]=(0,O.useState)(!1),[G,K]=(0,O.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),ce=f(),q=(0,O.useRef)(null),{data:J,isLoading:le,isError:ue,refetch:Y}=h({queryKey:[`sessions`,{limit:100,status:j||void 0}],queryFn:()=>y({limit:100,status:j||void 0}).then(e=>e.data)}),X=m({mutationFn:e=>ie(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}}),Z=m({mutationFn:e=>_(e),onSuccess:t=>{R(new Set),e.invalidateQueries({queryKey:[`sessions`]}),t.failed.length>0&&alert(`删除完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
2
- `)}`)}}),de=m({mutationFn:({id:e,meta:t})=>v(e,t),onSuccess:()=>e.invalidateQueries({queryKey:[`sessions`]})}),Q=(J?.items.filter(e=>{let t=e.session_id.toLowerCase().includes(c.toLowerCase())||e.project_path.toLowerCase().includes(c.toLowerCase()),n=!N||e.project_path.split(`/`).pop()===N,r=F===`all`||new Date(e.start_time)>=l(new Date,F===`1d`?1:F===`7d`?7:30);return t&&n&&r})||[]).sort((e,t)=>{let n=0;return z===`start_time`?n=e.start_time.localeCompare(t.start_time):z===`event_count`?n=e.event_count-t.event_count:z===`duration`&&(n=(e.end_time?new Date(e.end_time).getTime()-new Date(e.start_time).getTime():1/0)-(t.end_time?new Date(t.end_time).getTime()-new Date(t.start_time).getTime():1/0)),V?n:-n}),fe=Array.from(new Set(J?.items.map(e=>e.project_path.split(`/`).pop()||``).filter(Boolean)||[])),pe=e=>{z===e?H(e=>!e):(B(e),H(!1))},$=re({count:Q.length,getScrollElement:()=>q.current,estimateSize:()=>72,overscan:10}),me=()=>{let e=[`Session ID`,`项目`,`状态`,`开始时间`,`结束时间`,`事件数`],t=Q.map(e=>[e.session_id,e.project_path,e.status,e.start_time,e.end_time||``,e.event_count]);E(`sessions-${d(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return le?(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(oe,{count:4}),(0,k.jsx)(ae,{count:6})]}):ue?(0,k.jsx)(T,{message:`会话数据加载失败`,onRetry:()=>Y()}):(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(C,{children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,k.jsxs)(`div`,{className:`relative flex-1`,children:[(0,k.jsx)(o,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,k.jsx)(`input`,{type:`text`,placeholder:`搜索会话 ID 或项目...`,value:c,onChange:e=>g(e.target.value),className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,k.jsxs)(`button`,{onClick:()=>W(e=>!e),className:b(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,U||j||N||F!==`all`?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,k.jsx)(r,{className:`h-4 w-4`}),`筛选`,(j||N||F!==`all`)&&(0,k.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:[j,N,F===`all`?``:F].filter(Boolean).length}),(0,k.jsx)(ee,{className:b(`h-3.5 w-3.5 transition-transform`,U&&`rotate-180`)})]}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[L.size>0&&(0,k.jsxs)(S,{variant:`danger`,size:`sm`,icon:a,onClick:()=>{K({open:!0,title:`批量删除会话`,description:`确定删除选中的 ${L.size} 个会话吗?此操作不可撤销。`,count:L.size,onConfirm:()=>{Z.mutate(Array.from(L)),K(e=>({...e,open:!1}))}})},loading:Z.isPending,children:[`删除 (`,L.size,`)`]}),(0,k.jsx)(S,{variant:`secondary`,size:`sm`,icon:i,onClick:()=>Q.length>0&&me(),children:`导出`}),(0,k.jsx)(S,{variant:`primary`,size:`sm`,onClick:()=>Y(),children:`刷新`})]})]}),Z.isPending&&(0,k.jsx)(`div`,{className:`mt-2`,children:(0,k.jsx)(se,{total:L.size,done:0,label:`批量删除中`})}),U&&(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,k.jsxs)(`select`,{value:j,onChange:e=>M(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,k.jsx)(`option`,{value:``,children:`全部状态`}),(0,k.jsx)(`option`,{value:`active`,children:`活跃`}),(0,k.jsx)(`option`,{value:`completed`,children:`已完成`}),(0,k.jsx)(`option`,{value:`interrupted`,children:`中断`})]}),(0,k.jsxs)(`select`,{value:N,onChange:e=>P(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,k.jsx)(`option`,{value:``,children:`全部项目`}),fe.map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1 border border-gray-200 rounded-lg overflow-hidden text-sm`,children:[(0,k.jsx)(te,{className:`h-3.5 w-3.5 text-gray-400 ml-2`}),[`all`,`1d`,`7d`,`30d`].map(e=>(0,k.jsx)(`button`,{onClick:()=>I(e),className:b(`px-2.5 py-1.5 transition-colors`,F===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:e===`all`?`全部`:e},e))]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,k.jsx)(`span`,{className:`text-gray-500 text-xs`,children:`排序:`}),[{key:`start_time`,label:`时间`},{key:`event_count`,label:`事件数`},{key:`duration`,label:`时长`}].map(({key:e,label:t})=>(0,k.jsxs)(`button`,{onClick:()=>pe(e),className:b(`px-2.5 py-1.5 rounded-lg transition-colors flex items-center gap-1`,z===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,z===e&&(0,k.jsx)(ne,{className:b(`h-3 w-3`,V&&`rotate-180`)})]},e))]})]})]})}),(0,k.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,k.jsxs)(C,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:J?.total||0}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总会话数`})]}),(0,k.jsxs)(C,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-green-600`,children:J?.items.filter(e=>e.status===`active`).length||0}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`活跃会话`})]}),(0,k.jsxs)(C,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:J?.items.filter(e=>e.status===`completed`).length||0}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`已完成`})]}),(0,k.jsxs)(C,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:Math.round((J?.items.reduce((e,t)=>e+t.event_count,0)||0)/(J?.items.length||1))}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`平均事件数`})]})]}),(0,k.jsx)(C,{title:`会话列表 (${Q.length})`,action:Q.length>0?(0,k.jsx)(`button`,{onClick:()=>{L.size===Q.length?R(new Set):R(new Set(Q.map(e=>e.session_id)))},className:`text-xs text-blue-600 hover:underline`,children:L.size===Q.length?`取消全选`:`全选`}):void 0,children:Q.length===0?(0,k.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,k.jsx)(u,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,k.jsx)(`p`,{children:`暂无会话记录`}),(0,k.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 开始一个会话后,记录将自动出现在这里`})]}):(0,k.jsx)(`div`,{ref:q,className:`h-[600px] overflow-auto`,children:(0,k.jsx)(`div`,{style:{height:`${$.getTotalSize()}px`,position:`relative`},children:$.getVirtualItems().map(e=>{let r=Q[e.index];return(0,k.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,k.jsxs)(`div`,{className:b(`flex items-center gap-3 p-4 rounded-lg border transition-all cursor-pointer mb-2`,L.has(r.session_id)?`border-blue-300 bg-blue-50`:`border-gray-100 hover:border-blue-200 hover:bg-blue-50/50`),onClick:()=>ce(`/sessions/${r.session_id}`),children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:L.has(r.session_id),onChange:e=>{e.stopPropagation(),R(e=>{let t=new Set(e);return t.has(r.session_id)?t.delete(r.session_id):t.add(r.session_id),t})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,k.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-6 gap-4 items-center`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`font-mono text-sm font-medium text-gray-900`,children:[r.session_id.slice(0,12),`...`]}),(0,k.jsx)(`div`,{className:`text-xs text-gray-500 mt-1`,children:r.project_path.split(`/`).slice(-2).join(`/`)})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(w,{variant:r.status===`active`?`success`:r.status===`completed`?`info`:`warning`,children:r.status}),r.archived&&(0,k.jsx)(w,{variant:`default`,children:`已归档`})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,k.jsx)(u,{className:`h-4 w-4`}),r.event_count,` 事件`]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,k.jsx)(n,{className:`h-4 w-4`}),d(x(r.start_time),`MM-dd HH:mm`)]}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600`,children:r.end_time?A(x(r.start_time),x(r.end_time)):A(x(r.start_time),new Date)}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,k.jsx)(S,{variant:`ghost`,size:`sm`,icon:t,children:`查看详情`}),(0,k.jsx)(S,{variant:`ghost`,size:`sm`,icon:s,onClick:e=>{e.stopPropagation(),de.mutate({id:r.session_id,meta:{archived:!r.archived}})},title:r.archived?`取消归档`:`归档`}),(0,k.jsx)(S,{variant:`ghost`,size:`sm`,icon:a,onClick:e=>{e.stopPropagation(),K({open:!0,title:`删除会话`,description:`确认删除此会话及其所有数据?此操作不可撤销。`,onConfirm:()=>{X.mutate(r.session_id),K(e=>({...e,open:!1}))}})},loading:X.isPending&&X.variables===r.session_id})]})]})]})},r.session_id)})})})}),(0,k.jsx)(D,{open:G.open,title:G.title,description:G.description,count:G.count,variant:`danger`,onConfirm:G.onConfirm,onCancel:()=>K({...G,open:!1})})]})}export{j as default};
@@ -1 +0,0 @@
1
- import{c as e}from"./vendor-flow-srkes8If.js";import{a as t}from"./ui-CDL3BZ13.js";var n=e();function r({className:e}){return(0,n.jsx)(`div`,{className:t(`animate-pulse bg-gray-200 rounded`,e)})}function i({rows:e=3}){return(0,n.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-100 p-4 space-y-3`,children:[(0,n.jsx)(r,{className:`h-4 w-1/3`}),Array.from({length:e}).map((e,t)=>(0,n.jsx)(r,{className:`h-3 ${t%2==0?`w-full`:`w-4/5`}`},t))]})}function a({count:e=5}){return(0,n.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:e}).map((e,t)=>(0,n.jsxs)(`div`,{className:`flex items-center gap-3 p-4 rounded-lg border border-gray-100`,children:[(0,n.jsx)(r,{className:`h-4 w-4 rounded`}),(0,n.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,n.jsx)(r,{className:`h-3 w-1/4`}),(0,n.jsx)(r,{className:`h-3 w-1/2`})]}),(0,n.jsx)(r,{className:`h-6 w-16 rounded-full`})]},t))})}function o({count:e=4}){return(0,n.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-${e} gap-4`,children:Array.from({length:e}).map((e,t)=>(0,n.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-100 p-4 text-center space-y-2`,children:[(0,n.jsx)(r,{className:`h-8 w-16 mx-auto`}),(0,n.jsx)(r,{className:`h-3 w-20 mx-auto`})]},t))})}export{a as n,o as r,i as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{It as t,Jn as n,Kt as r,Ln as i,Lt as a,Mn as o,On as s,Rn as c,Ut as l,Vt as u,Xt as d,_n as f,an as p,cn as m,en as h,er as g,gr as _,rn as v,tn as y,un as b}from"./vendor-DRGPi8ui.js";import{a as x,n as S,r as C}from"./vendor-query-DqPOMnuX.js";import{c as w}from"./vendor-flow-srkes8If.js";import{Dt as T,Et as ee,F as E,It as te,P as ne,T as D,Tt as O,Vt as k,Xt as A,cn as j,k as M,l as N,lt as P,r as F,sn as I}from"./client-BvVpIixG.js";import{a as L}from"./ui-CDL3BZ13.js";import{n as R}from"./Toast-BbB3oD2a.js";import{t as z}from"./ConfirmDialog-BKfwMp04.js";var B=e(_(),1),V=w(),H={local:`bg-blue-50 text-blue-700`,remote:`bg-purple-50 text-purple-700`,generated:`bg-green-50 text-green-700`,official:`bg-amber-50 text-amber-700`,user:`bg-pink-50 text-pink-700`},U={local:`本地`,remote:`远程`,generated:`AI生成`,official:`官方`,user:`用户`};function W(){let[e,t]=(0,B.useState)(`list`),[i,a]=(0,B.useState)(``),[o,c]=(0,B.useState)(``),[d,p]=(0,B.useState)(new Set),[m,h]=(0,B.useState)(``),[_,v]=(0,B.useState)(null),[y,w]=(0,B.useState)(!1),[D,O]=(0,B.useState)(null),[j,P]=(0,B.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),F=x(),{data:I,isLoading:W}=C({queryKey:[`skills`,i,o],queryFn:()=>T({source:i||void 0,tag:o||void 0}).then(e=>e.data)}),{data:G}=C({queryKey:[`skills-status`],queryFn:()=>ee().then(e=>e.data)}),K=S({mutationFn:e=>A(e).then(e=>e.data),onSuccess:e=>{v(e),R(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),q=S({mutationFn:e=>te(e).then(e=>e.data),onSuccess:e=>{R(`已安装: ${e.skill.name}`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),J=S({mutationFn:e=>M(e).then(e=>e.data),onSuccess:(e,t)=>{R(`已删除: ${t}`,`success`),p(e=>{let n=new Set(e);return n.delete(t),n}),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Y=S({mutationFn:e=>N(e).then(e=>e.data),onSuccess:e=>{R(`已删除 ${e.success.length} 个技能`,`success`),p(new Set),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),X=S({mutationFn:()=>E().then(e=>e.data),onSuccess:e=>{R(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Z=S({mutationFn:()=>ne().then(e=>e.data),onSuccess:e=>{R(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Q=S({mutationFn:()=>k().then(e=>e.data),onSuccess:e=>{R(`修复完成:${e.repaired.length} 个技能已修复`,`success`),F.invalidateQueries({queryKey:[`skills`]})}}),$=I?.items||[],se=$.length>0&&d.size===$.length,ce=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`技能管理`}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理 Claude Code 技能库,搜索安装、进化优化`})]}),G&&(0,V.jsx)(`div`,{className:`flex items-center gap-3`,children:[{label:`全部`,value:G.total,color:`text-gray-700`},{label:`官方`,value:G.official,color:`text-amber-600`},{label:`本地`,value:G.local,color:`text-blue-600`},{label:`AI生成`,value:G.generated,color:`text-green-600`}].map(({label:e,value:t,color:n})=>(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`div`,{className:L(`text-xl font-bold`,n),children:t}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500`,children:e})]},e))})]}),(0,V.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,V.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`list`,label:`技能列表`},{key:`search`,label:`搜索安装`},{key:`evolve`,label:`进化管理`},{key:`sources`,label:`技能源`}].map(n=>(0,V.jsx)(`button`,{onClick:()=>t(n.key),className:L(`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors`,e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`),children:n.label},n.key))})}),e===`list`&&(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`button`,{onClick:()=>w(!y),className:L(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,y?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,V.jsx)(s,{className:`h-4 w-4`}),`筛选`,(0,V.jsx)(g,{className:L(`h-3.5 w-3.5 transition-transform`,y&&`rotate-180`)})]}),(0,V.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[$.length,` 个技能`]}),d.size>0&&(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,d.size,` 个`]}),(0,V.jsxs)(`button`,{onClick:()=>{P({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${d.size} 个技能吗?此操作不可恢复。`,count:d.size,onConfirm:()=>{Y.mutate(Array.from(d)),P(e=>({...e,open:!1}))}})},disabled:Y.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-50 text-red-600 hover:bg-red-100 rounded-lg transition-colors`,children:[(0,V.jsx)(l,{className:`h-3.5 w-3.5`}),`批量删除`]})]})]}),y&&(0,V.jsxs)(`div`,{className:`flex gap-3 mt-3 pt-3 border-t border-gray-100`,children:[(0,V.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,V.jsx)(`option`,{value:``,children:`全部来源`}),(0,V.jsx)(`option`,{value:`local`,children:`本地`}),(0,V.jsx)(`option`,{value:`official`,children:`官方`}),(0,V.jsx)(`option`,{value:`remote`,children:`远程`}),(0,V.jsx)(`option`,{value:`generated`,children:`AI生成`}),(0,V.jsx)(`option`,{value:`user`,children:`用户`})]}),(0,V.jsx)(`input`,{type:`text`,placeholder:`按标签筛选...`,value:o,onChange:e=>c(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]}),W?(0,V.jsx)(`div`,{className:`flex items-center justify-center h-48`,children:(0,V.jsx)(f,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:se,onChange:()=>{p(se?new Set:new Set($.map(e=>e.name)))},className:`rounded`})}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`技能名称`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`调用次数`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`成功率`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`最近使用`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:$.map(e=>(0,V.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:d.has(e.name),onChange:()=>ce(e.name),className:`rounded`})}),(0,V.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,V.jsx)(`button`,{onClick:()=>O(e.name),className:`font-medium text-blue-600 hover:text-blue-700 cursor-pointer`,children:e.name}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs`,children:e.description}),e.tags&&e.tags.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.tags.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-gray-100 text-gray-600 text-xs rounded`,children:[(0,V.jsx)(r,{className:`h-2.5 w-2.5`}),e]},e))})]}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`span`,{className:L(`px-2 py-0.5 text-xs rounded-full font-medium`,H[e.source]||`bg-gray-100 text-gray-600`),children:U[e.source]||e.source})}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.stats.callCount}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:e.stats.callCount>0?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`div`,{className:`w-16 h-1.5 bg-gray-200 rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:L(`h-full rounded-full`,e.stats.successRate>=.8?`bg-green-500`:e.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`),style:{width:`${e.stats.successRate*100}%`}})}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-600`,children:[(e.stats.successRate*100).toFixed(0),`%`]})]}):(0,V.jsx)(`span`,{className:`text-xs text-gray-400`,children:`未使用`})}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-xs text-gray-500`,children:e.stats.lastUsed?new Date(e.stats.lastUsed).toLocaleDateString(`zh-CN`):`—`}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`button`,{onClick:()=>{P({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{J.mutate(e.name),P(e=>({...e,open:!1}))}})},disabled:J.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,V.jsx)(l,{className:`h-4 w-4`})})})]},e.name))})]}),$.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12`,children:[(0,V.jsx)(b,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500`,children:`暂无技能`})]})]}),G&&(G.topUsed.length>0||G.topRated.length>0)&&(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[G.topUsed.length>0&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,V.jsx)(u,{className:`h-4 w-4 text-blue-500`}),`最常用技能`]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:G.topUsed.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,V.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,V.jsxs)(`span`,{className:`text-gray-500`,children:[e.calls,` 次`]})]},e.name))})]}),G.topRated.length>0&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,V.jsx)(n,{className:`h-4 w-4 text-green-500`}),`评分最高技能`]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:G.topRated.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,V.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,V.jsxs)(`span`,{className:`text-gray-500`,children:[(e.rating*100).toFixed(0),`%`]})]},e.name))})]})]})]}),e===`search`&&(0,V.jsx)(ie,{searchQuery:m,setSearchQuery:h,searchResults:_,onSearch:()=>K.mutate(m),onInstall:e=>q.mutate(e),isSearching:K.isPending,isInstalling:q.isPending}),e===`evolve`&&(0,V.jsx)(ae,{onEvolve:()=>X.mutate(),onDistill:()=>Z.mutate(),onRepair:()=>Q.mutate(),isEvolving:X.isPending,isDistilling:Z.isPending,isRepairing:Q.isPending,evolveResult:X.data,distillResult:Z.data,repairResult:Q.data}),e===`sources`&&(0,V.jsx)(oe,{}),D&&(0,V.jsx)(re,{name:D,onClose:()=>O(null)}),(0,V.jsx)(z,{open:j.open,title:j.title,description:j.description,count:j.count,onConfirm:j.onConfirm,onCancel:()=>P(e=>({...e,open:!1}))})]})}function re({name:e,onClose:n}){let[a,s]=(0,B.useState)(`content`),[c,u]=(0,B.useState)(!1),[d,h]=(0,B.useState)(``),[g,_]=(0,B.useState)(``),v=x(),{data:w,isLoading:T}=C({queryKey:[`skill-detail`,e],queryFn:()=>O(e).then(e=>e.data)}),{data:ee}=C({queryKey:[`orchestration-mappings`],queryFn:()=>P().then(e=>e.data),enabled:a===`orchestration`}),E=ee?.items.find(t=>t.skill===e),[te,ne]=(0,B.useState)([]),k=E?.keywords??[],A=S({mutationFn:t=>I(e,t),onSuccess:()=>{R(`技能内容已保存`,`success`),u(!1),v.invalidateQueries({queryKey:[`skill-detail`,e]})},onError:()=>R(`保存失败`,`error`)}),M=S({mutationFn:t=>j(e,t),onSuccess:()=>{R(`编排映射已保存`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})},onError:()=>R(`保存失败`,`error`)}),N=S({mutationFn:()=>D(e),onSuccess:()=>{R(`编排映射已删除`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})}}),[F,L]=(0,B.useState)(null),z=F??k;return(0,V.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/40`,onClick:n,children:(0,V.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-gray-100`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(b,{className:`h-5 w-5 text-blue-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:e}),w&&(0,V.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:w.description})]})]}),(0,V.jsx)(`button`,{onClick:n,className:`p-1.5 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,V.jsx)(t,{className:`h-5 w-5`})})]}),(0,V.jsx)(`div`,{className:`flex gap-1 px-6 pt-3 border-b border-gray-100`,children:[`content`,`stats`,`orchestration`].map(e=>(0,V.jsx)(`button`,{onClick:()=>s(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${a===e?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:e===`content`?`技能内容`:e===`stats`?`使用情况`:`编排映射`},e))}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:T?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,V.jsx)(f,{className:`h-6 w-6 animate-spin text-blue-500`})}):w?a===`content`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,V.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${H[w.source]||`bg-gray-100 text-gray-600`}`,children:U[w.source]||w.source}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,w.version]}),w.requires?.bins&&w.requires.bins.length>0&&(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,w.requires.bins.join(`, `)]}),w.filePath&&(0,V.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:w.filePath})]}),w.tags&&w.tags.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:w.tags.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 text-xs rounded-full`,children:[(0,V.jsx)(r,{className:`h-2.5 w-2.5`}),e]},e))}),w.content||w.filePath?(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-xs text-gray-500 mb-2 flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(o,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),w.filePath&&!c&&(0,V.jsxs)(`button`,{onClick:()=>{h(w.content||``),u(!0)},className:`flex items-center gap-1 text-blue-600 hover:underline`,children:[(0,V.jsx)(m,{className:`h-3 w-3`}),`编辑`]}),c&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>u(!1),className:`text-gray-500 hover:text-gray-700 text-xs`,children:`取消`}),(0,V.jsxs)(`button`,{onClick:()=>A.mutate(d),disabled:A.isPending,className:`flex items-center gap-1 text-green-600 hover:underline text-xs`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),A.isPending?`保存中...`:`保存`]})]})]}),c?(0,V.jsx)(`textarea`,{value:d,onChange:e=>h(e.target.value),className:`w-full text-xs text-gray-800 bg-gray-50 rounded-lg p-4 border border-blue-300 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono leading-relaxed resize-y`,style:{minHeight:`40vh`,maxHeight:`60vh`}}):(0,V.jsx)(`pre`,{className:`text-xs text-gray-800 bg-gray-50 rounded-lg p-4 overflow-auto whitespace-pre-wrap border border-gray-200 max-h-[50vh] leading-relaxed`,children:w.content||`(空文件)`})]}):(0,V.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),w.sourceUrl&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,V.jsx)(i,{className:`h-3.5 w-3.5 text-gray-400`}),(0,V.jsx)(`a`,{href:w.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:w.sourceUrl})]})]}):a===`stats`?(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-blue-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-blue-700`,children:w.stats.callCount}),(0,V.jsx)(`div`,{className:`text-xs text-blue-600 mt-1`,children:`总调用次数`})]}),(0,V.jsxs)(`div`,{className:`bg-green-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-green-700`,children:w.stats.callCount>0?`${(w.stats.successRate*100).toFixed(0)}%`:`—`}),(0,V.jsx)(`div`,{className:`text-xs text-green-600 mt-1`,children:`成功率`})]}),(0,V.jsxs)(`div`,{className:`bg-purple-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-purple-700`,children:w.stats.userFeedback.positive+w.stats.userFeedback.negative>0?`${w.stats.userFeedback.positive} / ${w.stats.userFeedback.negative}`:`—`}),(0,V.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),w.stats.callCount>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-500 mb-1.5`,children:[(0,V.jsx)(`span`,{children:`成功率`}),(0,V.jsxs)(`span`,{children:[(w.stats.successRate*100).toFixed(1),`%`]})]}),(0,V.jsx)(`div`,{className:`w-full h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full transition-all ${w.stats.successRate>=.8?`bg-green-500`:w.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${w.stats.successRate*100}%`}})})]}),(0,V.jsxs)(`div`,{className:`bg-gray-50 rounded-xl p-4`,children:[(0,V.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`最近使用时间`}),(0,V.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:w.stats.lastUsed?new Date(w.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),w.stats.callCount===0&&(0,V.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`该技能尚未被调用过`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`配置触发该技能的关键词,当用户输入包含这些关键词时,编排引擎会自动调用此技能。`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`触发关键词`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2 min-h-[40px] p-3 bg-gray-50 rounded-lg border border-gray-200`,children:z.length===0?(0,V.jsx)(`span`,{className:`text-xs text-gray-400`,children:`暂无关键词,添加后可触发自动编排`}):z.map((e,n)=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs rounded-full`,children:[e,(0,V.jsx)(`button`,{onClick:()=>L(z.filter((e,t)=>t!==n)),className:`hover:text-red-500 transition-colors`,children:(0,V.jsx)(t,{className:`h-3 w-3`})})]},n))})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.key===`Enter`&&g.trim()){let e=g.trim();z.includes(e)||L([...z,e]),_(``)}},placeholder:`输入关键词,回车添加`,className:`flex-1 px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`button`,{onClick:()=>{let e=g.trim();e&&!z.includes(e)&&L([...z,e]),_(``)},disabled:!g.trim(),className:`px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:(0,V.jsx)(p,{className:`h-4 w-4`})})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>M.mutate(z),disabled:M.isPending||F===null,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5`}),M.isPending?`保存中...`:`保存映射`]}),E&&(0,V.jsxs)(`button`,{onClick:()=>N.mutate(),disabled:N.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-red-50 text-red-600 rounded-lg hover:bg-red-100 disabled:opacity-50 transition-colors`,children:[(0,V.jsx)(l,{className:`h-3.5 w-3.5`}),`删除映射`]})]})]}):(0,V.jsx)(`div`,{className:`text-center py-16 text-gray-500`,children:`技能不存在`})})]})})}function ie({searchQuery:e,setSearchQuery:t,searchResults:n,onSearch:r,onInstall:a,isSearching:o,isInstalling:s}){return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:(0,V.jsxs)(`div`,{className:`flex gap-3`,children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`搜索技能(GitHub / npm)...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`flex-1 px-4 py-2.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsxs)(`button`,{onClick:r,disabled:o||!e.trim(),className:`flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[o?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(h,{className:`h-4 w-4`}),`搜索`]})]})}),n&&(0,V.jsxs)(`div`,{className:`space-y-6`,children:[n.github.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`GitHub 结果 (`,n.github.length,`)`]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:n.github.map((e,t)=>(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-blue-300 transition-colors`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,V.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),(0,V.jsxs)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[(0,V.jsx)(i,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,V.jsxs)(`button`,{onClick:()=>a(e.sourceUrl),disabled:s,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,V.jsx)(c,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.npm.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`npm 结果 (`,n.npm.length,`)`]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:n.npm.map((e,t)=>(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-purple-300 transition-colors`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,V.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),e.installCommand&&(0,V.jsx)(`code`,{className:`text-xs bg-gray-100 px-2 py-1 rounded`,children:e.installCommand})]}),(0,V.jsxs)(`button`,{onClick:()=>a(e.sourceUrl),disabled:s,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 rounded-lg transition-colors`,children:[(0,V.jsx)(c,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.github.length===0&&n.npm.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,V.jsx)(h,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500`,children:`未找到匹配的技能`})]})]})]})}function ae({onEvolve:e,onDistill:t,onRepair:n,isEvolving:r,isDistilling:i,isRepairing:o,evolveResult:s,distillResult:l,repairResult:u}){return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-blue-50 rounded-lg`,children:(0,V.jsx)(d,{className:`h-5 w-5 text-blue-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`技能进化`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`淘汰、优化、生成`})]})]}),(0,V.jsxs)(`button`,{onClick:e,disabled:r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[r?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(v,{className:`h-4 w-4`}),r?`进化中...`:`开始进化`]}),s&&(0,V.jsxs)(`div`,{className:`mt-4 space-y-2 text-sm`,children:[s.repaired?.length>0&&(0,V.jsxs)(`div`,{className:`text-green-600`,children:[`✔ 修复 `,s.repaired.length,` 个`]}),s.retired?.length>0&&(0,V.jsxs)(`div`,{className:`text-red-600`,children:[`- 淘汰 `,s.retired.length,` 个`]}),s.optimized?.length>0&&(0,V.jsxs)(`div`,{className:`text-blue-600`,children:[`↑ 优化 `,s.optimized.length,` 个`]}),s.generated?.length>0&&(0,V.jsxs)(`div`,{className:`text-green-600`,children:[`+ 生成 `,s.generated.length,` 个`]})]})]}),(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-purple-50 rounded-lg`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-purple-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`社区蒸馏`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`从精选源采集`})]})]}),(0,V.jsxs)(`button`,{onClick:t,disabled:i,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:[i?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(c,{className:`h-4 w-4`}),i?`蒸馏中...`:`开始蒸馏`]}),l&&l.distilled?.length>0&&(0,V.jsxs)(`div`,{className:`mt-4 text-sm text-purple-600`,children:[`✦ 新增 `,l.distilled.length,` 个技能`]})]}),(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-amber-50 rounded-lg`,children:(0,V.jsx)(a,{className:`h-5 w-5 text-amber-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`修复残缺`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`AI 修复低质量技能`})]})]}),(0,V.jsxs)(`button`,{onClick:n,disabled:o,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-amber-600 text-white rounded-lg hover:bg-amber-700 disabled:opacity-50 transition-colors`,children:[o?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(a,{className:`h-4 w-4`}),o?`修复中...`:`开始修复`]}),u&&u.repaired?.length>0&&(0,V.jsxs)(`div`,{className:`mt-4 text-sm text-amber-600`,children:[`✔ 修复 `,u.repaired.length,` 个技能`]})]})]}),(0,V.jsxs)(`div`,{className:`bg-blue-50 rounded-xl border border-blue-200 p-4`,children:[(0,V.jsx)(`h4`,{className:`text-sm font-semibold text-blue-900 mb-2`,children:`进化机制说明`}),(0,V.jsxs)(`ul`,{className:`text-sm text-blue-700 space-y-1`,children:[(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`技能进化`}),`:根据使用统计自动淘汰低效技能、优化高频技能、生成新技能`]}),(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`社区蒸馏`}),`:从 GitHub 精选仓库采集优质技能并蒸馏为官方技能`]}),(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`修复残缺`}),`:检测并修复缺少描述、版本号或格式错误的技能文件`]})]})]})]})}function oe(){let e=x(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:a}=C({queryKey:[`skill-sources`],queryFn:()=>F.get(`/skills/sources`).then(e=>e.data)}),o=S({mutationFn:e=>F.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{R(`技能源已添加`,`success`),n(!1),i({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),s=S({mutationFn:e=>F.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{R(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),u=a?.builtIn||[],d=a?.user||[];return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,V.jsx)(c,{className:`h-4 w-4`}),`添加技能源`]})}),t&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900 mb-4`,children:`添加自定义技能源`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`仓库 (owner/repo)`,value:r.repo,onChange:e=>i({...r,repo:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`目录路径`,value:r.dir,onChange:e=>i({...r,dir:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`分支 (默认 main)`,value:r.branch,onChange:e=>i({...r,branch:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsxs)(`select`,{value:r.format,onChange:e=>i({...r,format:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,V.jsx)(`option`,{value:`command-md`,children:`command-md`}),(0,V.jsx)(`option`,{value:`skill-md`,children:`skill-md`})]}),(0,V.jsx)(`input`,{type:`text`,placeholder:`描述`,value:r.description,onChange:e=>i({...r,description:e.target.value}),className:`col-span-2 px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 mt-4`,children:[(0,V.jsx)(`button`,{onClick:()=>o.mutate(r),disabled:!r.repo||!r.dir||o.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:o.isPending?`添加中...`:`确认添加`}),(0,V.jsx)(`button`,{onClick:()=>n(!1),className:`px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`内置技能源`}),(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:u.map((e,t)=>(0,V.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,V.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,V.jsx)(`span`,{className:`px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded`,children:`内置`})]},t))})]}),d.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`用户自定义源`}),(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:d.map((e,t)=>(0,V.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,V.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,V.jsx)(`button`,{onClick:()=>s.mutate(e.repo),disabled:s.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,V.jsx)(l,{className:`h-4 w-4`})})]},t))})]})]})}export{W as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Dn as t,Gn as n,Vt as r,Yn as i,dr as a,gr as o,nn as s,pr as c,qn as l,s as u}from"./vendor-DRGPi8ui.js";import{c as d,l as f}from"./vendor-react-DJI9oneq.js";import{a as p,n as m,r as h}from"./vendor-query-DqPOMnuX.js";import{c as g}from"./vendor-flow-srkes8If.js";import{At as _,Ot as v,X as y,kt as b,qt as x}from"./client-BvVpIixG.js";import{l as S,n as C,r as w,t as T}from"./ui-CDL3BZ13.js";import{t as E}from"./vendor-motion-CQmdgnI8.js";import{t as D}from"./ErrorState-BOInXmfg.js";import{t as O}from"./ConfirmDialog-BKfwMp04.js";import{t as k}from"./Skeleton-B7PVDJJ_.js";var A=e(o(),1),j=g(),M={multi_retry_pass:`多次重试通过`,strategy_reliable:`策略可靠`,strategy_ineffective:`策略无效`,backtrack_failure:`回溯失败`,diagnosis_pattern:`诊断模式`},N={multi_retry_pass:`bg-yellow-100 text-yellow-700`,strategy_reliable:`bg-green-100 text-green-700`,strategy_ineffective:`bg-red-100 text-red-700`,backtrack_failure:`bg-orange-100 text-orange-700`,diagnosis_pattern:`bg-purple-100 text-purple-700`};function P(){let{id:e}=f(),o=d(),g=p(),[P,F]=(0,A.useState)({open:!1,versionId:``,version:``}),{data:I}=h({queryKey:[`templates`],queryFn:()=>_().then(e=>e.data)}),{data:L,isLoading:R}=h({queryKey:[`template-versions`,e],queryFn:()=>b(e).then(e=>e.data),enabled:!!e}),{data:z,isLoading:B}=h({queryKey:[`template-stats`,e],queryFn:()=>v(e).then(e=>e.data),enabled:!!e}),{data:V,isLoading:H}=h({queryKey:[`evolution-events`,e],queryFn:()=>y({template_id:e,limit:50}).then(e=>e.data),enabled:!!e}),U=m({mutationFn:({versionId:t})=>x(e,t),onSuccess:()=>{g.invalidateQueries({queryKey:[`templates`]}),g.invalidateQueries({queryKey:[`template-versions`,e]}),F({open:!1,versionId:``,version:``})}});if(!e)return(0,j.jsx)(D,{message:`模板 ID 缺失`});let W=(I?.items)?.find(t=>t.id===e),G=L?.items||[],K=V?.items||[];if(!W)return(0,j.jsx)(k,{rows:5});let q=R||B||H;return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,j.jsx)(C,{variant:`ghost`,size:`sm`,icon:a,onClick:()=>o(`/templates`),children:`返回`}),(0,j.jsxs)(`div`,{className:`flex-1`,children:[(0,j.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:W.name}),(0,j.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:W.description})]}),(0,j.jsx)(T,{size:`sm`,className:W.source===`builtin`?`bg-blue-100 text-blue-700`:`bg-green-100 text-green-700`,children:W.source===`builtin`?`内置`:W.source===`convention`?`规范`:`自定义`})]}),z&&(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,j.jsx)(w,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`p-2 bg-blue-100 rounded-lg`,children:(0,j.jsx)(c,{className:`h-5 w-5 text-blue-600`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:z.total_plans}),(0,j.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总执行次数`})]})]})}),(0,j.jsx)(w,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`p-2 bg-green-100 rounded-lg`,children:(0,j.jsx)(i,{className:`h-5 w-5 text-green-600`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:z.status_breakdown.find(e=>e.status===`completed`)?.count||0}),(0,j.jsx)(`div`,{className:`text-sm text-gray-500`,children:`成功次数`})]})]})}),(0,j.jsx)(w,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`p-2 bg-red-100 rounded-lg`,children:(0,j.jsx)(l,{className:`h-5 w-5 text-red-600`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:z.status_breakdown.find(e=>e.status===`failed`)?.count||0}),(0,j.jsx)(`div`,{className:`text-sm text-gray-500`,children:`失败次数`})]})]})}),(0,j.jsx)(w,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`p-2 bg-purple-100 rounded-lg`,children:(0,j.jsx)(n,{className:`h-5 w-5 text-purple-600`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:z.avg_duration_sec?`${Math.round(z.avg_duration_sec/60)}m`:`-`}),(0,j.jsx)(`div`,{className:`text-sm text-gray-500`,children:`平均耗时`})]})]})})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,j.jsxs)(w,{children:[(0,j.jsxs)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2`,children:[(0,j.jsx)(t,{className:`h-5 w-5`}),`版本历史`]}),q?(0,j.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`加载中...`}):G.length===0?(0,j.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`暂无版本历史`}):(0,j.jsx)(`div`,{className:`space-y-3`,children:G.map((e,t)=>(0,j.jsxs)(E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.05},className:`flex items-start justify-between p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors`,children:[(0,j.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`font-medium text-gray-900`,children:[`v`,e.version]}),t===0&&(0,j.jsx)(T,{size:`sm`,className:`bg-green-100 text-green-700`,children:`当前`})]}),e.evolution_reason&&(0,j.jsx)(`p`,{className:`text-sm text-gray-600 mt-1 line-clamp-2`,children:e.evolution_reason}),(0,j.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:u(S(e.created_at),`yyyy-MM-dd HH:mm`)})]}),t>0&&(0,j.jsx)(C,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>F({open:!0,versionId:e.version_id,version:e.version}),children:`回滚`})]},e.version_id))})]}),(0,j.jsxs)(w,{children:[(0,j.jsxs)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2`,children:[(0,j.jsx)(r,{className:`h-5 w-5`}),`进化事件`]}),q?(0,j.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`加载中...`}):K.length===0?(0,j.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`暂无进化事件`}):(0,j.jsx)(`div`,{className:`space-y-3 max-h-[500px] overflow-y-auto`,children:K.map((e,t)=>(0,j.jsx)(E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.05},className:`p-3 border border-gray-200 rounded-lg`,children:(0,j.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(T,{size:`sm`,className:N[e.signal_type]||`bg-gray-100 text-gray-700`,children:M[e.signal_type]||e.signal_type}),(0,j.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,j.jsx)(`p`,{className:`text-sm text-gray-700`,children:e.action}),(0,j.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:u(S(e.created_at),`yyyy-MM-dd HH:mm`)})]})]})},e.event_id))})]})]}),z&&z.node_stats.length>0&&(0,j.jsxs)(w,{children:[(0,j.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4`,children:`节点成功率`}),(0,j.jsx)(`div`,{className:`space-y-3`,children:z.node_stats.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,j.jsx)(`div`,{className:`w-32 text-sm text-gray-700 truncate`,children:e.phase}),(0,j.jsxs)(`div`,{className:`flex-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`flex-1 h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,j.jsx)(`div`,{className:`h-full bg-green-500 transition-all`,style:{width:`${e.success_rate*100}%`}})}),(0,j.jsxs)(`span`,{className:`text-sm font-medium text-gray-900 w-12 text-right`,children:[Math.round(e.success_rate*100),`%`]})]}),(0,j.jsxs)(`p`,{className:`text-xs text-gray-500 mt-1`,children:[e.total_attempts,` 次尝试`]})]})]},t))})]}),(0,j.jsx)(O,{open:P.open,title:`确认回滚`,description:`确认将模板回滚到版本 ${P.version}?此操作将覆盖当前版本。`,variant:`warning`,onConfirm:()=>U.mutate({versionId:P.versionId}),onCancel:()=>F({open:!1,versionId:``,version:``})})]})}export{P as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Dn as t,Fn as n,Jt as r,Sn as i,an as a,en as o,gr as s,s as c}from"./vendor-DRGPi8ui.js";import{c as l}from"./vendor-react-DJI9oneq.js";import{r as u}from"./vendor-query-DqPOMnuX.js";import{c as d}from"./vendor-flow-srkes8If.js";import{At as f}from"./client-BvVpIixG.js";import{l as p,n as m,r as h,t as g}from"./ui-CDL3BZ13.js";import{t as _}from"./vendor-motion-CQmdgnI8.js";import{t as v}from"./ErrorState-BOInXmfg.js";import{n as y}from"./Skeleton-B7PVDJJ_.js";var b=e(s(),1),x=d();function S(){let e=l(),[s,d]=(0,b.useState)(``),[S,C]=(0,b.useState)(`all`),{data:w,isLoading:T,isError:E,refetch:D}=u({queryKey:[`templates`],queryFn:()=>f().then(e=>e.data)});if(T)return(0,x.jsx)(y,{count:5});if(E)return(0,x.jsx)(v,{message:`模板数据加载失败`,onRetry:()=>D()});let O=w?.items||[],k=O.filter(e=>{let t=!s||e.name.toLowerCase().includes(s.toLowerCase())||e.description.toLowerCase().includes(s.toLowerCase()),n=S===`all`||e.source===S;return t&&n}),A={builtin:`bg-blue-100 text-blue-700`,convention:`bg-purple-100 text-purple-700`,user:`bg-green-100 text-green-700`},j={builtin:`内置`,convention:`规范`,user:`自定义`};return(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`流水线模板`}),(0,x.jsxs)(`p`,{className:`text-sm text-gray-500 mt-1`,children:[`管理和查看流水线模板,共 `,O.length,` 个模板`]})]}),(0,x.jsx)(m,{variant:`primary`,icon:a,onClick:()=>e(`/templates/new`),children:`新建模板`})]}),(0,x.jsx)(h,{children:(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center`,children:[(0,x.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,x.jsx)(o,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,x.jsx)(`input`,{type:`text`,placeholder:`搜索模板名称或描述...`,value:s,onChange:e=>d(e.target.value),className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]}),(0,x.jsxs)(`select`,{value:S,onChange:e=>C(e.target.value),className:`px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,x.jsx)(`option`,{value:`all`,children:`全部来源`}),(0,x.jsx)(`option`,{value:`builtin`,children:`内置模板`}),(0,x.jsx)(`option`,{value:`convention`,children:`规范模板`}),(0,x.jsx)(`option`,{value:`user`,children:`自定义模板`})]})]})}),(0,x.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:k.map((a,o)=>(0,x.jsx)(_.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:o*.05},children:(0,x.jsx)(h,{className:`h-full hover:shadow-md transition-shadow cursor-pointer`,onClick:()=>e(`/templates/${a.id}`),children:(0,x.jsxs)(`div`,{className:`space-y-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:a.name}),(0,x.jsx)(`p`,{className:`text-sm text-gray-500 mt-1 line-clamp-2`,children:a.description})]}),(0,x.jsx)(g,{size:`sm`,className:A[a.source],children:j[a.source]})]}),a.conventionName&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-600`,children:[(0,x.jsx)(i,{className:`h-3 w-3`}),(0,x.jsx)(`span`,{children:a.conventionName})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,x.jsx)(t,{className:`h-4 w-4`}),(0,x.jsxs)(`span`,{children:[a.nodes.length,` 个节点`]})]}),(0,x.jsxs)(`div`,{className:`space-y-1.5`,children:[a.trigger.keywords.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[a.trigger.keywords.slice(0,3).map((e,t)=>(0,x.jsx)(`span`,{className:`px-2 py-0.5 bg-gray-100 text-gray-600 rounded text-xs`,children:e},t)),a.trigger.keywords.length>3&&(0,x.jsxs)(`span`,{className:`px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs`,children:[`+`,a.trigger.keywords.length-3]})]}),a.trigger.complexity.length>0&&(0,x.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[`适用复杂度:`,a.trigger.complexity.join(`, `)]})]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between pt-3 border-t border-gray-100`,children:[(0,x.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[a.version&&`v${a.version}`,a.updatedAt&&` · ${c(p(a.updatedAt),`yyyy-MM-dd`)}`]}),(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(m,{variant:`ghost`,size:`sm`,icon:n,onClick:t=>{t.stopPropagation(),e(`/templates/${a.id}`)},children:`查看`}),a.source===`user`&&(0,x.jsx)(m,{variant:`ghost`,size:`sm`,icon:r,onClick:t=>{t.stopPropagation(),e(`/templates/${a.id}/edit`)},children:`编辑`})]})]})]})})},a.id))}),k.length===0&&(0,x.jsx)(h,{children:(0,x.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:s||S!==`all`?`没有找到匹配的模板`:`暂无模板`})})]})}export{S as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Bt as t,It as n,Yn as r,gr as i,qn as a}from"./vendor-DRGPi8ui.js";import{C as o}from"./vendor-charts-9eVsQvUV.js";import{c as s}from"./vendor-flow-srkes8If.js";var c=e(i(),1),l=e(o(),1),u=s(),d=(0,c.createContext)({toast:()=>{}}),f=()=>{};function p(e,t=`error`){f(e,t)}function m({children:e}){let[i,o]=(0,c.useState)([]),s={current:0},p=(0,c.useCallback)((e,t=`error`)=>{let n=++s.current;o(r=>[...r,{id:n,type:t,message:e}]),setTimeout(()=>o(e=>e.filter(e=>e.id!==n)),4e3)},[]);(0,c.useEffect)(()=>{f=p;let e=e=>p(e.detail,`error`);return window.addEventListener(`api:error`,e),()=>window.removeEventListener(`api:error`,e)},[p]);let m={success:r,error:a,warning:t},h={success:`bg-green-50 border-green-200 text-green-800`,error:`bg-red-50 border-red-200 text-red-800`,warning:`bg-yellow-50 border-yellow-200 text-yellow-800`},g={success:`text-green-500`,error:`text-red-500`,warning:`text-yellow-500`};return(0,u.jsxs)(d.Provider,{value:{toast:p},children:[e,(0,l.createPortal)((0,u.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-sm`,children:i.map(e=>{let t=m[e.type];return(0,u.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg text-sm ${h[e.type]}`,children:[(0,u.jsx)(t,{className:`h-4 w-4 mt-0.5 flex-shrink-0 ${g[e.type]}`}),(0,u.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,u.jsx)(`button`,{onClick:()=>o(t=>t.filter(t=>t.id!==e.id)),children:(0,u.jsx)(n,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}export{p as n,m as t};
@@ -1 +0,0 @@
1
- import{mr as e}from"./vendor-DRGPi8ui.js";var t=e.create({baseURL:`/api`,timeout:3e4});t.interceptors.request.use(e=>{let t=window.__AUTH_TOKEN__;return t&&(e.headers.Authorization=`Bearer ${t}`),e}),t.interceptors.response.use(e=>e,e=>{let t=e.response?.data?.error||e.response?.data?.message||e.message||`请求失败`;return window.dispatchEvent(new CustomEvent(`api:error`,{detail:t})),Promise.reject(e)});var n=()=>t.get(`/health`),r=()=>t.get(`/config`),i=e=>t.put(`/config`,e),ee=()=>t.get(`/config/history`),te=e=>t.get(`/sessions`,{params:e}),a=e=>t.get(`/sessions/${e}`),o=e=>t.delete(`/sessions/${e}`),s=(e,n)=>t.patch(`/sessions/${e}/meta`,n),c=e=>t.delete(`/sessions`,{data:{ids:e}}),l=e=>t.get(`/events`,{params:e}),u=e=>t.get(`/events/stats`,{params:{project_path:e}}),d=e=>t.get(`/pipelines`,{params:e}),f=e=>t.get(`/pipelines/${e}`),p=e=>t.get(`/quality/history`,{params:e}),m=e=>t.get(`/quality/unresolved`,{params:{project_path:e}}),h=()=>t.get(`/stats/roi`),g=()=>t.get(`/stats/overview`),_=(e,n,r,i)=>t.get(`/knowledge/search`,{params:{q:e,project_path:n,node_type:r,limit:i}}),v=e=>t.get(`/knowledge/overview`,{params:{project_path:e}}),y=(e,n)=>t.get(`/knowledge/neighbors`,{params:{node_id:e,project_path:n}}),b=(e,n)=>t.get(`/knowledge/graph`,{params:{project_path:e,node_type:n}}),x=e=>t.post(`/knowledge/nodes`,e),S=(e,n)=>t.put(`/knowledge/nodes/${e}`,n),C=e=>t.delete(`/knowledge/nodes/${e}`),w=e=>t.delete(`/knowledge/batch`,{data:{ids:e}}),T=e=>t.post(`/knowledge/import`,{nodes:e}),E=e=>t.post(`/knowledge/edges`,e),D=e=>t.post(`/pipelines/${e}/close`),O=e=>t.post(`/pipelines/${e}/reactivate`),k=e=>t.post(`/pipelines/batch-close`,{ids:e}),A=()=>t.post(`/pipelines/close-expired`),j=()=>t.get(`/pipelines/active`),M=e=>t.post(`/pipelines/${e}/resume`),N=e=>t.post(`/pipelines/${e}/advance`),P=e=>t.get(`/pipeline-templates`,{params:e}),F=e=>t.get(`/pipeline-templates/${e}`),I=e=>t.post(`/pipeline-templates`,e),L=(e,n)=>t.put(`/pipeline-templates/${e}`,n),R=e=>t.delete(`/pipeline-templates/${e}`),z=e=>t.get(`/projects`,{params:e}),B=e=>t.get(`/projects/${e}`),V=e=>t.delete(`/projects/${e}`),H=e=>t.post(`/convention/init`,{path:e},{timeout:18e4}),U=e=>t.get(`/projects/${e}/conventions`),W=(e,n)=>t.post(`/projects/${e}/conventions/bind`,{conventionId:n}),G=(e,n)=>t.delete(`/projects/${e}/conventions/${encodeURIComponent(n)}`),K=e=>t.get(`/projects/${e}/conventions/custom/yaml`),q=(e,n)=>t.put(`/projects/${e}/conventions/custom`,{yaml:n}),J=e=>t.post(`/projects/${e}/conventions/distill`,{},{timeout:12e4}),Y=e=>t.get(`/claudemd/${e}`),X=(e,n)=>t.put(`/claudemd/${e}`,{content:n}),Z=e=>t.get(`/claudemd/${e}/profile`),Q=e=>t.get(`/claudemd/${e}/modules`),ne=e=>t.post(`/claudemd/${e}/distill`,void 0,{timeout:18e4}),re=e=>t.post(`/claudemd/${e}/init`,void 0,{timeout:18e4}),ie=e=>t.post(`/quality/${e}/resolve`),ae=e=>t.post(`/quality/${e}/dismiss`),oe=e=>t.post(`/quality/batch-dismiss`,{ids:e}),se=e=>t.post(`/quality/batch-resolve`,{ids:e}),ce=()=>t.post(`/quality/resolve-all`),le=e=>t.get(`/quality/${e}/context`),ue=()=>t.get(`/daemon/status`),de=()=>t.post(`/daemon/restart`),fe=()=>t.get(`/daemon/diagnose`),pe=()=>t.post(`/daemon/repair`),me=e=>t.post(`/config/backup`,e||{}),he=()=>t.get(`/config/backups`),ge=e=>`/api/config/backups/${encodeURIComponent(e)}`,_e=(e,n)=>t.post(`/config/restore`,{filename:e,password:n}),ve=e=>t.post(`/events/purge`,{retentionDays:e}),ye=()=>t.get(`/memory/caches`),be=()=>t.get(`/memory/process`),xe=e=>t.post(`/memory/caches/${encodeURIComponent(e)}/clear`),Se=()=>t.post(`/memory/caches/clear-all`),Ce=()=>t.post(`/memory/gc`),we=e=>t.get(`/stats/api-usage`,{params:{days:e}}),Te=e=>t.get(`/skills`,{params:e}),Ee=()=>t.get(`/skills/status`),De=e=>t.get(`/skills/${encodeURIComponent(e)}`),Oe=(e,n)=>t.put(`/skills/${encodeURIComponent(e)}/content`,{content:n}),ke=(e,n)=>t.post(`/skills/search`,{query:e,...n},{timeout:3e4}),Ae=e=>t.post(`/skills/install`,{url:e},{timeout:6e4}),je=e=>t.delete(`/skills/${encodeURIComponent(e)}`),Me=e=>t.post(`/skills/batch-delete`,{names:e}),Ne=()=>t.post(`/skills/evolve`,{},{timeout:12e4}),Pe=()=>t.post(`/skills/distill`,{},{timeout:12e4}),Fe=()=>t.post(`/skills/repair`,{},{timeout:6e4}),Ie=()=>t.get(`/skills/orchestration`),Le=(e,n)=>t.put(`/skills/orchestration`,{skill:e,keywords:n}),Re=e=>t.delete(`/skills/orchestration/${encodeURIComponent(e)}`),ze=()=>t.get(`/conventions`),Be=e=>t.get(`/conventions/${encodeURIComponent(e)}`),Ve=()=>t.post(`/conventions/sync-official`),He=e=>t.post(`/conventions/install`,{url:e},{timeout:3e4}),Ue=e=>t.delete(`/conventions/${encodeURIComponent(e)}`),We=()=>t.get(`/conventions/usage-stats`),Ge=e=>t.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),Ke=e=>t.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),qe=e=>t.get(`/conventions/${encodeURIComponent(e)}/yaml`),Je=(e,n)=>t.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:n}),$=e=>t.get(`/node-types`,{params:e?{projectPath:e}:void 0}),Ye=e=>t.get(`/node-types/${encodeURIComponent(e)}`),Xe=e=>t.post(`/node-types`,e),Ze=(e,n)=>t.put(`/node-types/${encodeURIComponent(e)}`,n),Qe=e=>t.delete(`/node-types/${encodeURIComponent(e)}`),$e=e=>t.get(`/plans/by-project/${encodeURIComponent(e)}`),et=e=>t.get(`/plans/nodes/${e}/attempts`),tt=e=>t.post(`/plans/${e}/approve`),nt=e=>t.post(`/plans/${e}/abort`),rt=()=>t.get(`/templates`),it=e=>t.get(`/templates/${e}/versions`),at=(e,n)=>t.post(`/templates/${e}/rollback`,{version_id:n}),ot=e=>t.get(`/templates/${e}/stats`),st=e=>t.get(`/evolution/events`,{params:e}),ct=()=>t.get(`/evolution/stats`);export{ze as $,G as $t,fe as A,rt as At,Q as B,pe as Bt,C,a as Ct,V as D,Te as Dt,R as E,Ee as Et,Ne as F,He as Ft,We as G,_e as Gt,r as H,ce as Ht,j as I,Ae as It,u as J,Je as Jt,qe as K,M as Kt,we as L,he as Lt,ne as M,T as Mt,J as N,H as Nt,o as O,ot as Ot,Pe as P,re as Pt,Be as Q,Ce as Qt,ge as R,ve as Rt,Ue as S,h as St,Re as T,De as Tt,ee as U,ie as Ut,Z as V,Fe as Vt,Ge as W,de as Wt,st as X,ke as Xt,l as Y,_ as Yt,ct as Z,Ve as Zt,D as _,U as _t,me as a,q as an,be as at,Xe as b,le as bt,c,Le as cn,$ as ct,Ke as d,f as dt,X as en,n as et,se as f,$e as ft,A as g,B as gt,xe as h,d as ht,tt as i,L as in,ye as it,ae as j,m as jt,je as k,it as kt,Me as l,Ie as lt,Se as m,P as mt,N as n,S as nn,y as nt,k as o,s as on,et as ot,W as p,F as pt,ue as q,at as qt,t as r,Ze as rn,v as rt,w as s,Oe as sn,Ye as st,nt as t,i as tn,b as tt,oe as u,g as ut,E as v,K as vt,Qe as w,te as wt,I as x,p as xt,x as y,z as yt,Y as z,O as zt};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-Dskgf0jG.js","assets/rolldown-runtime-COnpUsM8.js","assets/vendor-react-DJI9oneq.js","assets/vendor-DRGPi8ui.js","assets/vendor-charts-9eVsQvUV.js","assets/vendor-query-DqPOMnuX.js","assets/vendor-flow-srkes8If.js","assets/vendor-flow-CHpVij2M.css","assets/vendor-motion-CQmdgnI8.js","assets/client-BvVpIixG.js","assets/ConfirmDialog-BKfwMp04.js","assets/ui-CDL3BZ13.js","assets/Sessions-C0BmdDPK.js","assets/BatchProgress-BQ533tSf.js","assets/ErrorState-BOInXmfg.js","assets/Skeleton-B7PVDJJ_.js","assets/exportCsv-Dm5Y5M_E.js","assets/SessionDetail-BMrqH8_W.js","assets/Breadcrumb-DtfwnOx6.js","assets/Events-CAY9kU9T.js","assets/useDebounce-DNfPs3Tv.js","assets/Pipelines-Drat9IqZ.js","assets/Pagination-lp8b_3NR.js","assets/PipelineDetail-Bc6l2jqX.js","assets/Toast-BbB3oD2a.js","assets/Quality-Bm7oRSun.js","assets/Config-CUb6-ddH.js","assets/Analytics-txva5ugO.js","assets/Knowledge-BHLyFp2U.js","assets/Projects-qDolX6Y6.js","assets/ProjectDetail-Cx8VZp8O.js","assets/Skills-B3c1_uFt.js","assets/Conventions-E_2yAYoB.js","assets/vendor-editor-CYLOGES5.js","assets/NodeTypes-B6wc7VnR.js","assets/PipelineTemplates-sSL-9oRh.js","assets/Templates-Dho__f4l.js","assets/TemplateDetail-ep5h3Cu5.js","assets/Evolution-Ck_BqRpt.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,$t as n,Bt as r,Dn as i,En as a,Ft as o,Mn as s,Qt as c,Un as l,Vt as u,_n as d,ar as f,cr as p,en as ee,gr as m,ir as h,kn as g,mn as _,or as v,pr as y,rn as b,rr as x,un as S,xn as C}from"./vendor-DRGPi8ui.js";import{a as w,c as T,d as E,i as D,o as O,r as k,s as A,t as j,u as M}from"./vendor-react-DJI9oneq.js";import{a as N,i as P,o as F,r as I}from"./vendor-query-DqPOMnuX.js";import{c as te}from"./vendor-flow-srkes8If.js";import{Dt as L,Yt as R,et as z,ht as B,wt as V}from"./client-BvVpIixG.js";import{a as H,n as U}from"./ui-CDL3BZ13.js";import{n as W,t as G}from"./vendor-motion-CQmdgnI8.js";import{t as K}from"./useDebounce-DNfPs3Tv.js";import{t as q}from"./Toast-BbB3oD2a.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var J=e(E(),1),Y=e(m(),1),X=te(),Z=[{path:`/dashboard`,label:`仪表盘`,icon:C},{path:`/projects`,label:`项目管理`,icon:g},{path:`/sessions`,label:`会话管理`,icon:y},{path:`/events`,label:`事件流`,icon:h},{path:`/pipelines`,label:`流水线`,icon:i},{path:`/quality`,label:`质量门禁`,icon:c},{path:`/knowledge`,label:`知识图谱`,icon:f},{path:`/skills`,label:`技能管理`,icon:S},{path:`/conventions`,label:`规范管理`,icon:p},{path:`/node-types`,label:`节点类型`,icon:v},{path:`/pipeline-templates`,label:`模板管理`,icon:s},{path:`/templates`,label:`执行模板`,icon:i},{path:`/evolution`,label:`模板进化`,icon:u},{path:`/analytics`,label:`数据分析`,icon:x},{path:`/config`,label:`系统配置`,icon:n}];function Q({children:e}){let[n,r]=(0,Y.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),i=A();(0,Y.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(n))},[n]);let{data:a}=I({queryKey:[`health`],queryFn:()=>z().then(e=>e.data)}),s=Z.find(e=>i.pathname.startsWith(e.path));return(0,X.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,X.jsxs)(`aside`,{className:H(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,n?`w-16`:`w-60`),children:[(0,X.jsxs)(`div`,{className:H(`flex items-center border-b border-white/10 h-16`,n?`justify-center px-2`:`justify-between px-5`),children:[!n&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,X.jsx)(o,{className:`h-5 w-5 text-white`})}),(0,X.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,X.jsx)(`button`,{onClick:()=>r(!n),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:n?(0,X.jsx)(_,{className:`h-5 w-5`}):(0,X.jsx)(t,{className:`h-5 w-5`})})]}),(0,X.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:Z.map(e=>(0,X.jsxs)(k,{to:e.path,className:({isActive:e})=>H(`flex items-center gap-3 rounded-lg transition-all duration-200`,n?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,X.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!n&&(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,X.jsx)(`div`,{className:H(`border-t border-white/10 py-4`,n?`px-2`:`px-5`),children:(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2`,n?`justify-center`:``),children:[(0,X.jsx)(`div`,{className:H(`w-2 h-2 rounded-full`,a?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!n&&(0,X.jsx)(`span`,{className:`text-xs text-white/40`,children:a?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,X.jsxs)(`main`,{className:H(`flex-1 transition-all duration-300`,n?`ml-16`:`ml-60`),children:[(0,X.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,X.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:s?.label||`Claude Forge`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,X.jsx)(l,{className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:`命令面板`}),(0,X.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,X.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`3.7.7`]}),(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,a?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,X.jsx)(`div`,{className:H(`w-1.5 h-1.5 rounded-full`,a?.status===`ok`?`bg-green-500`:`bg-red-500`)}),a?.status===`ok`?`在线`:`离线`]})]})]}),(0,X.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var ne=e=>[{id:`nav-dashboard`,label:`仪表盘`,description:`查看效率指标和趋势`,icon:C,action:()=>e(`/dashboard`),category:`导航`},{id:`nav-sessions`,label:`会话管理`,description:`查看和管理会话`,icon:y,action:()=>e(`/sessions`),category:`导航`},{id:`nav-events`,label:`事件流`,description:`查看实时事件`,icon:h,action:()=>e(`/events`),category:`导航`},{id:`nav-pipelines`,label:`流水线`,description:`查看编排流水线`,icon:i,action:()=>e(`/pipelines`),category:`导航`},{id:`nav-quality`,label:`质量门禁`,description:`查看质量问题`,icon:c,action:()=>e(`/quality`),category:`导航`},{id:`nav-knowledge`,label:`知识图谱`,description:`浏览知识节点`,icon:f,action:()=>e(`/knowledge`),category:`导航`},{id:`nav-analytics`,label:`数据分析`,description:`查看统计报表`,icon:x,action:()=>e(`/analytics`),category:`导航`},{id:`nav-config`,label:`系统配置`,description:`管理配置项`,icon:n,action:()=>e(`/config`),category:`导航`}];function re(){let[e,t]=(0,Y.useState)(!1),[n,r]=(0,Y.useState)(``),[i,s]=(0,Y.useState)(0),c=(0,Y.useRef)(null),u=T(),p=K(n,300),m=p.trim().length>=2,{data:h,isFetching:g}=I({queryKey:[`cmd-pipelines`,p],queryFn:()=>B({search:p,page_size:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:_,isFetching:v}=I({queryKey:[`cmd-sessions`,p],queryFn:()=>V({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:b,isFetching:x}=I({queryKey:[`cmd-knowledge`,p],queryFn:()=>R(p,void 0,void 0,5).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:S,isFetching:C}=I({queryKey:[`cmd-skills`,p],queryFn:()=>L({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),w=g||v||x||C,E=[];if(m){let e=p.toLowerCase();(h?.items||[]).forEach(t=>{let n=String(t.requirement||``);(n.toLowerCase().includes(e)||!e)&&E.push({id:`pipeline-${t.id}`,label:n.slice(0,60)||String(t.id),description:`流水线 · ${t.project||``}`,icon:a,action:()=>u(`/pipelines/${t.id}`),category:`流水线`})}),(_?.items||[]).filter(t=>String(t.title||t.id||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`session-${e.id}`,label:String(e.title||e.id||``).slice(0,60),description:`会话 · ${String(e.project_path||``).split(`/`).pop()||``}`,icon:y,action:()=>u(`/sessions/${e.id}`),category:`会话`})}),(b?.items||[]).forEach(e=>{E.push({id:`knowledge-${e.id}`,label:String(e.title||``).slice(0,60),description:`知识节点 · ${e.node_type||``}`,icon:f,action:()=>u(`/knowledge`),category:`知识图谱`})}),(S?.items||[]).filter(t=>String(t.name||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`skill-${e.name}`,label:String(e.name||``).slice(0,60),description:`技能 · ${e.description?String(e.description).slice(0,40):``}`,icon:o,action:()=>u(`/skills`),category:`技能`})})}let D=ne(u),O=n?D.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||(e.description||``).toLowerCase().includes(n.toLowerCase())):D,k=m?[...E,...O]:O;(0,Y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),t(e=>!e),r(``),s(0)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,Y.useEffect)(()=>{e&&setTimeout(()=>c.current?.focus(),100)},[e]),(0,Y.useEffect)(()=>{s(0)},[p]);let A=e=>{e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,k.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&k[i]&&(k[i].action(),t(!1))},j=Array.from(new Set(k.map(e=>e.category)));return(0,X.jsx)(W,{children:e&&(0,X.jsx)(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[200] bg-black/50 backdrop-blur-sm flex items-start justify-center pt-[20vh]`,onClick:()=>t(!1),children:(0,X.jsxs)(G.div,{initial:{scale:.95,opacity:0,y:-20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:-20},transition:{duration:.15},className:`bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden border border-gray-200`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-gray-100`,children:[w?(0,X.jsx)(d,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,X.jsx)(ee,{className:`h-5 w-5 text-gray-400 flex-shrink-0`}),(0,X.jsx)(`input`,{ref:c,type:`text`,placeholder:`输入命令或搜索(≥2字符跨模块搜索)...`,value:n,onChange:e=>{r(e.target.value),s(0)},onKeyDown:A,className:`flex-1 text-sm outline-none placeholder:text-gray-400`}),(0,X.jsx)(`kbd`,{className:`hidden sm:inline-flex items-center gap-1 px-2 py-0.5 text-xs text-gray-400 bg-gray-100 rounded`,children:`ESC`})]}),(0,X.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-2`,children:k.length===0&&!w?(0,X.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-gray-400`,children:m?`没有找到相关内容`:`没有匹配的命令`}):j.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 py-1.5 text-xs font-semibold text-gray-400 uppercase tracking-wider`,children:e}),k.filter(t=>t.category===e).map(e=>{let n=k.indexOf(e);return(0,X.jsxs)(`button`,{className:H(`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors`,n===i?`bg-blue-50 text-blue-700`:`text-gray-700 hover:bg-gray-50`),onClick:()=>{e.action(),t(!1)},onMouseEnter:()=>s(n),children:[(0,X.jsx)(e.icon,{className:`h-4 w-4 flex-shrink-0`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,X.jsx)(`div`,{className:`text-xs text-gray-400 truncate`,children:e.description})]})]},e.id)})]},e))}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-gray-100 text-xs text-gray-400`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↑↓`}),`导航`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↵`}),`执行`]})]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(l,{className:`h-3 w-3`}),`K 打开`]})]})]})})})}var $=class extends Y.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught:`,e,t)}render(){return this.state.hasError?(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 px-4`,children:(0,X.jsxs)(`div`,{className:`max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center`,children:[(0,X.jsx)(r,{className:`h-16 w-16 text-red-500 mx-auto mb-4`}),(0,X.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 mb-2`,children:`出错了`}),(0,X.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`页面加载时遇到错误,请刷新页面重试`}),this.state.error&&(0,X.jsxs)(`details`,{className:`text-left mb-6 p-4 bg-gray-50 rounded-lg`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-gray-700 mb-2`,children:`错误详情`}),(0,X.jsx)(`pre`,{className:`text-xs text-red-600 overflow-auto`,children:this.state.error.toString()})]}),(0,X.jsx)(U,{variant:`primary`,icon:b,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},ie=3e3;function ae(){let e=window.__AUTH_TOKEN__;return e?`/api/events/stream?token=${encodeURIComponent(e)}`:`/api/events/stream`}function oe(){let e=N(),t=(0,Y.useRef)(null),n=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let r=!1;function i(){if(r)return;let a=new EventSource(ae());t.current=a;let o=t=>{for(let n of t)e.invalidateQueries({queryKey:n})};a.addEventListener(`pipeline:status`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`overview`],[`plan`,`by-project`]])}),a.addEventListener(`pipeline:node`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`pipeline`]])}),a.addEventListener(`quality:issue`,()=>{o([[`quality-history`],[`quality-unresolved`],[`overview`]])}),a.addEventListener(`session:event`,()=>{o([[`events-live`],[`sessions`],[`overview`]])}),a.addEventListener(`session:status`,()=>{o([[`sessions`],[`overview`]])}),a.addEventListener(`daemon:status`,()=>{o([[`daemon-status`],[`health`]])}),a.onerror=()=>{a.close(),t.current=null,r||(n.current=setTimeout(i,ie))}}return i(),()=>{r=!0,n.current&&clearTimeout(n.current),t.current?.close(),t.current=null}},[e])}var se=(0,Y.lazy)(()=>M(()=>import(`./Dashboard-Dskgf0jG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ce=(0,Y.lazy)(()=>M(()=>import(`./Sessions-C0BmdDPK.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,9,13,10,11,8,14,15,16]))),le=(0,Y.lazy)(()=>M(()=>import(`./SessionDetail-BMrqH8_W.js`),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,18,11]))),ue=(0,Y.lazy)(()=>M(()=>import(`./Events-CAY9kU9T.js`),__vite__mapDeps([19,1,3,5,6,4,7,8,9,10,11,14,20,16]))),de=(0,Y.lazy)(()=>M(()=>import(`./Pipelines-Drat9IqZ.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,13,10,11,14,22,15,20,16]))),fe=(0,Y.lazy)(()=>M(()=>import(`./PipelineDetail-Bc6l2jqX.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,18,10,11,24]))),pe=(0,Y.lazy)(()=>M(()=>import(`./Quality-Bm7oRSun.js`),__vite__mapDeps([25,1,3,5,6,4,7,8,9,10,11,14,22,24,20,16]))),me=(0,Y.lazy)(()=>M(()=>import(`./Config-CUb6-ddH.js`),__vite__mapDeps([26,1,3,5,6,4,7,8,9,10,11,24]))),he=(0,Y.lazy)(()=>M(()=>import(`./Analytics-txva5ugO.js`),__vite__mapDeps([27,1,3,5,6,4,7,9,14,11,8,16]))),ge=(0,Y.lazy)(()=>M(()=>import(`./Knowledge-BHLyFp2U.js`),__vite__mapDeps([28,1,3,5,6,4,7,8,9,10,11,22,24,16]))),_e=(0,Y.lazy)(()=>M(()=>import(`./Projects-qDolX6Y6.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,22,11,24,16]))),ve=(0,Y.lazy)(()=>M(()=>import(`./ProjectDetail-Cx8VZp8O.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,9,18,22,11,8,24]))),ye=(0,Y.lazy)(()=>M(()=>import(`./Skills-B3c1_uFt.js`),__vite__mapDeps([31,1,3,5,6,4,7,9,10,11,8,24]))),be=(0,Y.lazy)(()=>M(()=>import(`./Conventions-E_2yAYoB.js`),__vite__mapDeps([32,1,33,3,5,6,4,7,9,10,11,8,24]))),xe=(0,Y.lazy)(()=>M(()=>import(`./NodeTypes-B6wc7VnR.js`),__vite__mapDeps([34,1,3,5,6,4,7,9]))),Se=(0,Y.lazy)(()=>M(()=>import(`./PipelineTemplates-sSL-9oRh.js`),__vite__mapDeps([35,1,3,5,6,4,7,9,24]))),Ce=(0,Y.lazy)(()=>M(()=>import(`./Templates-Dho__f4l.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,14,11,15]))),we=(0,Y.lazy)(()=>M(()=>import(`./TemplateDetail-ep5h3Cu5.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,14,15]))),Te=(0,Y.lazy)(()=>M(()=>import(`./Evolution-Ck_BqRpt.js`),__vite__mapDeps([38,2,1,3,4,5,6,7,8,9,15,11])));function Ee(){return oe(),(0,X.jsx)($,{children:(0,X.jsxs)(q,{children:[(0,X.jsx)(re,{}),(0,X.jsx)(Q,{children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:`加载中...`}),children:(0,X.jsxs)(O,{children:[(0,X.jsx)(w,{path:`/`,element:(0,X.jsx)(D,{to:`/dashboard`,replace:!0})}),(0,X.jsx)(w,{path:`/dashboard`,element:(0,X.jsx)(se,{})}),(0,X.jsx)(w,{path:`/sessions`,element:(0,X.jsx)(ce,{})}),(0,X.jsx)(w,{path:`/sessions/:id`,element:(0,X.jsx)(le,{})}),(0,X.jsx)(w,{path:`/events`,element:(0,X.jsx)(ue,{})}),(0,X.jsx)(w,{path:`/pipelines`,element:(0,X.jsx)(de,{})}),(0,X.jsx)(w,{path:`/pipelines/:id`,element:(0,X.jsx)(fe,{})}),(0,X.jsx)(w,{path:`/projects`,element:(0,X.jsx)(_e,{})}),(0,X.jsx)(w,{path:`/projects/:encodedPath`,element:(0,X.jsx)(ve,{})}),(0,X.jsx)(w,{path:`/quality`,element:(0,X.jsx)(pe,{})}),(0,X.jsx)(w,{path:`/analytics`,element:(0,X.jsx)(he,{})}),(0,X.jsx)(w,{path:`/knowledge`,element:(0,X.jsx)(ge,{})}),(0,X.jsx)(w,{path:`/skills`,element:(0,X.jsx)(ye,{})}),(0,X.jsx)(w,{path:`/conventions`,element:(0,X.jsx)(be,{})}),(0,X.jsx)(w,{path:`/node-types`,element:(0,X.jsx)(xe,{})}),(0,X.jsx)(w,{path:`/pipeline-templates`,element:(0,X.jsx)(Se,{})}),(0,X.jsx)(w,{path:`/templates`,element:(0,X.jsx)(Ce,{})}),(0,X.jsx)(w,{path:`/templates/:id`,element:(0,X.jsx)(we,{})}),(0,X.jsx)(w,{path:`/evolution`,element:(0,X.jsx)(Te,{})}),(0,X.jsx)(w,{path:`/config`,element:(0,X.jsx)(me,{})})]})})})]})})}var De=new F({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});J.createRoot(document.getElementById(`root`)).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(P,{client:De,children:(0,X.jsx)(j,{children:(0,X.jsx)(Ee,{})})})}));
@@ -1,2 +0,0 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-50:oklch(97.1% .014 343.198);--color-pink-500:oklch(65.6% .241 354.308);--color-pink-700:oklch(52.5% .223 3.958);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-6{top:calc(var(--spacing) * 6)}.top-full{top:100%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-40{z-index:40}.z-50{z-index:50}.z-\[200\]{z-index:200}.z-\[9999\]{z-index:9999}.col-span-2{grid-column:span 2/span 2}.mx-0\.5{margin-inline:calc(var(--spacing) * .5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-16{margin-left:calc(var(--spacing) * 16)}.ml-60{margin-left:calc(var(--spacing) * 60)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-48{height:calc(var(--spacing) * 48)}.h-96{height:calc(var(--spacing) * 96)}.h-\[180px\]{height:180px}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-52{max-height:calc(var(--spacing) * 52)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[50vh\]{max-height:50vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[500px\]{max-height:500px}.max-h-\[600px\]{max-height:600px}.min-h-\[40px\]{min-height:40px}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-1\/4{width:25%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-\[600px\]{width:600px}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[72px\]{max-width:72px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[80px\]{min-width:80px}.min-w-\[200px\]{min-width:200px}.min-w-\[240px\]{min-width:240px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.\!border-green-200{border-color:var(--color-green-200)!important}.\!border-red-200{border-color:var(--color-red-200)!important}.\!border-yellow-200{border-color:var(--color-yellow-200)!important}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-50{border-color:var(--color-gray-50)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-200\/50{border-color:#e5e7eb80}@supports (color:color-mix(in lab, red, red)){.border-gray-200\/50{border-color:color-mix(in oklab, var(--color-gray-200) 50%, transparent)}}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-700{border-color:var(--color-gray-700)}.border-green-200{border-color:var(--color-green-200)}.border-green-300{border-color:var(--color-green-300)}.border-green-500{border-color:var(--color-green-500)}.border-green-800\/30{border-color:#0166304d}@supports (color:color-mix(in lab, red, red)){.border-green-800\/30{border-color:color-mix(in oklab, var(--color-green-800) 30%, transparent)}}.border-orange-200{border-color:var(--color-orange-200)}.border-purple-200{border-color:var(--color-purple-200)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-800\/30{border-color:#9f07124d}@supports (color:color-mix(in lab, red, red)){.border-red-800\/30{border-color:color-mix(in oklab, var(--color-red-800) 30%, transparent)}}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10{border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-yellow-200{border-color:var(--color-yellow-200)}.border-yellow-300{border-color:var(--color-yellow-300)}.border-yellow-500{border-color:var(--color-yellow-500)}.border-l-blue-500{border-left-color:var(--color-blue-500)}.\!bg-green-50{background-color:var(--color-green-50)!important}.\!bg-yellow-50{background-color:var(--color-yellow-50)!important}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-600{background-color:var(--color-amber-600)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\/20{background-color:#155dfc33}@supports (color:color-mix(in lab, red, red)){.bg-blue-600\/20{background-color:color-mix(in oklab, var(--color-blue-600) 20%, transparent)}}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab, red, red)){.bg-gray-800\/50{background-color:color-mix(in oklab, var(--color-gray-800) 50%, transparent)}}.bg-gray-900\/50{background-color:#10182880}@supports (color:color-mix(in lab, red, red)){.bg-gray-900\/50{background-color:color-mix(in oklab, var(--color-gray-900) 50%, transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-400{background-color:var(--color-green-400)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-900\/20{background-color:#0d542b33}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/20{background-color:color-mix(in oklab, var(--color-green-900) 20%, transparent)}}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-pink-50{background-color:var(--color-pink-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/20{background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab, red, red)){.bg-white\/80{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-red-500{--tw-gradient-from:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-900{--tw-gradient-from:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-green-600{--tw-gradient-to:var(--color-green-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-600{--tw-gradient-to:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-800{--tw-gradient-to:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\!p-0{padding:calc(var(--spacing) * 0)!important}.\!p-2{padding:calc(var(--spacing) * 2)!important}.\!p-3{padding:calc(var(--spacing) * 3)!important}.\!p-4{padding:calc(var(--spacing) * 4)!important}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-\[20vh\]{padding-top:20vh}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-gray-100{color:var(--color-gray-100)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-300{color:var(--color-green-300)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-500{color:var(--color-pink-500)}.text-pink-700{color:var(--color-pink-700)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab, red, red)){.text-white\/40{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60{color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-800{color:var(--color-yellow-800)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-blue-400{--tw-ring-color:var(--color-blue-400)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-gray-400::placeholder{color:var(--color-gray-400)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media (hover:hover){.hover\:border-blue-200:hover{border-color:var(--color-blue-200)}.hover\:border-blue-300:hover{border-color:var(--color-blue-300)}.hover\:border-gray-200:hover{border-color:var(--color-gray-200)}.hover\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\:border-green-200:hover{border-color:var(--color-green-200)}.hover\:border-purple-300:hover{border-color:var(--color-purple-300)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-50\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab, red, red)){.hover\:bg-blue-50\/50:hover{background-color:color-mix(in oklab, var(--color-blue-50) 50%, transparent)}}.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-gray-800\/50:hover{background-color:#1e293980}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-800\/50:hover{background-color:color-mix(in oklab, var(--color-gray-800) 50%, transparent)}}.hover\:bg-green-50\/50:hover{background-color:#f0fdf480}@supports (color:color-mix(in lab, red, red)){.hover\:bg-green-50\/50:hover{background-color:color-mix(in oklab, var(--color-green-50) 50%, transparent)}}.hover\:bg-green-100:hover{background-color:var(--color-green-100)}.hover\:bg-purple-100:hover{background-color:var(--color-purple-100)}.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:text-blue-500:hover{color:var(--color-blue-500)}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:text-blue-700:hover{color:var(--color-blue-700)}.hover\:text-blue-800:hover{color:var(--color-blue-800)}.hover\:text-gray-500:hover{color:var(--color-gray-500)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:border-red-500:focus{border-color:var(--color-red-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-amber-400:focus{--tw-ring-color:var(--color-amber-400)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-red-400:focus{--tw-ring-color:var(--color-red-400)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-blue-800:active{background-color:var(--color-blue-800)}.active\:bg-gray-200:active{background-color:var(--color-gray-200)}.active\:bg-gray-300:active{background-color:var(--color-gray-300)}.active\:bg-red-800:active{background-color:var(--color-red-800)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-50:disabled{background-color:var(--color-gray-50)}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}}@media (width>=48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (width>=64rem){.lg\:sticky{position:sticky}.lg\:top-6{top:calc(var(--spacing) * 6)}.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:self-start{align-self:flex-start}}@media (width>=80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (prefers-color-scheme:dark){.dark\:border-blue-800{border-color:var(--color-blue-800)}.dark\:border-gray-700{border-color:var(--color-gray-700)}.dark\:bg-blue-900\/20{background-color:#1c398e33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-900\/20{background-color:color-mix(in oklab, var(--color-blue-900) 20%, transparent)}}.dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark\:bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-800\/50{background-color:color-mix(in oklab, var(--color-gray-800) 50%, transparent)}}.dark\:bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-900\/20{background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-100{color:var(--color-gray-100)}.dark\:text-gray-300{color:var(--color-gray-300)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-red-400{color:var(--color-red-400)}}}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif}#root{min-height:100vh}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#f1f5f9}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-shimmer{background:linear-gradient(90deg,#f1f5f9 4%,#e2e8f0 25%,#f1f5f9 36%) 0 0/1000px 100%;animation:2s infinite shimmer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
@@ -1 +0,0 @@
1
- import{Nt as e,Pt as t}from"./vendor-DRGPi8ui.js";import{c as n}from"./vendor-flow-srkes8If.js";import{t as r}from"./vendor-motion-CQmdgnI8.js";function i(...n){return e(t(n))}function a(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}天${r%24}小时`:r>0?`${r}小时${n%60}分钟`:n>0?`${n}分钟${t%60}秒`:`${t}秒`}function o(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function s(e){let t={active:`text-green-600 bg-green-50`,completed:`text-blue-600 bg-blue-50`,failed:`text-red-600 bg-red-50`,interrupted:`text-yellow-600 bg-yellow-50`,pending:`text-gray-600 bg-gray-50`};return t[e]||t.pending}function c(e){return e?e.endsWith(`Z`)||/[+-]\d{2}:\d{2}$/.test(e)?new Date(e):new Date(e+`Z`):new Date}var l=n();function u({title:e,value:t,change:n,icon:a,color:o=`blue`,trend:s}){return(0,l.jsx)(r.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`relative overflow-hidden rounded-xl bg-white p-6 shadow-lg border border-gray-100`,children:(0,l.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`p`,{className:`text-sm font-medium text-gray-600`,children:e}),(0,l.jsx)(`p`,{className:`mt-2 text-3xl font-bold text-gray-900`,children:t}),n!==void 0&&(0,l.jsxs)(`div`,{className:i(`mt-2 flex items-center text-sm`,s===`up`?`text-green-600`:`text-red-600`),children:[(0,l.jsx)(`span`,{children:s===`up`?`↑`:`↓`}),(0,l.jsxs)(`span`,{className:`ml-1`,children:[Math.abs(n),`%`]}),(0,l.jsx)(`span`,{className:`ml-1 text-gray-500`,children:`vs 昨天`})]})]}),(0,l.jsx)(`div`,{className:i(`rounded-lg bg-gradient-to-br p-3`,{blue:`from-blue-500 to-blue-600`,green:`from-green-500 to-green-600`,purple:`from-purple-500 to-purple-600`,orange:`from-orange-500 to-orange-600`,red:`from-red-500 to-red-600`}[o]),children:(0,l.jsx)(a,{className:`h-6 w-6 text-white`})})]})})}function d({children:e,variant:t=`default`,size:n=`md`}){return(0,l.jsx)(`span`,{className:i(`inline-flex items-center rounded-full font-medium`,{default:`bg-gray-100 text-gray-700`,success:`bg-green-100 text-green-700`,warning:`bg-yellow-100 text-yellow-700`,danger:`bg-red-100 text-red-700`,info:`bg-blue-100 text-blue-700`}[t],{sm:`px-2 py-0.5 text-xs`,md:`px-3 py-1 text-sm`}[n]),children:e})}function f({children:e,variant:t=`primary`,size:n=`md`,loading:r,icon:a,className:o,disabled:s,...c}){return(0,l.jsxs)(`button`,{className:i(`inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors`,`focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,{primary:`bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`,secondary:`bg-gray-100 text-gray-700 hover:bg-gray-200 active:bg-gray-300`,ghost:`bg-transparent text-gray-700 hover:bg-gray-100 active:bg-gray-200`,danger:`bg-red-600 text-white hover:bg-red-700 active:bg-red-800`}[t],{sm:`px-3 py-1.5 text-sm`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`}[n],o),disabled:s||r,...c,children:[r&&(0,l.jsxs)(`svg`,{className:`animate-spin h-4 w-4`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`,fill:`none`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),a&&!r&&(0,l.jsx)(a,{className:`h-4 w-4`}),e]})}function p({children:e,className:t,title:n,action:r,...a}){return(0,l.jsxs)(`div`,{className:i(`rounded-xl bg-white p-6 shadow-sm border border-gray-100`,t),...a,children:[(n||r)&&(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[n&&(0,l.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900`,children:n}),r]}),e]})}export{i as a,s as c,u as i,c as l,f as n,a as o,p as r,o as s,d as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{gr as t}from"./vendor-DRGPi8ui.js";var n=e(t(),1);function r(e,t=300){let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let n=setTimeout(()=>i(e),t);return()=>clearTimeout(n)},[e,t]),r}export{r as t};