@bkm016/basalt 0.1.11 → 0.1.12

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 (207) hide show
  1. package/{chunk-755sy11p.js → chunk-01nve4qy.js} +1 -1
  2. package/{chunk-jtsve11b.js → chunk-0fc9apfn.js} +9 -9
  3. package/{chunk-d5j74pcp.js → chunk-1h34mzh7.js} +4 -4
  4. package/{chunk-fgwda4m0.js → chunk-1xfv4bd7.js} +1 -1
  5. package/{chunk-mbpb5c7w.js → chunk-2fyjph3f.js} +1 -1
  6. package/{chunk-13gvs0ax.js → chunk-2kxnw7vs.js} +1 -1
  7. package/{chunk-95964592.js → chunk-37zystxb.js} +11 -11
  8. package/{chunk-h1kb8b49.js → chunk-3pf1d62g.js} +2 -2
  9. package/{chunk-29qrxygd.js → chunk-5wnmbc1b.js} +2 -2
  10. package/{chunk-c71173py.js → chunk-6mges89p.js} +4 -4
  11. package/{chunk-d0a1jxk5.js → chunk-6sz5q3df.js} +2 -2
  12. package/chunk-7er5pz7s.js +479 -0
  13. package/{chunk-gbjn6d81.js → chunk-7g5smgjj.js} +1 -1
  14. package/chunk-7m3jagqn.js +2 -0
  15. package/{chunk-wnzvnskb.js → chunk-85v69h91.js} +2 -2
  16. package/{chunk-38g3gctw.js → chunk-9c4gdg1q.js} +2 -2
  17. package/{chunk-en218k4y.js → chunk-cbgpymt4.js} +1 -1
  18. package/{chunk-a1rb1a48.js → chunk-cdw03j4t.js} +2 -2
  19. package/chunk-ch1r3ted.js +2 -0
  20. package/{chunk-dfh9m9n7.js → chunk-db7ws33a.js} +2 -2
  21. package/{chunk-1n7dat03.js → chunk-ejjem0tc.js} +3 -3
  22. package/{chunk-c4qr1f41.js → chunk-eq4wqxzt.js} +2 -2
  23. package/{chunk-zc9ar0r4.js → chunk-eyrtbbdd.js} +1 -1
  24. package/{chunk-r4ttdkrz.js → chunk-fhxy6y34.js} +2 -2
  25. package/{chunk-zyyzk5ha.js → chunk-fy82qxa1.js} +1 -1
  26. package/{chunk-xtq1xpq0.js → chunk-hc300148.js} +1 -1
  27. package/{chunk-vtqr7dm8.js → chunk-j64dc767.js} +2 -2
  28. package/{chunk-msm9hmk9.js → chunk-jpnf71q7.js} +2 -2
  29. package/{chunk-q9f4xb0w.js → chunk-kpe7pnhy.js} +4 -4
  30. package/{chunk-a98wma9j.js → chunk-ksk49hv0.js} +1 -1
  31. package/{chunk-bdjr0kfr.js → chunk-m4bg1apa.js} +5 -5
  32. package/{chunk-dq01v5eq.js → chunk-nhm9z3d8.js} +1 -1
  33. package/{chunk-30rjf7my.js → chunk-ntks40jd.js} +2 -2
  34. package/{chunk-a1352w87.js → chunk-nw1xpt3s.js} +1 -1
  35. package/{chunk-xh444pfn.js → chunk-p2pmdbt2.js} +8 -8
  36. package/{chunk-hb4f2v34.js → chunk-qfcr5g35.js} +2 -2
  37. package/{chunk-n2jcx65v.js → chunk-qs8zzg50.js} +2 -2
  38. package/{chunk-qaeyhe65.js → chunk-r4gm8ngh.js} +1 -1
  39. package/{chunk-pz2afna8.js → chunk-rks90mh1.js} +1 -1
  40. package/{chunk-asyr3gnq.js → chunk-rwks9zaw.js} +2 -2
  41. package/{chunk-v3ee9z3f.js → chunk-t7te60m7.js} +1 -1
  42. package/{chunk-4dw43syb.js → chunk-tv52xajf.js} +1 -1
  43. package/{chunk-c0zfefq8.js → chunk-v7wcchy2.js} +1 -1
  44. package/{chunk-tevejprz.js → chunk-vjne04dp.js} +3 -3
  45. package/{chunk-ax04trym.js → chunk-w0rr66z7.js} +1 -1
  46. package/{chunk-gkf5jwvj.js → chunk-w6f2r052.js} +1 -1
  47. package/{chunk-jymx3a77.js → chunk-wqqjzsjt.js} +310 -278
  48. package/{chunk-c6q04xrd.js → chunk-xef4642x.js} +1 -1
  49. package/compiled.js +7 -7
  50. package/package.json +1 -1
  51. package/ui-test-worker.js +2 -2
  52. package/web/{chunk-jhpg2kcf.js → chunk-04drx71p.js} +1 -1
  53. package/web/chunk-0rdgt4jb.css +1 -0
  54. package/web/{chunk-cbwvfedy.js → chunk-19zd0tye.js} +3 -3
  55. package/web/chunk-1m0kp0g3.js +8 -0
  56. package/web/{chunk-j4gvtszc.js → chunk-1zwc09e8.js} +2 -2
  57. package/web/{chunk-a3pye9ag.js → chunk-2cyzaqjy.js} +3 -3
  58. package/web/{chunk-8csw0mvf.js → chunk-2jfesv7m.js} +2 -2
  59. package/web/chunk-3j2tcphs.js +1 -0
  60. package/web/chunk-3k9h7a73.js +1142 -0
  61. package/web/chunk-3m1bb2fw.js +1 -0
  62. package/web/{chunk-4rwwtfnd.js → chunk-3n9ypydh.js} +2 -2
  63. package/web/{chunk-90fkdzx3.js → chunk-3psgr0q8.js} +13 -13
  64. package/web/{chunk-nafe18y9.js → chunk-3qxxrwsp.js} +6 -6
  65. package/web/{chunk-hjyev38w.js → chunk-3rkkp6ed.js} +4 -4
  66. package/web/{chunk-v3dn9bfw.js → chunk-4f6a8dsk.js} +1 -1
  67. package/web/chunk-55nvm2mj.js +1 -0
  68. package/web/chunk-5dkqfnh7.js +2 -0
  69. package/web/{chunk-96xhmmqz.js → chunk-5g8md2wg.js} +4 -4
  70. package/web/{chunk-mpdeqzc9.js → chunk-5np514v5.js} +8 -8
  71. package/web/{chunk-1zfxaafq.js → chunk-60mym60n.js} +1 -1
  72. package/web/{chunk-nhx8pw7p.js → chunk-6f2sz84q.js} +2 -2
  73. package/web/{chunk-q8v5j963.js → chunk-7adsmqv6.js} +2 -2
  74. package/web/{chunk-27812gqr.js → chunk-7ksg3ccg.js} +3 -3
  75. package/web/chunk-7ky5nrrr.js +1 -0
  76. package/web/{chunk-pq56b3mq.js → chunk-7tkgbbf9.js} +2 -2
  77. package/web/{chunk-tpdcrrf1.js → chunk-7v85yvb2.js} +1 -1
  78. package/web/{chunk-dk0fnj87.js → chunk-7vgh17es.js} +1 -1
  79. package/web/{chunk-rqympya7.js → chunk-80z8s8zb.js} +1 -1
  80. package/web/{chunk-36dc7tcg.js → chunk-81s15c2e.js} +2 -2
  81. package/web/{chunk-mykbcvqz.js → chunk-8539865x.js} +1 -1
  82. package/web/{chunk-wbwets5x.js → chunk-8cnjd0f2.js} +17 -17
  83. package/web/{chunk-48479gnx.js → chunk-8sdjgv3k.js} +1 -1
  84. package/web/chunk-9bxtzwtc.js +1 -0
  85. package/web/{chunk-drchr3yn.js → chunk-aa46mrgh.js} +1 -1
  86. package/web/{chunk-8151c970.js → chunk-act3rr85.js} +1 -1
  87. package/web/{chunk-94denx9h.js → chunk-aebrw6cv.js} +3 -3
  88. package/web/{chunk-3a57m7xm.js → chunk-aeymdtm1.js} +2 -2
  89. package/web/{chunk-3020mmp1.js → chunk-ar6jnhm5.js} +1 -1
  90. package/web/{chunk-e763h2px.js → chunk-b5zf1hs3.js} +66 -66
  91. package/web/{chunk-5ahx98zj.js → chunk-b99k8q22.js} +8 -8
  92. package/web/chunk-bcjgzwef.js +1 -0
  93. package/web/{chunk-f79ajymt.js → chunk-bra33pt0.js} +2 -2
  94. package/web/{chunk-57pyz29y.js → chunk-bygwbpvq.js} +2 -2
  95. package/web/{chunk-3ftb27f3.js → chunk-c3fty2c2.js} +5 -5
  96. package/web/{chunk-d3f763n7.js → chunk-cxpnj495.js} +1 -1
  97. package/web/{chunk-8z7texmv.js → chunk-d1btrqmw.js} +1 -1
  98. package/web/{chunk-jqqbkdtw.js → chunk-d57fm7k0.js} +2 -2
  99. package/web/{chunk-1t38sgrk.js → chunk-d73zkc4q.js} +4 -4
  100. package/web/chunk-d94t9z70.js +1 -0
  101. package/web/{chunk-2ds0a2z1.js → chunk-dndd757x.js} +3 -3
  102. package/web/{chunk-d4519smc.js → chunk-e94pd9rr.js} +10 -10
  103. package/web/{chunk-qykt7avq.js → chunk-enwfd8d5.js} +2 -2
  104. package/web/chunk-fr4fft89.js +1 -0
  105. package/web/{chunk-g0rtcedn.js → chunk-g488hxx0.js} +3 -3
  106. package/web/{chunk-b6sqwmq7.js → chunk-g4zm0crw.js} +1 -1
  107. package/web/{chunk-086dshck.js → chunk-gckmcef6.js} +1 -1
  108. package/web/{chunk-0hvxb5d5.js → chunk-gkmaryr4.js} +1 -1
  109. package/web/chunk-gnb09wmx.js +1 -0
  110. package/web/chunk-gx340asc.js +1 -0
  111. package/web/chunk-h0c42zy3.js +1 -0
  112. package/web/chunk-h24ybwp6.js +1 -0
  113. package/web/{chunk-m24yb8md.js → chunk-h754ntg7.js} +1 -1
  114. package/web/{chunk-3b4wqmnh.js → chunk-hn8m1vsg.js} +7 -7
  115. package/web/{chunk-2f2agfpj.js → chunk-hqxc9m07.js} +7 -7
  116. package/web/chunk-hrgqc1vr.js +1 -0
  117. package/web/{chunk-793m5jjh.js → chunk-hva7xyne.js} +2 -2
  118. package/web/{chunk-yrh86m0n.js → chunk-hxbfkdjd.js} +1 -1
  119. package/web/chunk-j9c8fa82.js +1 -0
  120. package/web/{chunk-4gc663j0.js → chunk-jeafmjsm.js} +1 -1
  121. package/web/chunk-jyf7a7yp.js +2 -0
  122. package/web/chunk-jz5mmp64.js +1 -0
  123. package/web/{chunk-s0xy00v5.js → chunk-k0cg4n2k.js} +2 -2
  124. package/web/{chunk-g31dbnzm.js → chunk-k4dnjf8n.js} +4 -4
  125. package/web/{chunk-59nk506k.js → chunk-kerfb21g.js} +1 -1
  126. package/web/chunk-m0136xav.js +1 -0
  127. package/web/chunk-m6vyvgm5.js +1 -0
  128. package/web/{chunk-0y971zgq.js → chunk-mxkbmgcv.js} +2 -2
  129. package/web/{chunk-0fy590s0.js → chunk-my0ec787.js} +1 -1
  130. package/web/chunk-mzzaet63.js +1 -0
  131. package/web/{chunk-xjc5fmcr.js → chunk-n9v14vyd.js} +18 -18
  132. package/web/{chunk-cpshsp24.js → chunk-ncfzmf2g.js} +1 -1
  133. package/web/chunk-ny436sqg.js +1 -0
  134. package/web/chunk-ph75hddv.js +1 -0
  135. package/web/chunk-phdfyqaa.js +1 -0
  136. package/web/chunk-phxa5krt.js +1 -0
  137. package/web/{chunk-b3j07x0n.js → chunk-pjpre6de.js} +2 -2
  138. package/web/chunk-q1zxvjhs.js +2 -0
  139. package/web/{chunk-n33753da.js → chunk-qdd3bx8q.js} +1 -1
  140. package/web/{chunk-ydtrc1ay.js → chunk-qh62nkem.js} +2 -2
  141. package/web/{chunk-05mvzx00.js → chunk-qp3tjhaq.js} +1 -1
  142. package/web/chunk-r4zbw4zj.js +2 -0
  143. package/web/{chunk-g4as4zzd.js → chunk-r6kk4vp1.js} +4 -4
  144. package/web/{chunk-ppjw1mps.js → chunk-rdr6wt22.js} +4 -4
  145. package/web/chunk-ry4ycah9.js +1 -0
  146. package/web/{chunk-47mbbmst.js → chunk-sdr5wa4z.js} +3 -3
  147. package/web/chunk-sqm16fat.js +1 -0
  148. package/web/{chunk-zv73g4qq.js → chunk-td83xf12.js} +2 -2
  149. package/web/chunk-tj1fn8v2.js +1 -0
  150. package/web/{chunk-q65zxczs.js → chunk-v0wtk059.js} +4 -4
  151. package/web/{chunk-enryqmj7.js → chunk-v1hfbjz9.js} +4 -4
  152. package/web/chunk-v1qt3gq4.js +1 -0
  153. package/web/{chunk-2tsxj613.js → chunk-v34mr9ky.js} +9 -9
  154. package/web/{chunk-tgkdyxbn.js → chunk-v854w9yn.js} +1 -1
  155. package/web/{chunk-dtrh40vr.js → chunk-ve56gxq0.js} +1 -1
  156. package/web/chunk-w573ym17.js +1 -0
  157. package/web/{chunk-9kkzmss7.js → chunk-w9gnqkez.js} +3 -3
  158. package/web/{chunk-kfbgvh0c.js → chunk-wqzbxzk3.js} +1 -1
  159. package/web/{chunk-hm8thq7c.js → chunk-wvrs986a.js} +2 -2
  160. package/web/chunk-x0mjydtp.js +1 -0
  161. package/web/{chunk-7dycbjxn.js → chunk-xpecre7w.js} +4 -4
  162. package/web/{chunk-zdhyq3ch.js → chunk-xvfeq8v2.js} +7 -7
  163. package/web/{chunk-2weaa3gn.js → chunk-y2rzeb4v.js} +2 -2
  164. package/web/{chunk-tggja45g.js → chunk-yf8ykk4v.js} +4 -4
  165. package/web/{chunk-gyhr27dm.js → chunk-yjs6jmdb.js} +1 -1
  166. package/web/{chunk-dsbyfvwz.js → chunk-ym7kv2hs.js} +1 -1
  167. package/web/chunk-zhybh04p.js +1 -0
  168. package/web/index.html +1 -1
  169. package/worker.js +1 -1
  170. package/chunk-7zkswxvk.js +0 -2
  171. package/chunk-m1eam0s5.js +0 -2
  172. package/chunk-zq32mwxj.js +0 -479
  173. package/web/chunk-32zmk3f5.js +0 -1
  174. package/web/chunk-3d3wnh8a.js +0 -2
  175. package/web/chunk-6cjm2yr7.js +0 -1
  176. package/web/chunk-7ycxz39p.js +0 -1
  177. package/web/chunk-9wr33d0t.js +0 -1
  178. package/web/chunk-a4tdrxdh.js +0 -1
  179. package/web/chunk-a9fvsyc1.js +0 -1
  180. package/web/chunk-apvbvg4d.js +0 -1
  181. package/web/chunk-bkxcc7v5.js +0 -1
  182. package/web/chunk-bve354k7.js +0 -1
  183. package/web/chunk-cwpxakby.js +0 -1
  184. package/web/chunk-jd7npyv9.js +0 -8
  185. package/web/chunk-jzz5htxp.js +0 -1
  186. package/web/chunk-ka3q31t1.js +0 -1
  187. package/web/chunk-kahab58k.js +0 -1139
  188. package/web/chunk-krgvx75q.js +0 -1
  189. package/web/chunk-m7k4wr3k.js +0 -1
  190. package/web/chunk-mdj3r75b.js +0 -1
  191. package/web/chunk-nbcpbqq4.js +0 -1
  192. package/web/chunk-p1yc8hwn.js +0 -2
  193. package/web/chunk-p29brxyt.js +0 -1
  194. package/web/chunk-p8fbes0t.js +0 -1
  195. package/web/chunk-r6q1301x.js +0 -1
  196. package/web/chunk-r8kghrkb.js +0 -1
  197. package/web/chunk-rhxn7mxg.js +0 -1
  198. package/web/chunk-svqshmpg.js +0 -1
  199. package/web/chunk-swzxq7r3.css +0 -1
  200. package/web/chunk-t18tn37m.js +0 -2
  201. package/web/chunk-tbsaseer.js +0 -1
  202. package/web/chunk-v0zfnvc1.js +0 -1
  203. package/web/chunk-vj31fs16.js +0 -1
  204. package/web/chunk-vr79r8vh.js +0 -1
  205. package/web/chunk-wb9tax0m.js +0 -1
  206. package/web/chunk-x9eghjjd.js +0 -1
  207. package/web/chunk-z3ky5ews.js +0 -2
@@ -1 +1 @@
1
- import{o,i,r,at,f,e,n,y,s,Z,it,ie,Jn,X}from"./chunk-kahab58k.js";var pe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],A=s("at-sign",pe);var ue=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],te=s("file-code-2",ue);var xe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ne=s("maximize-2",xe);var fe=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],J=s("notebook-pen",fe);var be=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],se=s("user",be);var C={approve:{label:"通过",text:"text-success",ring:"ring-success/80",soft:"bg-success/12 text-success"},reject:{label:"反对",text:"text-danger",ring:"ring-danger/80",soft:"bg-danger/12 text-danger"},abstain:{label:"弃权",text:"text-dim",ring:"ring-line-strong",soft:"bg-raised text-dim"},pending:{label:"未表态",text:"text-faint",ring:"ring-line",soft:"bg-raised text-faint"}},ge={thinking:"思考中",reading:"查阅中",speaking:"发言中",idle:"等待中",error:"出错",aborted:"已中止"},U={success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-faint"},G={success:"bg-success",warning:"bg-warning",danger:"bg-danger",neutral:"bg-faint"};function q(t){return t==="thinking"||t==="reading"||t==="speaking"}function F(t){let d=q(t.status);return{busy:d,text:d&&t.activeTool?t.activeTool:ge[t.status]}}function Q(t){let d=t.members.filter((v)=>v.verdict==="approve").length,u=t.members.filter((v)=>v.verdict==="reject").length;if(t.state==="running"){if(t.phase==="research")return{tone:"warning",label:"调研中"};if(t.phase==="opening")return{tone:"warning",label:"开场表态"};return{tone:"warning",label:"群聊交流"}}if(t.state==="consensus"){if(d===t.members.length)return{tone:"success",label:"全票通过"};if(u===t.members.length)return{tone:"danger",label:"全票反对"};if(u>d)return{tone:"danger",label:"共识:反对"};return{tone:"success",label:"共识:通过"}}if(t.state==="diverged")return{tone:"warning",label:"存在分歧"};if(t.state==="error")return{tone:"danger",label:"失败"};return{tone:"neutral",label:"已中止"}}function V(t){let d=Math.max(1,Math.round(t/1000));if(d<60)return`${d}s`;return`${Math.floor(d/60)}m ${String(d%60).padStart(2,"0")}s`}var ve={research:"调研",opening:"开场表态",discussion:"群聊交流"};function K(t){let{cn:d}=y(),{room:u}=t,v=Q(u),x=u.state==="running",b=u.research?["research","opening","discussion"]:["opening","discussion"],a=x?b.indexOf(u.phase==="closed"?"discussion":u.phase??"discussion"):-1,c=[...b.map((p,m)=>({key:p,label:ve[p],done:!x||m<a,active:m===a})),{key:"closed",label:x?"结论":v.label,done:!x,active:!1}];return e("ol",{className:d("flex min-w-0 gap-1",t.className),children:c.map((p,m)=>{let N=m===c.length-1&&!x;return n("li",{className:"min-w-0 flex-1",children:[e("span",{className:d("block h-[3px] rounded-full transition-colors duration-300",N?G[v.tone]:p.active?"bg-accent animate-pulse":p.done?"bg-line-strong":"bg-line/60")}),e("span",{className:d("mt-1.5 block truncate text-[11px]",N?d("font-medium",U[v.tone]):p.active?"font-medium text-ink":p.done?"text-dim":"text-faint"),children:p.label})]},p.key)})})}function oe(t){let{Collapsible:d,CollapsibleContent:u,Composer:v,Markdown:x,cn:b,confirm:a}=y(),{room:c,onClose:p}=t,[m,N]=r(!1),[w,M]=r(""),[g,L]=r(!1),[I,O]=r(),[S,H]=r(!1),[E,D]=r(!0),[B,h]=r(),z=i(!1);z.current=B!==void 0;let R=i(null),T=i(null),P=c.state==="running",j=Q(c),re=new Map(c.members.map((l)=>[l.id,l]));o(()=>{let l=(ee)=>{if(ee.key==="Escape"&&!ee.defaultPrevented&&!z.current)N(!0)},k=document.body.style.overflow;return document.body.style.overflow="hidden",window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l),document.body.style.overflow=k}},[]);let Y=c.messages.length;o(()=>{let l=T.current;if(!l||!E||Y===0)return;l.scrollTo({top:l.scrollHeight,behavior:"smooth"})},[Y,E]);let le=async(l)=>{await t.onPost(l),D(!0)},ce=async()=>{if(g)return;if(!await a({title:"中止理事会?",description:"所有成员会立即停止,已有发言保留。",action:"中止",danger:!0}))return;L(!0),O(void 0);try{await t.onAbort()}catch(k){O(k instanceof Error?k.message:"中止理事会失败")}finally{L(!1)}},W=(l)=>{M((k)=>k.includes(`@${l}`)?k:`${k?`${k.trimEnd()} `:""}@${l} `),R.current?.focus()},me=c.members.filter((l)=>l.verdict==="approve").length,de=c.members.filter((l)=>l.verdict==="reject").length,_=c.members.find((l)=>l.id===B);return at(n("div",{role:"dialog","aria-modal":"true","aria-label":`理事会:${c.topic}`,onAnimationEnd:(l)=>{if(m&&l.target===l.currentTarget)p()},className:b("fixed inset-0 z-50 flex flex-col bg-bg pt-[env(safe-area-inset-top)] text-ink",m?"pointer-events-none animate-dialog-out":"animate-dialog-in"),children:[n(d,{open:S,onOpenChange:H,className:"shrink-0 border-b border-line px-4 pt-3 pb-3 sm:px-6",children:[n("div",{className:"flex items-start gap-3",children:[n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex items-center gap-3 text-[11px] text-faint",children:[e("span",{className:"font-medium tracking-[0.2em] text-dim",children:"COUNCIL"}),e("span",{className:"tabular-nums",children:V(t.elapsedMs)}),n("span",{className:"tabular-nums",children:[c.messages.length," 条发言"]})]}),n("button",{type:"button","aria-expanded":S,onClick:()=>H((l)=>!l),className:"mt-0.5 flex max-w-full cursor-pointer items-start gap-1.5 text-left md:items-center",children:[e("h2",{className:"line-clamp-2 text-[15px] leading-snug font-semibold md:truncate md:text-lg",children:c.topic}),e(ie,{className:b("mt-0.5 size-4 shrink-0 text-faint transition-transform duration-300 ease-out-quint md:mt-0",!S&&"-rotate-90")})]})]}),n("div",{className:"flex shrink-0 items-center gap-1",children:[n("span",{className:b("inline-flex items-center gap-1.5 rounded-full border border-line px-2.5 py-1 text-xs font-medium",U[j.tone]),children:[e("span",{className:b("size-1.5 rounded-full",G[j.tone],P&&"animate-pulse")}),j.label]}),e("button",{type:"button","aria-label":"关闭理事会页面",title:"关闭(Esc)",onClick:()=>N(!0),className:"ml-1 inline-flex size-10 -mr-2 cursor-pointer items-center justify-center rounded-full text-faint transition-colors hover:bg-raised hover:text-ink md:size-8 md:mr-0",children:e(X,{className:"size-4"})})]})]}),e(u,{children:e("div",{className:"mt-2 max-h-[40dvh] overflow-y-auto overscroll-contain rounded-xl bg-panel px-3.5 py-2.5 text-[13px] leading-relaxed text-dim md:max-h-48",children:e(x,{text:c.brief})})}),e(K,{room:c,className:"mt-3"})]}),n("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[e("div",{className:"flex shrink-0 gap-2 overflow-x-auto overscroll-x-contain border-b border-line px-4 py-2.5 [scrollbar-width:none] md:hidden",children:c.members.map((l)=>e(he,{member:l,onSelect:()=>h(l.id)},l.id))}),n("aside",{className:"hidden w-72 shrink-0 flex-col gap-2 overflow-y-auto border-r border-line p-4 md:flex",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[e("span",{className:"font-medium tracking-wide",children:"席位"}),n("span",{className:"tabular-nums",children:[e("span",{className:"text-success",children:me})," / ",e("span",{className:"text-danger",children:de})," /"," ",c.members.length]})]}),c.members.map((l)=>e(ye,{member:l,onMention:()=>W(l.name),onOpen:()=>t.onOpenMember(l.childSessionID)},l.id))]}),n("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e("div",{ref:T,onScroll:(l)=>{let k=l.currentTarget;D(k.scrollHeight-k.scrollTop-k.clientHeight<80)},className:"min-h-0 flex-1 overflow-y-auto",children:n("div",{className:"mx-auto w-full max-w-3xl px-4 py-4 sm:px-6 md:py-5",children:[c.messages.length===0?n("div",{className:"flex flex-col items-center justify-center gap-3 py-24 text-center text-faint",children:[P?e(Z,{className:"size-5 animate-spin"}):null,e("p",{className:"text-sm",children:P?c.phase==="research"?"成员正在各自调研,笔记不会进入群聊":"成员正在独立准备开场观点,彼此不可见":"这场理事会没有产生发言"})]}):e("ol",{className:"space-y-5",children:c.messages.map((l)=>e(ke,{message:l,membersByID:re,onMention:()=>W(l.senderName)},l.floor))}),c.summary&&!P&&n("section",{className:"mt-8 rounded-2xl border border-line bg-panel px-4 py-3",children:[n("h3",{className:b("text-xs font-semibold",U[j.tone]),children:["结论:",j.label]}),e("div",{className:"mt-1.5 text-[13px] leading-relaxed text-dim",children:e(x,{text:c.summary})})]})]})}),e("div",{className:"shrink-0 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-6 md:pb-4",children:n("div",{className:"mx-auto w-full max-w-3xl",children:[I&&e("p",{role:"status",className:"px-1 pb-2 text-[13px] text-danger",children:I}),e(v,{draftKey:`council:${c.roomID}`,placeholder:P?"插话,@ 某位成员会点名要求其回应":"理事会已结束,插话会重新唤醒成员",busy:P,allowAttachments:!1,text:w,onTextChange:M,inputRef:R,onSend:le,onAbort:()=>void ce()})]})})]})]}),_&&e(Ne,{member:_,onClose:()=>h(void 0),onMention:()=>{h(void 0),W(_.name)},onOpen:()=>t.onOpenMember(_.childSessionID)})]}),document.body)}function he(t){let{ModelIcon:d,cn:u}=y(),{member:v}=t,x=C[v.verdict]??C.pending,{busy:b}=F(v);return n("button",{type:"button",onClick:t.onSelect,"aria-label":`${v.name},${x.label},查看详情`,className:"flex h-11 max-w-[11rem] shrink-0 cursor-pointer items-center gap-2 rounded-full border border-line bg-panel/60 pr-3.5 pl-1.5 active:bg-raised",children:[n("span",{className:u("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",x.ring),children:[e(d,{modelID:v.model,className:"size-4",size:16}),b&&e(Z,{className:"absolute -right-1 -bottom-1 size-3.5 animate-spin rounded-full bg-bg text-accent"})]}),n("span",{className:"min-w-0 text-left leading-tight",children:[e("span",{className:"block truncate text-[13px] font-medium",children:v.name}),e("span",{className:u("block text-[11px]",x.text),children:x.label})]})]})}function Ne(t){let{Button:d,Dialog:u,Markdown:v,ModelIcon:x,cn:b}=y(),{member:a}=t,c=C[a.verdict]??C.pending,p=F(a);return e(u,{open:!0,onOpenChange:(m)=>!m&&t.onClose(),title:n("span",{className:"flex min-w-0 items-center gap-2.5",children:[e("span",{className:b("flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",c.ring),children:e(x,{modelID:a.model,className:"size-4",size:16})}),e("span",{className:"min-w-0 truncate",children:a.name}),e("span",{className:b("shrink-0 rounded px-1.5 py-px text-[11px] font-medium",c.soft),children:c.label})]}),description:a.model,footer:n(f,{children:[n(d,{variant:"secondary",onClick:t.onMention,children:[e(A,{className:"size-4"}),"点名"]}),n(d,{variant:"secondary",onClick:t.onOpen,children:[e(it,{className:"size-4"}),"查看推理"]})]}),children:n("div",{className:"space-y-3 pb-1",children:[n("div",{className:"flex items-center gap-3 text-[13px]",children:[n("span",{className:b("flex min-w-0 flex-1 items-center gap-1.5",p.busy?"text-accent":"text-dim"),children:[p.busy&&e(Z,{className:"size-3.5 shrink-0 animate-spin"}),e("span",{className:"truncate",children:p.text})]}),n("span",{className:"shrink-0 text-faint tabular-nums",children:["发言 ",a.turns??0," 次"]})]}),a.notes?n("section",{children:[n("h3",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-faint",children:[e(J,{className:"size-3.5"}),"调研笔记"]}),e("div",{className:"rounded-xl bg-bg/60 px-3.5 py-2.5 text-[13px] leading-relaxed text-dim",children:e(v,{text:a.notes})})]}):e("p",{className:"text-[13px] text-faint",children:"没有调研笔记"})]})})}function ye(t){let{Collapsible:d,CollapsibleContent:u,Markdown:v,ModelIcon:x,cn:b}=y(),{member:a}=t,[c,p]=r(!1),m=C[a.verdict]??C.pending,{busy:N,text:w}=F(a);return n(d,{open:c,onOpenChange:p,className:"shrink-0 rounded-xl border border-line bg-panel/60 p-2.5",children:[n("div",{className:"flex items-center gap-2.5",children:[e("span",{className:b("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",m.ring),children:e(x,{modelID:a.model,className:"size-4",size:16})}),n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex items-center gap-1.5",children:[e("span",{className:"truncate text-[13px] font-medium",title:a.model,children:a.name}),e("span",{className:b("shrink-0 rounded px-1 text-[10.5px] font-medium",m.soft),children:m.label})]}),n("div",{className:b("flex min-w-0 items-center gap-1 text-[11px]",N?"text-accent":"text-faint"),children:[N&&e(Z,{className:"size-3 shrink-0 animate-spin"}),e("span",{className:"truncate",children:w})]})]})]}),n("div",{className:"mt-2 flex items-center gap-1 text-[11px] text-faint",children:[n("span",{className:"tabular-nums",children:["发言 ",a.turns??0," 次"]}),e("span",{className:"ml-auto"}),a.notes&&n("button",{type:"button","aria-expanded":c,onClick:()=>p((M)=>!M),className:b("inline-flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 hover:bg-raised hover:text-ink",c&&"text-ink"),children:[e(J,{className:"size-3"}),"笔记"]}),e("button",{type:"button","aria-label":`@ ${a.name}`,title:`@ ${a.name}`,onClick:t.onMention,className:"inline-flex cursor-pointer items-center rounded p-1 hover:bg-raised hover:text-ink",children:e(A,{className:"size-3"})}),e("button",{type:"button","aria-label":`查看 ${a.name} 的推理过程`,title:"查看推理与工具调用",onClick:t.onOpen,className:"inline-flex cursor-pointer items-center rounded p-1 hover:bg-raised hover:text-ink",children:e(it,{className:"size-3"})})]}),a.notes&&e(u,{children:e("div",{className:"mt-2 max-h-56 overflow-y-auto rounded-lg bg-bg/60 px-2.5 py-2 text-xs leading-relaxed text-dim",children:e(v,{text:a.notes})})})]})}function ke(t){let{Code:d,Collapsible:u,CollapsibleContent:v,Markdown:x,cn:b}=y(),{message:a}=t,[c,p]=r(!1),m=a.senderID==="user"||a.senderID==="host",N=a.verdict&&a.verdict!=="pending"?C[a.verdict]:void 0,w=a.evidences??[],M=(a.mentions??[]).map((g)=>t.membersByID.get(g)).filter((g)=>g!==void 0);return n("li",{id:`council-floor-${a.floor}`,className:"group flex gap-3 animate-fade",children:[e(ae,{message:a,isHuman:m,className:"mt-0.5 hidden size-8 md:flex"}),n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",children:[e(ae,{message:a,isHuman:m,className:"flex size-6 md:hidden"}),e("span",{className:"font-semibold text-ink",title:a.senderModel,children:a.senderName}),n("a",{href:`#council-floor-${a.floor}`,className:"font-mono text-[11px] text-faint hover:text-dim",onClick:(g)=>g.preventDefault(),children:["#",a.floor]}),N&&e("span",{className:b("rounded px-1.5 py-px text-[10.5px] font-medium",N.soft),children:N.label}),!m&&n("button",{type:"button",onClick:t.onMention,className:"ml-auto inline-flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-[11px] text-faint transition-opacity hover:bg-raised hover:text-ink focus-visible:opacity-100 md:px-1.5 md:py-0.5 md:opacity-0 md:group-hover:opacity-100",children:[e(A,{className:"size-3"}),"回复"]})]}),(a.replyToFloor||M.length>0)&&n("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[11px] text-faint",children:[a.replyToFloor&&n("button",{type:"button",onClick:()=>document.getElementById(`council-floor-${a.replyToFloor}`)?.scrollIntoView({block:"center",behavior:"smooth"}),className:"inline-flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-md bg-raised/70 px-1.5 py-0.5 hover:text-ink",children:[e(Jn,{className:"size-3 shrink-0"}),n("span",{className:"shrink-0 text-dim",children:["#",a.replyToFloor," ",a.replyToName]}),a.replyToPreview&&e("span",{className:"truncate",children:a.replyToPreview})]}),M.map((g)=>n("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-accent",children:[e(A,{className:"size-3"}),g.name]},g.id))]}),e("div",{className:"mt-1.5 break-words text-[14px] leading-relaxed text-ink/90 md:text-[13.5px] [&_p]:my-1.5 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:e(x,{text:a.text})}),w.length>0&&n(u,{open:c,onOpenChange:p,className:"mt-2",children:[n("button",{type:"button","aria-expanded":c,onClick:()=>p((g)=>!g),className:"inline-flex max-w-full cursor-pointer items-center gap-1 text-[11px] text-faint hover:text-ink",children:[e(te,{className:"size-3 shrink-0"}),n("span",{className:"shrink-0",children:["查阅 ",w.length," 处"]}),!c&&e("span",{className:"truncate font-mono",children:w.map((g)=>g.label).join(",")}),e(ie,{className:b("size-3 shrink-0 transition-transform duration-300 ease-out-quint",!c&&"-rotate-90")})]}),e(v,{children:e("div",{className:"mt-1.5 space-y-1.5",children:w.map((g)=>n("div",{className:"overflow-hidden rounded-lg border border-line bg-panel text-xs",children:[e("div",{className:"truncate border-b border-line/70 px-2.5 py-1 font-mono text-[11px] text-dim",children:g.label}),g.snippet&&e(d,{code:g.snippet,lang:g.lang||"ts",className:"max-h-40 overflow-auto px-2.5 py-1.5 text-[11.5px]"})]},`${g.tool}:${g.label}:${g.snippet?.slice(0,32)??""}`))})})]})]})]})}function ae(t){let{ModelIcon:d,cn:u}=y();return e("span",{className:u("shrink-0 items-center justify-center rounded-full",t.isHuman?"bg-accent/12 text-accent":"bg-raised",t.className),children:t.message.senderModel?e(d,{modelID:t.message.senderModel,className:"size-4",size:16}):e(se,{className:"size-4"})})}function Je(t){let{ModelIcon:d,cn:u,useTheme:v}=y();v();let{connection:x,sessionID:b,payload:a,onOpen:c}=t,p=a,[m,N]=r(p),[w,M]=r(!1),[g,L]=r(Date.now);o(()=>{N(p)},[p]);let I=m.state==="running",O=`/api/sessions/${encodeURIComponent(b)}/council/${encodeURIComponent(m.roomID)}`;o(()=>{if(!I)return;let h=!1,R=setInterval(()=>{if(x.request(O).then((T)=>{if(!h&&T&&typeof T==="object"&&"roomID"in T)N(T)}).catch(()=>{}),!h)L(Date.now())},1200);return()=>{h=!0,clearInterval(R)}},[x,O,I]);let S=async(h)=>{let z=await x.request(`${O}/post`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:h})});N(z)},H=async()=>{let h=await x.request(`${O}/kill`,{method:"POST"});N(h)},E=(I?g:m.updatedAt)-m.createdAt,D=m.messages.at(-1),B=m.members.filter((h)=>q(h.status)).length;return n(f,{children:[n("button",{type:"button","aria-label":`进入理事会:${m.topic}`,onClick:()=>M(!0),className:"group relative my-2 block w-full cursor-pointer overflow-hidden rounded-2xl border border-line bg-panel text-left transition-colors hover:border-line-strong animate-fade",children:[n("div",{className:"px-4 pt-3.5",children:[n("div",{className:"flex items-center gap-1.5 text-[11px] text-faint",children:[e("span",{className:"font-medium text-dim",children:"理事会"}),e("span",{"aria-hidden":!0,children:"·"}),e("span",{className:"tabular-nums",children:V(E)}),n("span",{className:"ml-auto tabular-nums",children:[m.members.length," 位成员"]})]}),e("h4",{className:"mt-1 line-clamp-2 text-sm font-semibold text-ink md:truncate",title:m.topic,children:m.topic})]}),e(K,{room:m,className:"mt-3 px-4"}),e("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-4",children:m.members.map((h)=>{let z=C[h.verdict]??C.pending,R=q(h.status);return n("span",{className:"flex min-w-0 items-center gap-1.5 text-xs",title:h.model,children:[n("span",{className:u("relative flex size-6 shrink-0 items-center justify-center rounded-full bg-raised ring-2",z.ring),children:[e(d,{modelID:h.model,className:"size-3.5",size:14}),R&&e(Z,{className:"absolute -right-1 -bottom-1 size-3 animate-spin rounded-full bg-panel text-accent"})]}),e("span",{className:"truncate text-dim",children:h.name}),e("span",{className:u("shrink-0 text-[11px]",z.text),children:z.label})]},h.id)})}),n("div",{className:"mt-3 flex items-center gap-2 border-t border-line/70 px-4 py-2.5 text-xs",children:[D?n(f,{children:[e("span",{className:"shrink-0 font-medium text-dim",children:D.senderName}),e("span",{className:"min-w-0 flex-1 truncate text-faint",children:D.text.replace(/\s+/g," ")})]}):e("span",{className:"min-w-0 flex-1 truncate text-faint",children:I?`${B} 位成员正在${m.phase==="research"?"调研":"思考"}…`:"没有发言"}),n("span",{className:"inline-flex shrink-0 items-center gap-1 text-faint transition-colors group-hover:text-ink",children:[m.messages.length>0&&n("span",{className:"tabular-nums",children:[m.messages.length," 条"]}),e(ne,{className:"size-3.5"})]})]})]}),w&&e(oe,{room:m,elapsedMs:E,onClose:()=>M(!1),onOpenMember:c,onPost:S,onAbort:H})]})}export{Je as CouncilCard};
1
+ import{o,i,r,it,f,e,n,y,s,K,ot,ie,er,Z}from"./chunk-3k9h7a73.js";var pe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],A=s("at-sign",pe);var ue=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],te=s("file-code-2",ue);var xe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ne=s("maximize-2",xe);var fe=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],X=s("notebook-pen",fe);var be=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],se=s("user",be);var C={approve:{label:"通过",text:"text-success",ring:"ring-success/80",soft:"bg-success/12 text-success"},reject:{label:"反对",text:"text-danger",ring:"ring-danger/80",soft:"bg-danger/12 text-danger"},abstain:{label:"弃权",text:"text-dim",ring:"ring-line-strong",soft:"bg-raised text-dim"},pending:{label:"未表态",text:"text-faint",ring:"ring-line",soft:"bg-raised text-faint"}},ge={thinking:"思考中",reading:"查阅中",speaking:"发言中",idle:"等待中",error:"出错",aborted:"已中止"},U={success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-faint"},G={success:"bg-success",warning:"bg-warning",danger:"bg-danger",neutral:"bg-faint"};function q(t){return t==="thinking"||t==="reading"||t==="speaking"}function F(t){let d=q(t.status);return{busy:d,text:d&&t.activeTool?t.activeTool:ge[t.status]}}function Q(t){let d=t.members.filter((v)=>v.verdict==="approve").length,u=t.members.filter((v)=>v.verdict==="reject").length;if(t.state==="running"){if(t.phase==="research")return{tone:"warning",label:"调研中"};if(t.phase==="opening")return{tone:"warning",label:"开场表态"};return{tone:"warning",label:"群聊交流"}}if(t.state==="consensus"){if(d===t.members.length)return{tone:"success",label:"全票通过"};if(u===t.members.length)return{tone:"danger",label:"全票反对"};if(u>d)return{tone:"danger",label:"共识:反对"};return{tone:"success",label:"共识:通过"}}if(t.state==="diverged")return{tone:"warning",label:"存在分歧"};if(t.state==="error")return{tone:"danger",label:"失败"};return{tone:"neutral",label:"已中止"}}function V(t){let d=Math.max(1,Math.round(t/1000));if(d<60)return`${d}s`;return`${Math.floor(d/60)}m ${String(d%60).padStart(2,"0")}s`}var ve={research:"调研",opening:"开场表态",discussion:"群聊交流"};function W(t){let{cn:d}=y(),{room:u}=t,v=Q(u),x=u.state==="running",b=u.research?["research","opening","discussion"]:["opening","discussion"],a=x?b.indexOf(u.phase==="closed"?"discussion":u.phase??"discussion"):-1,c=[...b.map((p,m)=>({key:p,label:ve[p],done:!x||m<a,active:m===a})),{key:"closed",label:x?"结论":v.label,done:!x,active:!1}];return e("ol",{className:d("flex min-w-0 gap-1",t.className),children:c.map((p,m)=>{let N=m===c.length-1&&!x;return n("li",{className:"min-w-0 flex-1",children:[e("span",{className:d("block h-[3px] rounded-full transition-colors duration-300",N?G[v.tone]:p.active?"bg-accent animate-pulse":p.done?"bg-line-strong":"bg-line/60")}),e("span",{className:d("mt-1.5 block truncate text-[11px]",N?d("font-medium",U[v.tone]):p.active?"font-medium text-ink":p.done?"text-dim":"text-faint"),children:p.label})]},p.key)})})}function oe(t){let{Collapsible:d,CollapsibleContent:u,Composer:v,Markdown:x,cn:b,confirm:a}=y(),{room:c,onClose:p}=t,[m,N]=r(!1),[w,M]=r(""),[g,L]=r(!1),[I,O]=r(),[S,H]=r(!1),[E,D]=r(!0),[B,h]=r(),z=i(!1);z.current=B!==void 0;let R=i(null),T=i(null),P=c.state==="running",j=Q(c),re=new Map(c.members.map((l)=>[l.id,l]));o(()=>{let l=(ee)=>{if(ee.key==="Escape"&&!ee.defaultPrevented&&!z.current)N(!0)},k=document.body.style.overflow;return document.body.style.overflow="hidden",window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l),document.body.style.overflow=k}},[]);let Y=c.messages.length;o(()=>{let l=T.current;if(!l||!E||Y===0)return;l.scrollTo({top:l.scrollHeight,behavior:"smooth"})},[Y,E]);let le=async(l)=>{await t.onPost(l),D(!0)},ce=async()=>{if(g)return;if(!await a({title:"中止理事会?",description:"所有成员会立即停止,已有发言保留。",action:"中止",danger:!0}))return;L(!0),O(void 0);try{await t.onAbort()}catch(k){O(k instanceof Error?k.message:"中止理事会失败")}finally{L(!1)}},J=(l)=>{M((k)=>k.includes(`@${l}`)?k:`${k?`${k.trimEnd()} `:""}@${l} `),R.current?.focus()},me=c.members.filter((l)=>l.verdict==="approve").length,de=c.members.filter((l)=>l.verdict==="reject").length,_=c.members.find((l)=>l.id===B);return it(n("div",{role:"dialog","aria-modal":"true","aria-label":`理事会:${c.topic}`,onAnimationEnd:(l)=>{if(m&&l.target===l.currentTarget)p()},className:b("fixed inset-0 z-50 flex flex-col bg-bg pt-[env(safe-area-inset-top)] text-ink",m?"pointer-events-none animate-dialog-out":"animate-dialog-in"),children:[n(d,{open:S,onOpenChange:H,className:"shrink-0 border-b border-line px-4 pt-3 pb-3 sm:px-6",children:[n("div",{className:"flex items-start gap-3",children:[n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex items-center gap-3 text-[11px] text-faint",children:[e("span",{className:"font-medium tracking-[0.2em] text-dim",children:"COUNCIL"}),e("span",{className:"tabular-nums",children:V(t.elapsedMs)}),n("span",{className:"tabular-nums",children:[c.messages.length," 条发言"]})]}),n("button",{type:"button","aria-expanded":S,onClick:()=>H((l)=>!l),className:"mt-0.5 flex max-w-full cursor-pointer items-start gap-1.5 text-left md:items-center",children:[e("h2",{className:"line-clamp-2 text-[15px] leading-snug font-semibold md:truncate md:text-lg",children:c.topic}),e(ie,{className:b("mt-0.5 size-4 shrink-0 text-faint transition-transform duration-300 ease-out-quint md:mt-0",!S&&"-rotate-90")})]})]}),n("div",{className:"flex shrink-0 items-center gap-1",children:[n("span",{className:b("inline-flex items-center gap-1.5 rounded-full border border-line px-2.5 py-1 text-xs font-medium",U[j.tone]),children:[e("span",{className:b("size-1.5 rounded-full",G[j.tone],P&&"animate-pulse")}),j.label]}),e("button",{type:"button","aria-label":"关闭理事会页面",title:"关闭(Esc)",onClick:()=>N(!0),className:"ml-1 inline-flex size-10 -mr-2 cursor-pointer items-center justify-center rounded-full text-faint transition-colors hover:bg-raised hover:text-ink md:size-8 md:mr-0",children:e(Z,{className:"size-4"})})]})]}),e(u,{children:e("div",{className:"mt-2 max-h-[40dvh] overflow-y-auto overscroll-contain rounded-xl bg-panel px-3.5 py-2.5 text-[13px] leading-relaxed text-dim md:max-h-48",children:e(x,{text:c.brief})})}),e(W,{room:c,className:"mt-3"})]}),n("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[e("div",{className:"flex shrink-0 gap-2 overflow-x-auto overscroll-x-contain border-b border-line px-4 py-2.5 [scrollbar-width:none] md:hidden",children:c.members.map((l)=>e(he,{member:l,onSelect:()=>h(l.id)},l.id))}),n("aside",{className:"hidden w-72 shrink-0 flex-col gap-2 overflow-y-auto border-r border-line p-4 md:flex",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[e("span",{className:"font-medium tracking-wide",children:"席位"}),n("span",{className:"tabular-nums",children:[e("span",{className:"text-success",children:me})," / ",e("span",{className:"text-danger",children:de})," /"," ",c.members.length]})]}),c.members.map((l)=>e(ye,{member:l,onMention:()=>J(l.name),onOpen:()=>t.onOpenMember(l.childSessionID)},l.id))]}),n("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e("div",{ref:T,onScroll:(l)=>{let k=l.currentTarget;D(k.scrollHeight-k.scrollTop-k.clientHeight<80)},className:"min-h-0 flex-1 overflow-y-auto",children:n("div",{className:"mx-auto w-full max-w-3xl px-4 py-4 sm:px-6 md:py-5",children:[c.messages.length===0?n("div",{className:"flex flex-col items-center justify-center gap-3 py-24 text-center text-faint",children:[P?e(K,{className:"size-5 animate-spin"}):null,e("p",{className:"text-sm",children:P?c.phase==="research"?"成员正在各自调研,笔记不会进入群聊":"成员正在独立准备开场观点,彼此不可见":"这场理事会没有产生发言"})]}):e("ol",{className:"space-y-5",children:c.messages.map((l)=>e(ke,{message:l,membersByID:re,onMention:()=>J(l.senderName)},l.floor))}),c.summary&&!P&&n("section",{className:"mt-8 rounded-2xl border border-line bg-panel px-4 py-3",children:[n("h3",{className:b("text-xs font-semibold",U[j.tone]),children:["结论:",j.label]}),e("div",{className:"mt-1.5 text-[13px] leading-relaxed text-dim",children:e(x,{text:c.summary})})]})]})}),e("div",{className:"shrink-0 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-6 md:pb-4",children:n("div",{className:"mx-auto w-full max-w-3xl",children:[I&&e("p",{role:"status",className:"px-1 pb-2 text-[13px] text-danger",children:I}),e(v,{draftKey:`council:${c.roomID}`,placeholder:P?"插话,@ 某位成员会点名要求其回应":"理事会已结束,插话会重新唤醒成员",busy:P,allowAttachments:!1,text:w,onTextChange:M,inputRef:R,onSend:le,onAbort:()=>void ce()})]})})]})]}),_&&e(Ne,{member:_,onClose:()=>h(void 0),onMention:()=>{h(void 0),J(_.name)},onOpen:()=>t.onOpenMember(_.childSessionID)})]}),document.body)}function he(t){let{ModelIcon:d,cn:u}=y(),{member:v}=t,x=C[v.verdict]??C.pending,{busy:b}=F(v);return n("button",{type:"button",onClick:t.onSelect,"aria-label":`${v.name},${x.label},查看详情`,className:"flex h-11 max-w-[11rem] shrink-0 cursor-pointer items-center gap-2 rounded-full border border-line bg-panel/60 pr-3.5 pl-1.5 active:bg-raised",children:[n("span",{className:u("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",x.ring),children:[e(d,{modelID:v.model,className:"size-4",size:16}),b&&e(K,{className:"absolute -right-1 -bottom-1 size-3.5 animate-spin rounded-full bg-bg text-accent"})]}),n("span",{className:"min-w-0 text-left leading-tight",children:[e("span",{className:"block truncate text-[13px] font-medium",children:v.name}),e("span",{className:u("block text-[11px]",x.text),children:x.label})]})]})}function Ne(t){let{Button:d,Dialog:u,Markdown:v,ModelIcon:x,cn:b}=y(),{member:a}=t,c=C[a.verdict]??C.pending,p=F(a);return e(u,{open:!0,onOpenChange:(m)=>!m&&t.onClose(),title:n("span",{className:"flex min-w-0 items-center gap-2.5",children:[e("span",{className:b("flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",c.ring),children:e(x,{modelID:a.model,className:"size-4",size:16})}),e("span",{className:"min-w-0 truncate",children:a.name}),e("span",{className:b("shrink-0 rounded px-1.5 py-px text-[11px] font-medium",c.soft),children:c.label})]}),description:a.model,footer:n(f,{children:[n(d,{variant:"secondary",onClick:t.onMention,children:[e(A,{className:"size-4"}),"点名"]}),n(d,{variant:"secondary",onClick:t.onOpen,children:[e(ot,{className:"size-4"}),"查看推理"]})]}),children:n("div",{className:"space-y-3 pb-1",children:[n("div",{className:"flex items-center gap-3 text-[13px]",children:[n("span",{className:b("flex min-w-0 flex-1 items-center gap-1.5",p.busy?"text-accent":"text-dim"),children:[p.busy&&e(K,{className:"size-3.5 shrink-0 animate-spin"}),e("span",{className:"truncate",children:p.text})]}),n("span",{className:"shrink-0 text-faint tabular-nums",children:["发言 ",a.turns??0," 次"]})]}),a.notes?n("section",{children:[n("h3",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-faint",children:[e(X,{className:"size-3.5"}),"调研笔记"]}),e("div",{className:"rounded-xl bg-bg/60 px-3.5 py-2.5 text-[13px] leading-relaxed text-dim",children:e(v,{text:a.notes})})]}):e("p",{className:"text-[13px] text-faint",children:"没有调研笔记"})]})})}function ye(t){let{Collapsible:d,CollapsibleContent:u,Markdown:v,ModelIcon:x,cn:b}=y(),{member:a}=t,[c,p]=r(!1),m=C[a.verdict]??C.pending,{busy:N,text:w}=F(a);return n(d,{open:c,onOpenChange:p,className:"shrink-0 rounded-xl border border-line bg-panel/60 p-2.5",children:[n("div",{className:"flex items-center gap-2.5",children:[e("span",{className:b("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-raised ring-2",m.ring),children:e(x,{modelID:a.model,className:"size-4",size:16})}),n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex items-center gap-1.5",children:[e("span",{className:"truncate text-[13px] font-medium",title:a.model,children:a.name}),e("span",{className:b("shrink-0 rounded px-1 text-[10.5px] font-medium",m.soft),children:m.label})]}),n("div",{className:b("flex min-w-0 items-center gap-1 text-[11px]",N?"text-accent":"text-faint"),children:[N&&e(K,{className:"size-3 shrink-0 animate-spin"}),e("span",{className:"truncate",children:w})]})]})]}),n("div",{className:"mt-2 flex items-center gap-1 text-[11px] text-faint",children:[n("span",{className:"tabular-nums",children:["发言 ",a.turns??0," 次"]}),e("span",{className:"ml-auto"}),a.notes&&n("button",{type:"button","aria-expanded":c,onClick:()=>p((M)=>!M),className:b("inline-flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 hover:bg-raised hover:text-ink",c&&"text-ink"),children:[e(X,{className:"size-3"}),"笔记"]}),e("button",{type:"button","aria-label":`@ ${a.name}`,title:`@ ${a.name}`,onClick:t.onMention,className:"inline-flex cursor-pointer items-center rounded p-1 hover:bg-raised hover:text-ink",children:e(A,{className:"size-3"})}),e("button",{type:"button","aria-label":`查看 ${a.name} 的推理过程`,title:"查看推理与工具调用",onClick:t.onOpen,className:"inline-flex cursor-pointer items-center rounded p-1 hover:bg-raised hover:text-ink",children:e(ot,{className:"size-3"})})]}),a.notes&&e(u,{children:e("div",{className:"mt-2 max-h-56 overflow-y-auto rounded-lg bg-bg/60 px-2.5 py-2 text-xs leading-relaxed text-dim",children:e(v,{text:a.notes})})})]})}function ke(t){let{Code:d,Collapsible:u,CollapsibleContent:v,Markdown:x,cn:b}=y(),{message:a}=t,[c,p]=r(!1),m=a.senderID==="user"||a.senderID==="host",N=a.verdict&&a.verdict!=="pending"?C[a.verdict]:void 0,w=a.evidences??[],M=(a.mentions??[]).map((g)=>t.membersByID.get(g)).filter((g)=>g!==void 0);return n("li",{id:`council-floor-${a.floor}`,className:"group flex gap-3 animate-fade",children:[e(ae,{message:a,isHuman:m,className:"mt-0.5 hidden size-8 md:flex"}),n("div",{className:"min-w-0 flex-1",children:[n("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",children:[e(ae,{message:a,isHuman:m,className:"flex size-6 md:hidden"}),e("span",{className:"font-semibold text-ink",title:a.senderModel,children:a.senderName}),n("a",{href:`#council-floor-${a.floor}`,className:"font-mono text-[11px] text-faint hover:text-dim",onClick:(g)=>g.preventDefault(),children:["#",a.floor]}),N&&e("span",{className:b("rounded px-1.5 py-px text-[10.5px] font-medium",N.soft),children:N.label}),!m&&n("button",{type:"button",onClick:t.onMention,className:"ml-auto inline-flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-[11px] text-faint transition-opacity hover:bg-raised hover:text-ink focus-visible:opacity-100 md:px-1.5 md:py-0.5 md:opacity-0 md:group-hover:opacity-100",children:[e(A,{className:"size-3"}),"回复"]})]}),(a.replyToFloor||M.length>0)&&n("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[11px] text-faint",children:[a.replyToFloor&&n("button",{type:"button",onClick:()=>document.getElementById(`council-floor-${a.replyToFloor}`)?.scrollIntoView({block:"center",behavior:"smooth"}),className:"inline-flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-md bg-raised/70 px-1.5 py-0.5 hover:text-ink",children:[e(er,{className:"size-3 shrink-0"}),n("span",{className:"shrink-0 text-dim",children:["#",a.replyToFloor," ",a.replyToName]}),a.replyToPreview&&e("span",{className:"truncate",children:a.replyToPreview})]}),M.map((g)=>n("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-accent",children:[e(A,{className:"size-3"}),g.name]},g.id))]}),e("div",{className:"mt-1.5 break-words text-[14px] leading-relaxed text-ink/90 md:text-[13.5px] [&_p]:my-1.5 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:e(x,{text:a.text})}),w.length>0&&n(u,{open:c,onOpenChange:p,className:"mt-2",children:[n("button",{type:"button","aria-expanded":c,onClick:()=>p((g)=>!g),className:"inline-flex max-w-full cursor-pointer items-center gap-1 text-[11px] text-faint hover:text-ink",children:[e(te,{className:"size-3 shrink-0"}),n("span",{className:"shrink-0",children:["查阅 ",w.length," 处"]}),!c&&e("span",{className:"truncate font-mono",children:w.map((g)=>g.label).join(",")}),e(ie,{className:b("size-3 shrink-0 transition-transform duration-300 ease-out-quint",!c&&"-rotate-90")})]}),e(v,{children:e("div",{className:"mt-1.5 space-y-1.5",children:w.map((g)=>n("div",{className:"overflow-hidden rounded-lg border border-line bg-panel text-xs",children:[e("div",{className:"truncate border-b border-line/70 px-2.5 py-1 font-mono text-[11px] text-dim",children:g.label}),g.snippet&&e(d,{code:g.snippet,lang:g.lang||"ts",className:"max-h-40 overflow-auto px-2.5 py-1.5 text-[11.5px]"})]},`${g.tool}:${g.label}:${g.snippet?.slice(0,32)??""}`))})})]})]})]})}function ae(t){let{ModelIcon:d,cn:u}=y();return e("span",{className:u("shrink-0 items-center justify-center rounded-full",t.isHuman?"bg-accent/12 text-accent":"bg-raised",t.className),children:t.message.senderModel?e(d,{modelID:t.message.senderModel,className:"size-4",size:16}):e(se,{className:"size-4"})})}function Je(t){let{ModelIcon:d,cn:u,useTheme:v}=y();v();let{connection:x,sessionID:b,payload:a,onOpen:c}=t,p=a,[m,N]=r(p),[w,M]=r(!1),[g,L]=r(Date.now);o(()=>{N(p)},[p]);let I=m.state==="running",O=`/api/sessions/${encodeURIComponent(b)}/council/${encodeURIComponent(m.roomID)}`;o(()=>{if(!I)return;let h=!1,R=setInterval(()=>{if(x.request(O).then((T)=>{if(!h&&T&&typeof T==="object"&&"roomID"in T)N(T)}).catch(()=>{}),!h)L(Date.now())},1200);return()=>{h=!0,clearInterval(R)}},[x,O,I]);let S=async(h)=>{let z=await x.request(`${O}/post`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:h})});N(z)},H=async()=>{let h=await x.request(`${O}/kill`,{method:"POST"});N(h)},E=(I?g:m.updatedAt)-m.createdAt,D=m.messages.at(-1),B=m.members.filter((h)=>q(h.status)).length;return n(f,{children:[n("button",{type:"button","aria-label":`进入理事会:${m.topic}`,onClick:()=>M(!0),className:"group relative my-2 block w-full cursor-pointer overflow-hidden rounded-2xl border border-line bg-panel text-left transition-colors hover:border-line-strong animate-fade",children:[n("div",{className:"px-4 pt-3.5",children:[n("div",{className:"flex items-center gap-1.5 text-[11px] text-faint",children:[e("span",{className:"font-medium text-dim",children:"理事会"}),e("span",{"aria-hidden":!0,children:"·"}),e("span",{className:"tabular-nums",children:V(E)}),n("span",{className:"ml-auto tabular-nums",children:[m.members.length," 位成员"]})]}),e("h4",{className:"mt-1 line-clamp-2 text-sm font-semibold text-ink md:truncate",title:m.topic,children:m.topic})]}),e(W,{room:m,className:"mt-3 px-4"}),e("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-4",children:m.members.map((h)=>{let z=C[h.verdict]??C.pending,R=q(h.status);return n("span",{className:"flex min-w-0 items-center gap-1.5 text-xs",title:h.model,children:[n("span",{className:u("relative flex size-6 shrink-0 items-center justify-center rounded-full bg-raised ring-2",z.ring),children:[e(d,{modelID:h.model,className:"size-3.5",size:14}),R&&e(K,{className:"absolute -right-1 -bottom-1 size-3 animate-spin rounded-full bg-panel text-accent"})]}),e("span",{className:"truncate text-dim",children:h.name}),e("span",{className:u("shrink-0 text-[11px]",z.text),children:z.label})]},h.id)})}),n("div",{className:"mt-3 flex items-center gap-2 border-t border-line/70 px-4 py-2.5 text-xs",children:[D?n(f,{children:[e("span",{className:"shrink-0 font-medium text-dim",children:D.senderName}),e("span",{className:"min-w-0 flex-1 truncate text-faint",children:D.text.replace(/\s+/g," ")})]}):e("span",{className:"min-w-0 flex-1 truncate text-faint",children:I?`${B} 位成员正在${m.phase==="research"?"调研":"思考"}…`:"没有发言"}),n("span",{className:"inline-flex shrink-0 items-center gap-1 text-faint transition-colors group-hover:text-ink",children:[m.messages.length>0&&n("span",{className:"tabular-nums",children:[m.messages.length," 条"]}),e(ne,{className:"size-3.5"})]})]})]}),w&&e(oe,{room:m,elapsedMs:E,onClose:()=>M(!1),onOpenMember:c,onPost:S,onAbort:H})]})}export{Je as CouncilCard};
@@ -0,0 +1 @@
1
+ import{Li}from"./chunk-n9v14vyd.js";export{Li as createTreeViewServices};
@@ -1,10 +1,10 @@
1
- import{t,b,yt,C,S,E,T,A,L,R,l,Cn,p,ae,Un,vo,Oa,$a,qn}from"./chunk-e763h2px.js";import{Pn,mn}from"./chunk-2weaa3gn.js";import{Ke}from"./chunk-j4gvtszc.js";function nt(n,c){let y=0;if(c===void 0){for(let g of n)if(g=+g)y+=g}else{let g=-1;for(let _ of n)if(_=+c(_,++g,n))y+=_}return y}function ht(n){var c=n.length/6|0,y=Array(c),g=0;while(g<c)y[g]="#"+n.slice(g*6,++g*6);return y}var dt=ht("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Et(n){return n.source}function Pt(n){return n.target}function At(n){let c=Et,y=Pt,g=Oa,_=$a,P=null,m=null,G=Un(i);function i(){let o,f=vo.call(arguments),v=c.apply(this,f),x=y.apply(this,f);if(P==null)m=n(o=G());if(m.lineStart(),f[0]=v,m.point(+g.apply(this,f),+_.apply(this,f)),f[0]=x,m.point(+g.apply(this,f),+_.apply(this,f)),m.lineEnd(),o)return m=null,o+""||null}return i.source=function(o){return arguments.length?(c=o,i):c},i.target=function(o){return arguments.length?(y=o,i):y},i.x=function(o){return arguments.length?(g=typeof o==="function"?o:ae(+o),i):g},i.y=function(o){return arguments.length?(_=typeof o==="function"?o:ae(+o),i):_},i.context=function(o){return arguments.length?(o==null?P=m=null:m=n(P=o),i):P},i}function bt(){return At(qn)}function Tt(n){return n.target.depth}function pt(n){return n.depth}function mt(n,c){return c-1-n.height}function rt(n,c){return n.sourceLinks.length?n.depth:c-1}function gt(n){return n.targetLinks.length?n.depth:n.sourceLinks.length?mn(n.sourceLinks,Tt)-1:0}function tt(n){return function(){return n}}function vt(n,c){return st(n.source,c.source)||n.index-c.index}function _t(n,c){return st(n.target,c.target)||n.index-c.index}function st(n,c){return n.y0-c.y0}function xt(n){return n.value}function Ct(n){return n.index}function Bt(n){return n.nodes}function Ot(n){return n.links}function St(n,c){let y=n.get(c);if(!y)throw Error("missing: "+c);return y}function wt({nodes:n}){for(let c of n){let y=c.y0,g=y;for(let _ of c.sourceLinks)_.y0=y+_.width/2,y+=_.width;for(let _ of c.targetLinks)_.y1=g+_.width/2,g+=_.width}}function ot(){let n=0,c=0,y=1,g=1,_=24,P=8,m,G=Ct,i=rt,o,f,v=Bt,x=Ot,h=6;function w(){let e={nodes:v.apply(null,arguments),links:x.apply(null,arguments)};return I(e),M(e),W(e),U(e),z(e),wt(e),e}w.update=function(e){return wt(e),e},w.nodeId=function(e){return arguments.length?(G=typeof e==="function"?e:tt(e),w):G},w.nodeAlign=function(e){return arguments.length?(i=typeof e==="function"?e:tt(e),w):i},w.nodeSort=function(e){return arguments.length?(o=e,w):o},w.nodeWidth=function(e){return arguments.length?(_=+e,w):_},w.nodePadding=function(e){return arguments.length?(P=m=+e,w):P},w.nodes=function(e){return arguments.length?(v=typeof e==="function"?e:tt(e),w):v},w.links=function(e){return arguments.length?(x=typeof e==="function"?e:tt(e),w):x},w.linkSort=function(e){return arguments.length?(f=e,w):f},w.size=function(e){return arguments.length?(n=c=0,y=+e[0],g=+e[1],w):[y-n,g-c]},w.extent=function(e){return arguments.length?(n=+e[0][0],y=+e[1][0],c=+e[0][1],g=+e[1][1],w):[[n,c],[y,g]]},w.iterations=function(e){return arguments.length?(h=+e,w):h};function I({nodes:e,links:a}){for(let[r,s]of e.entries())s.index=r,s.sourceLinks=[],s.targetLinks=[];let u=new Map(e.map((r,s)=>[G(r,s,e),r]));for(let[r,s]of a.entries()){s.index=r;let{source:d,target:k}=s;if(typeof d!=="object")d=s.source=St(u,d);if(typeof k!=="object")k=s.target=St(u,k);d.sourceLinks.push(s),k.targetLinks.push(s)}if(f!=null)for(let{sourceLinks:r,targetLinks:s}of e)r.sort(f),s.sort(f)}function M({nodes:e}){for(let a of e)a.value=a.fixedValue===void 0?Math.max(nt(a.sourceLinks,xt),nt(a.targetLinks,xt)):a.fixedValue}function W({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.depth=s;for(let{target:k}of d.sourceLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function U({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.height=s;for(let{source:k}of d.targetLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function Q({nodes:e}){let a=Pn(e,(s)=>s.depth)+1,u=(y-n-_)/(a-1),r=Array(a);for(let s of e){let d=Math.max(0,Math.min(a-1,Math.floor(i.call(null,s,a))));if(s.layer=d,s.x0=n+d*u,s.x1=s.x0+_,r[d])r[d].push(s);else r[d]=[s]}if(o)for(let s of r)s.sort(o);return r}function q(e){let a=mn(e,(u)=>(g-c-(u.length-1)*m)/nt(u,xt));for(let u of e){let r=c;for(let s of u){s.y0=r,s.y1=r+s.value*a,r=s.y1+m;for(let d of s.sourceLinks)d.width=d.value*a}r=(g-r+m)/(u.length+1);for(let s=0;s<u.length;++s){let d=u[s];d.y0+=r*(s+1),d.y1+=r*(s+1)}K(u)}}function z(e){let a=Q(e);m=Math.min(P,(g-c)/(Pn(a,(u)=>u.length)-1)),q(a);for(let u=0;u<h;++u){let r=Math.pow(0.99,u),s=Math.max(1-r,(u+1)/h);D(a,r,s),B(a,r,s)}}function B(e,a,u){for(let r=1,s=e.length;r<s;++r){let d=e[r];for(let k of d){let J=0,Y=0;for(let{source:N,value:ft}of k.targetLinks){let et=ft*(k.layer-N.layer);J+=O(N,k)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function D(e,a,u){for(let r=e.length,s=r-2;s>=0;--s){let d=e[s];for(let k of d){let J=0,Y=0;for(let{target:N,value:ft}of k.sourceLinks){let et=ft*(N.layer-k.layer);J+=V(k,N)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function H(e,a){let u=e.length>>1,r=e[u];j(e,r.y0-m,u-1,a),X(e,r.y1+m,u+1,a),j(e,g,e.length-1,a),X(e,c,0,a)}function X(e,a,u,r){for(;u<e.length;++u){let s=e[u],d=(a-s.y0)*r;if(d>0.000001)s.y0+=d,s.y1+=d;a=s.y1+m}}function j(e,a,u,r){for(;u>=0;--u){let s=e[u],d=(s.y1-a)*r;if(d>0.000001)s.y0-=d,s.y1-=d;a=s.y0-m}}function Z({sourceLinks:e,targetLinks:a}){if(f===void 0){for(let{source:{sourceLinks:u}}of a)u.sort(_t);for(let{target:{targetLinks:u}}of e)u.sort(vt)}}function K(e){if(f===void 0)for(let{sourceLinks:a,targetLinks:u}of e)a.sort(_t),u.sort(vt)}function O(e,a){let u=e.y0-(e.sourceLinks.length-1)*m/2;for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u+=s+m}for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u-=s}return u}function V(e,a){let u=a.y0-(a.targetLinks.length-1)*m/2;for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u+=s+m}for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u-=s}return u}return w}function Rt(n){return[n.source.x1,n.y0]}function Nt(n){return[n.target.x0,n.y1]}function it(){return bt().source(Rt).target(Nt)}var kt=function(){var n=t(function(G,i,o,f){for(o=o||{},f=G.length;f--;o[G[f]]=i);return o},"o"),c=[1,9],y=[1,10],g=[1,5,10,12],_={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:t(function(i,o,f,v,x,h,w){var I=h.length-1;switch(x){case 7:let M=v.findOrCreateNode(h[I-4].trim().replaceAll('""','"')),W=v.findOrCreateNode(h[I-2].trim().replaceAll('""','"')),U=parseFloat(h[I].trim());v.addLink(M,W,U);break;case 8:case 9:case 11:this.$=h[I];break;case 10:this.$=h[I-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:c,20:y},{1:[2,6],7:11,10:[1,12]},n(y,[2,4],{9:13,5:[1,14]}),{12:[1,15]},n(g,[2,8]),n(g,[2,9]),{19:[1,16]},n(g,[2,11]),{1:[2,1]},{1:[2,5]},n(y,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:c,20:y},{15:18,16:7,17:8,18:c,20:y},{18:[1,19]},n(y,[2,3]),{12:[1,20]},n(g,[2,10]),{15:21,16:7,17:8,18:c,20:y},n([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:t(function(i,o){if(o.recoverable)this.trace(i);else{var f=Error(i);throw f.hash=o,f}},"parseError"),parse:t(function(i){var o=this,f=[0],v=[],x=[null],h=[],w=this.table,I="",M=0,W=0,U=0,Q=2,q=1,z=h.slice.call(arguments,1),B=Object.create(this.lexer),D={yy:{}};for(var H in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,H))D.yy[H]=this.yy[H];if(B.setInput(i,D.yy),D.yy.lexer=B,D.yy.parser=this,typeof B.yylloc>"u")B.yylloc={};var X=B.yylloc;h.push(X);var j=B.options&&B.options.ranges;if(typeof D.yy.parseError==="function")this.parseError=D.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Z(N){f.length=f.length-2*N,x.length=x.length-N,h.length=h.length-N}t(Z,"popStack");function K(){var N=v.pop()||B.lex()||q;if(typeof N!=="number"){if(N instanceof Array)v=N,N=v.pop();N=o.symbols_[N]||N}return N}t(K,"lex");var O,V,e,a,u,r,s={},d,k,J,Y;while(!0){if(e=f[f.length-1],this.defaultActions[e])a=this.defaultActions[e];else{if(O===null||typeof O>"u")O=K();a=w[e]&&w[e][O]}if(typeof a>"u"||!a.length||!a[0]){var F="";Y=[];for(d in w[e])if(this.terminals_[d]&&d>Q)Y.push("'"+this.terminals_[d]+"'");if(B.showPosition)F="Parse error on line "+(M+1)+`:
1
+ import{t,b,gt,C,S,E,T,A,L,R,l,Tn,p,ae,qn,vo,Oa,$a,Wn}from"./chunk-b5zf1hs3.js";import{$n,hn}from"./chunk-y2rzeb4v.js";import{Qe}from"./chunk-1zwc09e8.js";function nt(n,c){let y=0;if(c===void 0){for(let g of n)if(g=+g)y+=g}else{let g=-1;for(let _ of n)if(_=+c(_,++g,n))y+=_}return y}function ht(n){var c=n.length/6|0,y=Array(c),g=0;while(g<c)y[g]="#"+n.slice(g*6,++g*6);return y}var dt=ht("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Et(n){return n.source}function Pt(n){return n.target}function At(n){let c=Et,y=Pt,g=Oa,_=$a,P=null,m=null,G=qn(i);function i(){let o,f=vo.call(arguments),v=c.apply(this,f),x=y.apply(this,f);if(P==null)m=n(o=G());if(m.lineStart(),f[0]=v,m.point(+g.apply(this,f),+_.apply(this,f)),f[0]=x,m.point(+g.apply(this,f),+_.apply(this,f)),m.lineEnd(),o)return m=null,o+""||null}return i.source=function(o){return arguments.length?(c=o,i):c},i.target=function(o){return arguments.length?(y=o,i):y},i.x=function(o){return arguments.length?(g=typeof o==="function"?o:ae(+o),i):g},i.y=function(o){return arguments.length?(_=typeof o==="function"?o:ae(+o),i):_},i.context=function(o){return arguments.length?(o==null?P=m=null:m=n(P=o),i):P},i}function bt(){return At(Wn)}function Tt(n){return n.target.depth}function pt(n){return n.depth}function yt(n,c){return c-1-n.height}function rt(n,c){return n.sourceLinks.length?n.depth:c-1}function mt(n){return n.targetLinks.length?n.depth:n.sourceLinks.length?hn(n.sourceLinks,Tt)-1:0}function tt(n){return function(){return n}}function vt(n,c){return st(n.source,c.source)||n.index-c.index}function _t(n,c){return st(n.target,c.target)||n.index-c.index}function st(n,c){return n.y0-c.y0}function xt(n){return n.value}function Ct(n){return n.index}function Bt(n){return n.nodes}function Ot(n){return n.links}function St(n,c){let y=n.get(c);if(!y)throw Error("missing: "+c);return y}function wt({nodes:n}){for(let c of n){let y=c.y0,g=y;for(let _ of c.sourceLinks)_.y0=y+_.width/2,y+=_.width;for(let _ of c.targetLinks)_.y1=g+_.width/2,g+=_.width}}function ot(){let n=0,c=0,y=1,g=1,_=24,P=8,m,G=Ct,i=rt,o,f,v=Bt,x=Ot,h=6;function w(){let e={nodes:v.apply(null,arguments),links:x.apply(null,arguments)};return I(e),M(e),W(e),U(e),z(e),wt(e),e}w.update=function(e){return wt(e),e},w.nodeId=function(e){return arguments.length?(G=typeof e==="function"?e:tt(e),w):G},w.nodeAlign=function(e){return arguments.length?(i=typeof e==="function"?e:tt(e),w):i},w.nodeSort=function(e){return arguments.length?(o=e,w):o},w.nodeWidth=function(e){return arguments.length?(_=+e,w):_},w.nodePadding=function(e){return arguments.length?(P=m=+e,w):P},w.nodes=function(e){return arguments.length?(v=typeof e==="function"?e:tt(e),w):v},w.links=function(e){return arguments.length?(x=typeof e==="function"?e:tt(e),w):x},w.linkSort=function(e){return arguments.length?(f=e,w):f},w.size=function(e){return arguments.length?(n=c=0,y=+e[0],g=+e[1],w):[y-n,g-c]},w.extent=function(e){return arguments.length?(n=+e[0][0],y=+e[1][0],c=+e[0][1],g=+e[1][1],w):[[n,c],[y,g]]},w.iterations=function(e){return arguments.length?(h=+e,w):h};function I({nodes:e,links:a}){for(let[r,s]of e.entries())s.index=r,s.sourceLinks=[],s.targetLinks=[];let u=new Map(e.map((r,s)=>[G(r,s,e),r]));for(let[r,s]of a.entries()){s.index=r;let{source:d,target:k}=s;if(typeof d!=="object")d=s.source=St(u,d);if(typeof k!=="object")k=s.target=St(u,k);d.sourceLinks.push(s),k.targetLinks.push(s)}if(f!=null)for(let{sourceLinks:r,targetLinks:s}of e)r.sort(f),s.sort(f)}function M({nodes:e}){for(let a of e)a.value=a.fixedValue===void 0?Math.max(nt(a.sourceLinks,xt),nt(a.targetLinks,xt)):a.fixedValue}function W({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.depth=s;for(let{target:k}of d.sourceLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function U({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.height=s;for(let{source:k}of d.targetLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function Q({nodes:e}){let a=$n(e,(s)=>s.depth)+1,u=(y-n-_)/(a-1),r=Array(a);for(let s of e){let d=Math.max(0,Math.min(a-1,Math.floor(i.call(null,s,a))));if(s.layer=d,s.x0=n+d*u,s.x1=s.x0+_,r[d])r[d].push(s);else r[d]=[s]}if(o)for(let s of r)s.sort(o);return r}function q(e){let a=hn(e,(u)=>(g-c-(u.length-1)*m)/nt(u,xt));for(let u of e){let r=c;for(let s of u){s.y0=r,s.y1=r+s.value*a,r=s.y1+m;for(let d of s.sourceLinks)d.width=d.value*a}r=(g-r+m)/(u.length+1);for(let s=0;s<u.length;++s){let d=u[s];d.y0+=r*(s+1),d.y1+=r*(s+1)}K(u)}}function z(e){let a=Q(e);m=Math.min(P,(g-c)/($n(a,(u)=>u.length)-1)),q(a);for(let u=0;u<h;++u){let r=Math.pow(0.99,u),s=Math.max(1-r,(u+1)/h);D(a,r,s),B(a,r,s)}}function B(e,a,u){for(let r=1,s=e.length;r<s;++r){let d=e[r];for(let k of d){let J=0,Y=0;for(let{source:N,value:ft}of k.targetLinks){let et=ft*(k.layer-N.layer);J+=O(N,k)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function D(e,a,u){for(let r=e.length,s=r-2;s>=0;--s){let d=e[s];for(let k of d){let J=0,Y=0;for(let{target:N,value:ft}of k.sourceLinks){let et=ft*(N.layer-k.layer);J+=V(k,N)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function H(e,a){let u=e.length>>1,r=e[u];j(e,r.y0-m,u-1,a),X(e,r.y1+m,u+1,a),j(e,g,e.length-1,a),X(e,c,0,a)}function X(e,a,u,r){for(;u<e.length;++u){let s=e[u],d=(a-s.y0)*r;if(d>0.000001)s.y0+=d,s.y1+=d;a=s.y1+m}}function j(e,a,u,r){for(;u>=0;--u){let s=e[u],d=(s.y1-a)*r;if(d>0.000001)s.y0-=d,s.y1-=d;a=s.y0-m}}function Z({sourceLinks:e,targetLinks:a}){if(f===void 0){for(let{source:{sourceLinks:u}}of a)u.sort(_t);for(let{target:{targetLinks:u}}of e)u.sort(vt)}}function K(e){if(f===void 0)for(let{sourceLinks:a,targetLinks:u}of e)a.sort(_t),u.sort(vt)}function O(e,a){let u=e.y0-(e.sourceLinks.length-1)*m/2;for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u+=s+m}for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u-=s}return u}function V(e,a){let u=a.y0-(a.targetLinks.length-1)*m/2;for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u+=s+m}for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u-=s}return u}return w}function Rt(n){return[n.source.x1,n.y0]}function Nt(n){return[n.target.x0,n.y1]}function it(){return bt().source(Rt).target(Nt)}var kt=function(){var n=t(function(G,i,o,f){for(o=o||{},f=G.length;f--;o[G[f]]=i);return o},"o"),c=[1,9],y=[1,10],g=[1,5,10,12],_={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:t(function(i,o,f,v,x,h,w){var I=h.length-1;switch(x){case 7:let M=v.findOrCreateNode(h[I-4].trim().replaceAll('""','"')),W=v.findOrCreateNode(h[I-2].trim().replaceAll('""','"')),U=parseFloat(h[I].trim());v.addLink(M,W,U);break;case 8:case 9:case 11:this.$=h[I];break;case 10:this.$=h[I-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:c,20:y},{1:[2,6],7:11,10:[1,12]},n(y,[2,4],{9:13,5:[1,14]}),{12:[1,15]},n(g,[2,8]),n(g,[2,9]),{19:[1,16]},n(g,[2,11]),{1:[2,1]},{1:[2,5]},n(y,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:c,20:y},{15:18,16:7,17:8,18:c,20:y},{18:[1,19]},n(y,[2,3]),{12:[1,20]},n(g,[2,10]),{15:21,16:7,17:8,18:c,20:y},n([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:t(function(i,o){if(o.recoverable)this.trace(i);else{var f=Error(i);throw f.hash=o,f}},"parseError"),parse:t(function(i){var o=this,f=[0],v=[],x=[null],h=[],w=this.table,I="",M=0,W=0,U=0,Q=2,q=1,z=h.slice.call(arguments,1),B=Object.create(this.lexer),D={yy:{}};for(var H in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,H))D.yy[H]=this.yy[H];if(B.setInput(i,D.yy),D.yy.lexer=B,D.yy.parser=this,typeof B.yylloc>"u")B.yylloc={};var X=B.yylloc;h.push(X);var j=B.options&&B.options.ranges;if(typeof D.yy.parseError==="function")this.parseError=D.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Z(N){f.length=f.length-2*N,x.length=x.length-N,h.length=h.length-N}t(Z,"popStack");function K(){var N=v.pop()||B.lex()||q;if(typeof N!=="number"){if(N instanceof Array)v=N,N=v.pop();N=o.symbols_[N]||N}return N}t(K,"lex");var O,V,e,a,u,r,s={},d,k,J,Y;while(!0){if(e=f[f.length-1],this.defaultActions[e])a=this.defaultActions[e];else{if(O===null||typeof O>"u")O=K();a=w[e]&&w[e][O]}if(typeof a>"u"||!a.length||!a[0]){var F="";Y=[];for(d in w[e])if(this.terminals_[d]&&d>Q)Y.push("'"+this.terminals_[d]+"'");if(B.showPosition)F="Parse error on line "+(M+1)+`:
2
2
  `+B.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[O]||O)+"'";else F="Parse error on line "+(M+1)+": Unexpected "+(O==q?"end of input":"'"+(this.terminals_[O]||O)+"'");this.parseError(F,{text:B.match,token:this.terminals_[O]||O,line:B.yylineno,loc:X,expected:Y})}if(a[0]instanceof Array&&a.length>1)throw Error("Parse Error: multiple actions possible at state: "+e+", token: "+O);switch(a[0]){case 1:if(f.push(O),x.push(B.yytext),h.push(B.yylloc),f.push(a[1]),O=null,!V){if(W=B.yyleng,I=B.yytext,M=B.yylineno,X=B.yylloc,U>0)U--}else O=V,V=null;break;case 2:if(k=this.productions_[a[1]][1],s.$=x[x.length-k],s._$={first_line:h[h.length-(k||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(k||1)].first_column,last_column:h[h.length-1].last_column},j)s._$.range=[h[h.length-(k||1)].range[0],h[h.length-1].range[1]];if(r=this.performAction.apply(s,[I,W,M,D.yy,a[1],x,h].concat(z)),typeof r<"u")return r;if(k)f=f.slice(0,-1*k*2),x=x.slice(0,-1*k),h=h.slice(0,-1*k);f.push(this.productions_[a[1]][0]),x.push(s.$),h.push(s._$),J=w[f[f.length-2]][f[f.length-1]],f.push(J);break;case 3:return!0}}return!0},"parse")},P=function(){var G={EOF:1,parseError:t(function(o,f){if(this.yy.parser)this.yy.parser.parseError(o,f);else throw Error(o)},"parseError"),setInput:t(function(i,o){if(this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);if(o)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var o=i.length,f=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var v=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var x=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===v.length?this.yylloc.first_column:0)+v[v.length-f.length].length-f[0].length:this.yylloc.first_column-o},this.options.ranges)this.yylloc.range=[x[0],x[0]+this.yyleng-o];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),o=Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
5
  `+o+"^"},"showPosition"),test_match:t(function(i,o){var f,v,x;if(this.options.backtrack_lexer){if(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)x.yylloc.range=this.yylloc.range.slice(0)}if(v=i[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],f=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var h in x)this[h]=x[h];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,o,f,v;if(!this._more)this.yytext="",this.match="";var x=this._currentRules();for(var h=0;h<x.length;h++)if(f=this._input.match(this.rules[x[h]]),f&&(!o||f[0].length>o[0].length)){if(o=f,v=h,this.options.backtrack_lexer)if(i=this.test_match(f,x[h]),i!==!1)return i;else if(this._backtrack){o=!1;continue}else return!1;else if(!this.options.flex)break}if(o){if(i=this.test_match(o,x[v]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:t(function(o){this.conditionStack.push(o)},"begin"),popState:t(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:t(function(o){this.begin(o)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(o,f,v,x){var h=x;switch(v){case 0:return this.pushState("csv"),4;break;case 1:return this.pushState("csv"),4;break;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;break;case 6:return 20;case 7:return this.popState("escaped_text"),18;break;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return G}();_.lexer=P;function m(){this.yy={}}return t(m,"Parser"),m.prototype=_,_.Parser=m,new m}();kt.parser=kt;var at=kt,ct=[],ut=[],lt=new Map,Gt=t(()=>{ct=[],ut=[],lt=new Map,C()},"clear"),It=class{constructor(n,c,y=0){this.source=n,this.target=c,this.value=y}static{t(this,"SankeyLink")}},Mt=t((n,c,y)=>{ct.push(new It(n,c,y))},"addLink"),Yt=class{constructor(n){this.ID=n}static{t(this,"SankeyNode")}},Dt=t((n)=>{n=b.sanitizeText(n,l());let c=lt.get(n);if(c===void 0)c=new Yt(n),lt.set(n,c),ut.push(c);return c},"findOrCreateNode"),jt=t(()=>ut,"getNodes"),$t=t(()=>ct,"getLinks"),zt=t(()=>({nodes:ut.map((n)=>({id:n.ID})),links:ct.map((n)=>({source:n.source.ID,target:n.target.ID,value:n.value}))}),"getGraph"),Vt={nodesMap:lt,getConfig:t(()=>l().sankey,"getConfig"),getNodes:jt,getLinks:$t,getGraph:zt,addLink:Mt,findOrCreateNode:Dt,getAccTitle:E,setAccTitle:S,getAccDescription:A,setAccDescription:T,getDiagramTitle:R,setDiagramTitle:L,clear:Gt},Lt=class n{static{t(this,"Uid")}static{this.count=0}static next(c){return new n(c+ ++n.count)}constructor(c){this.id=c,this.href=`#${c}`}toString(){return"url("+this.href+")"}},Ft={left:pt,right:mt,center:gt,justify:rt},Wt=t((n)=>{let c=0,y=0;for(let g of n){let _=g.value??0;if(_>c)c=_,y=g.layer??0}return y},"findCentralNodeLayer"),Ut=t(function(n,c,y,g){let{securityLevel:_,sankey:P}=l(),m=Cn.sankey,G;if(_==="sandbox")G=p("#i"+c);let i=_==="sandbox"?p(G.nodes()[0].contentDocument.body):p("body"),o=_==="sandbox"?i.select(`[id="${c}"]`):p(`[id="${c}"]`),f=P?.width??m.width,v=P?.height??m.width,x=P?.useMaxWidth??m.useMaxWidth,h=P?.nodeAlignment??m.nodeAlignment,w=P?.prefix??m.prefix,I=P?.suffix??m.suffix,M=P?.showValues??m.showValues,W=P?.nodeWidth??m.nodeWidth??10,U=P?.nodePadding??m.nodePadding??12,Q=P?.labelStyle??m.labelStyle??"legacy",q=P?.nodeColors??{},z=g.db.getGraph(),B=Ft[h];ot().nodeId((r)=>r.id).nodeWidth(W).nodePadding(U+(M?15:0)).nodeAlign(B).extent([[0,0],[f,v]])(z);let H=Wt(z.nodes),X=Ke(dt),j=t((r)=>q[r]??X(r),"getNodeColor");o.append("g").attr("class","nodes").selectAll(".node").data(z.nodes).join("g").attr("class","node").attr("id",(r)=>(r.uid=Lt.next("node-")).id).attr("transform",function(r){return"translate("+r.x0+","+r.y0+")"}).attr("x",(r)=>r.x0).attr("y",(r)=>r.y0).append("rect").attr("height",(r)=>r.y1-r.y0).attr("width",(r)=>r.x1-r.x0).attr("fill",(r)=>j(r.id));let Z=t(({id:r,value:s})=>{if(!M)return r;return`${r}
7
- ${w}${Math.round(s*100)/100}${I}`},"getText"),K=t((r)=>{if(Q==="outlined"){if((r.layer??0)<H)return{x:r.x0-6,anchor:"end"};return{x:r.x1+6,anchor:"start"}}if(r.x0<f/2)return{x:r.x1+6,anchor:"start"};return{x:r.x0-6,anchor:"end"}},"getLabelPosition"),O=o.append("g").attr("class","node-labels").attr("font-size",14),V=t((r)=>O.selectAll(r?`.${r}`:"text").data(z.nodes).join("text").attr("class",r??null).attr("x",(s)=>K(s).x).attr("y",(s)=>(s.y1+s.y0)/2).attr("dy",`${M?"0":"0.35"}em`).attr("text-anchor",(s)=>K(s).anchor).text(Z),"appendLabel");if(Q==="outlined")V("sankey-label-bg"),V("sankey-label-fg");else V();let e=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",0.5).selectAll(".link").data(z.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),a=P?.linkColor??"gradient";if(a==="gradient"){let r=e.append("linearGradient").attr("id",(s)=>(s.uid=Lt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",(s)=>s.source.x1).attr("x2",(s)=>s.target.x0);r.append("stop").attr("offset","0%").attr("stop-color",(s)=>j(s.source.id)),r.append("stop").attr("offset","100%").attr("stop-color",(s)=>j(s.target.id))}let u;switch(a){case"gradient":u=t((r)=>r.uid,"coloring");break;case"source":u=t((r)=>j(r.source.id),"coloring");break;case"target":u=t((r)=>j(r.target.id),"coloring");break;default:u=a}e.append("path").attr("d",it()).attr("stroke",u).attr("stroke-width",(r)=>Math.max(1,r.width)),yt(void 0,o,0,x)},"draw"),Ht={draw:Ut},Xt=t((n)=>n.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:t(function(o){this.conditionStack.push(o)},"begin"),popState:t(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:t(function(o){this.begin(o)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(o,f,v,x){var h=x;switch(v){case 0:return this.pushState("csv"),4;break;case 1:return this.pushState("csv"),4;break;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;break;case 6:return 20;case 7:return this.popState("escaped_text"),18;break;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return G}();_.lexer=P;function m(){this.yy={}}return t(m,"Parser"),m.prototype=_,_.Parser=m,new m}();kt.parser=kt;var at=kt,ct=[],ut=[],lt=new Map,Gt=t(()=>{ct=[],ut=[],lt=new Map,C()},"clear"),It=class{constructor(n,c,y=0){this.source=n,this.target=c,this.value=y}static{t(this,"SankeyLink")}},Mt=t((n,c,y)=>{ct.push(new It(n,c,y))},"addLink"),Yt=class{constructor(n){this.ID=n}static{t(this,"SankeyNode")}},Dt=t((n)=>{n=b.sanitizeText(n,l());let c=lt.get(n);if(c===void 0)c=new Yt(n),lt.set(n,c),ut.push(c);return c},"findOrCreateNode"),jt=t(()=>ut,"getNodes"),$t=t(()=>ct,"getLinks"),zt=t(()=>({nodes:ut.map((n)=>({id:n.ID})),links:ct.map((n)=>({source:n.source.ID,target:n.target.ID,value:n.value}))}),"getGraph"),Vt={nodesMap:lt,getConfig:t(()=>l().sankey,"getConfig"),getNodes:jt,getLinks:$t,getGraph:zt,addLink:Mt,findOrCreateNode:Dt,getAccTitle:E,setAccTitle:S,getAccDescription:A,setAccDescription:T,getDiagramTitle:R,setDiagramTitle:L,clear:Gt},Lt=class n{static{t(this,"Uid")}static{this.count=0}static next(c){return new n(c+ ++n.count)}constructor(c){this.id=c,this.href=`#${c}`}toString(){return"url("+this.href+")"}},Ft={left:pt,right:yt,center:mt,justify:rt},Wt=t((n)=>{let c=0,y=0;for(let g of n){let _=g.value??0;if(_>c)c=_,y=g.layer??0}return y},"findCentralNodeLayer"),Ut=t(function(n,c,y,g){let{securityLevel:_,sankey:P}=l(),m=Tn.sankey,G;if(_==="sandbox")G=p("#i"+c);let i=_==="sandbox"?p(G.nodes()[0].contentDocument.body):p("body"),o=_==="sandbox"?i.select(`[id="${c}"]`):p(`[id="${c}"]`),f=P?.width??m.width,v=P?.height??m.width,x=P?.useMaxWidth??m.useMaxWidth,h=P?.nodeAlignment??m.nodeAlignment,w=P?.prefix??m.prefix,I=P?.suffix??m.suffix,M=P?.showValues??m.showValues,W=P?.nodeWidth??m.nodeWidth??10,U=P?.nodePadding??m.nodePadding??12,Q=P?.labelStyle??m.labelStyle??"legacy",q=P?.nodeColors??{},z=g.db.getGraph(),B=Ft[h];ot().nodeId((r)=>r.id).nodeWidth(W).nodePadding(U+(M?15:0)).nodeAlign(B).extent([[0,0],[f,v]])(z);let H=Wt(z.nodes),X=Qe(dt),j=t((r)=>q[r]??X(r),"getNodeColor");o.append("g").attr("class","nodes").selectAll(".node").data(z.nodes).join("g").attr("class","node").attr("id",(r)=>(r.uid=Lt.next("node-")).id).attr("transform",function(r){return"translate("+r.x0+","+r.y0+")"}).attr("x",(r)=>r.x0).attr("y",(r)=>r.y0).append("rect").attr("height",(r)=>r.y1-r.y0).attr("width",(r)=>r.x1-r.x0).attr("fill",(r)=>j(r.id));let Z=t(({id:r,value:s})=>{if(!M)return r;return`${r}
7
+ ${w}${Math.round(s*100)/100}${I}`},"getText"),K=t((r)=>{if(Q==="outlined"){if((r.layer??0)<H)return{x:r.x0-6,anchor:"end"};return{x:r.x1+6,anchor:"start"}}if(r.x0<f/2)return{x:r.x1+6,anchor:"start"};return{x:r.x0-6,anchor:"end"}},"getLabelPosition"),O=o.append("g").attr("class","node-labels").attr("font-size",14),V=t((r)=>O.selectAll(r?`.${r}`:"text").data(z.nodes).join("text").attr("class",r??null).attr("x",(s)=>K(s).x).attr("y",(s)=>(s.y1+s.y0)/2).attr("dy",`${M?"0":"0.35"}em`).attr("text-anchor",(s)=>K(s).anchor).text(Z),"appendLabel");if(Q==="outlined")V("sankey-label-bg"),V("sankey-label-fg");else V();let e=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",0.5).selectAll(".link").data(z.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),a=P?.linkColor??"gradient";if(a==="gradient"){let r=e.append("linearGradient").attr("id",(s)=>(s.uid=Lt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",(s)=>s.source.x1).attr("x2",(s)=>s.target.x0);r.append("stop").attr("offset","0%").attr("stop-color",(s)=>j(s.source.id)),r.append("stop").attr("offset","100%").attr("stop-color",(s)=>j(s.target.id))}let u;switch(a){case"gradient":u=t((r)=>r.uid,"coloring");break;case"source":u=t((r)=>j(r.source.id),"coloring");break;case"target":u=t((r)=>j(r.target.id),"coloring");break;default:u=a}e.append("path").attr("d",it()).attr("stroke",u).attr("stroke-width",(r)=>Math.max(1,r.width)),gt(void 0,o,0,x)},"draw"),Ht={draw:Ut},Xt=t((n)=>n.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
8
  `).trim(),"prepareTextForParsing"),Jt=t((n)=>`.label {
9
9
  font-family: ${n.fontFamily};
10
10
  }