@bkm016/basalt 0.1.8 → 0.1.10

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 (258) hide show
  1. package/{chunk-0039s4jt.js → chunk-02d3x4mj.js} +3 -3
  2. package/{chunk-ky55taar.js → chunk-0mjb3sm3.js} +327 -316
  3. package/{chunk-ckjw3b61.js → chunk-13gvs0ax.js} +2 -2
  4. package/{chunk-0d51ggzj.js → chunk-1n7dat03.js} +4 -4
  5. package/{chunk-ppxv5q7y.js → chunk-1zj3zvw5.js} +3 -3
  6. package/{chunk-2ek3wq4b.js → chunk-29qrxygd.js} +1 -1
  7. package/{chunk-7p6e2f5s.js → chunk-30rjf7my.js} +3 -3
  8. package/{chunk-v2srrqcv.js → chunk-38g3gctw.js} +2 -2
  9. package/chunk-3mqf9ped.js +479 -0
  10. package/{chunk-3j2kkgsc.js → chunk-4dw43syb.js} +1 -1
  11. package/{chunk-t66jqz12.js → chunk-4gtgqcct.js} +2 -2
  12. package/{chunk-qmdpgbg3.js → chunk-755sy11p.js} +1 -1
  13. package/{chunk-n015c8nx.js → chunk-7zkswxvk.js} +1 -1
  14. package/{chunk-91r5nvth.js → chunk-82v8jh1h.js} +2 -2
  15. package/{chunk-12trygzx.js → chunk-95964592.js} +16 -16
  16. package/{chunk-nmtk9xra.js → chunk-9as0p561.js} +2 -2
  17. package/{chunk-pn413hjw.js → chunk-a1352w87.js} +1 -1
  18. package/{chunk-rnt1ckk9.js → chunk-a1rb1a48.js} +5 -5
  19. package/{chunk-fzcmzbsq.js → chunk-a98wma9j.js} +1 -1
  20. package/{chunk-kgkrccr1.js → chunk-asyr3gnq.js} +2 -2
  21. package/{chunk-5gxj9560.js → chunk-ax04trym.js} +1 -1
  22. package/chunk-b2bxqeb4.js +2 -0
  23. package/{chunk-xjw78yey.js → chunk-bdjr0kfr.js} +4 -4
  24. package/{chunk-7kjr9gdx.js → chunk-bk4rpnm8.js} +2 -2
  25. package/{chunk-47vf66t6.js → chunk-c0zfefq8.js} +1 -1
  26. package/{chunk-kpvaqb7c.js → chunk-c6q04xrd.js} +2 -2
  27. package/chunk-c71173py.js +25 -0
  28. package/{chunk-adys4qq4.js → chunk-cmwdjes8.js} +5 -5
  29. package/{chunk-dcwdmpw2.js → chunk-d0a1jxk5.js} +1 -1
  30. package/{chunk-2nrkqq45.js → chunk-d5j74pcp.js} +7 -7
  31. package/{chunk-pkpj7s2k.js → chunk-dfh9m9n7.js} +1 -1
  32. package/{chunk-26cz8et8.js → chunk-dq01v5eq.js} +1 -1
  33. package/{chunk-fpxc6qjr.js → chunk-e1x629v0.js} +2 -2
  34. package/{chunk-86xhmz7k.js → chunk-en218k4y.js} +1 -1
  35. package/{chunk-3hg7yn1t.js → chunk-fgwda4m0.js} +1 -1
  36. package/chunk-gbjn6d81.js +2 -0
  37. package/{chunk-x496kg3v.js → chunk-gkf5jwvj.js} +1 -1
  38. package/{chunk-k3q5jqjj.js → chunk-hb4f2v34.js} +2 -2
  39. package/{chunk-mr807v9n.js → chunk-hbnmymaq.js} +1 -1
  40. package/{chunk-818nd6s1.js → chunk-jj4hqbrx.js} +2 -2
  41. package/{chunk-jyv9cae6.js → chunk-jn5pqy5v.js} +1 -1
  42. package/{chunk-yyy2yp6f.js → chunk-jtsve11b.js} +9 -9
  43. package/chunk-m1eam0s5.js +2 -0
  44. package/{chunk-6vnjg5x9.js → chunk-mbpb5c7w.js} +1 -1
  45. package/{chunk-t40fag3z.js → chunk-msm9hmk9.js} +1 -1
  46. package/{chunk-j781n7ca.js → chunk-n0ybj4h9.js} +2 -2
  47. package/{chunk-jp5afrwm.js → chunk-n2jcx65v.js} +2 -2
  48. package/{chunk-2ks2tnac.js → chunk-nrsd810j.js} +2 -2
  49. package/chunk-pnspvnyd.js +2 -0
  50. package/chunk-pz2afna8.js +2 -0
  51. package/{chunk-d37gemt2.js → chunk-q9f4xb0w.js} +3 -3
  52. package/{chunk-hd3x1w46.js → chunk-qaeyhe65.js} +1 -1
  53. package/chunk-qnkrrwmg.js +2 -0
  54. package/{chunk-e6c2mzxc.js → chunk-r4ttdkrz.js} +2 -2
  55. package/{chunk-r9aatvwm.js → chunk-stj493dn.js} +2 -2
  56. package/{chunk-g3ed130w.js → chunk-tevejprz.js} +4 -4
  57. package/{chunk-k3rmjrf1.js → chunk-v3ee9z3f.js} +1 -1
  58. package/{chunk-4n49ptbz.js → chunk-vtqr7dm8.js} +2 -2
  59. package/{chunk-z3ch1wg6.js → chunk-xh444pfn.js} +14 -14
  60. package/{chunk-pehyqj8k.js → chunk-zc9ar0r4.js} +1 -1
  61. package/{chunk-ef9yhnk3.js → chunk-zyyzk5ha.js} +1 -1
  62. package/compiled.js +9 -9
  63. package/package.json +1 -1
  64. package/ui-test-worker.js +8 -8
  65. package/web/chunk-045d3b5d.js +1 -0
  66. package/web/{chunk-r4ffr96e.js → chunk-0770q5e1.js} +1 -1
  67. package/web/chunk-12qf1r6m.js +1 -0
  68. package/web/{chunk-s7e93552.js → chunk-18neka5g.js} +4 -4
  69. package/web/{chunk-et8q775x.js → chunk-1ev0n3n4.js} +5 -5
  70. package/web/chunk-1ex3wgms.js +2 -0
  71. package/web/{chunk-svh2gkx8.js → chunk-1qh7f5kr.js} +1 -1
  72. package/web/{chunk-s38s9ff9.js → chunk-26ecc2xh.js} +30 -30
  73. package/web/chunk-2cz7tx8q.js +1 -0
  74. package/web/chunk-32ty2xfn.js +1 -0
  75. package/web/{chunk-q1xxs319.js → chunk-3eexx7y5.js} +4 -4
  76. package/web/{chunk-v14s4vgc.js → chunk-46jnkghq.js} +1 -1
  77. package/web/chunk-4am8j3k3.js +1 -0
  78. package/web/{chunk-85gdsmt4.js → chunk-5qvmefq2.js} +1 -1
  79. package/web/chunk-5svqfj4g.js +3 -0
  80. package/web/{chunk-f93pe4kb.js → chunk-5v5q13hz.js} +4 -4
  81. package/web/chunk-5z2n4z9x.css +1 -0
  82. package/web/{chunk-qcge7d6s.js → chunk-6e87m0nm.js} +2 -2
  83. package/web/chunk-6y55gk1n.js +1 -0
  84. package/web/chunk-7np1jp3x.js +8 -0
  85. package/web/chunk-87e8d1hv.js +1 -0
  86. package/web/{chunk-33w36n91.js → chunk-88wd49xe.js} +2 -2
  87. package/web/chunk-8h2x89tw.js +2 -0
  88. package/web/chunk-8y2526ve.js +1 -0
  89. package/web/chunk-905vw286.js +2 -0
  90. package/web/chunk-918e5t4x.js +2 -0
  91. package/web/chunk-96m2m3e8.js +1 -0
  92. package/web/chunk-9f4zzqbx.js +1 -0
  93. package/web/{chunk-fe31sv6t.js → chunk-9yfftz38.js} +1 -1
  94. package/web/{chunk-z0zrp8n8.js → chunk-a1n4468c.js} +1 -1
  95. package/web/chunk-arnzrqnm.js +1 -0
  96. package/web/{chunk-c01176kn.js → chunk-awkdw9rw.js} +2 -2
  97. package/web/{chunk-m5y2d4zv.js → chunk-b46ws7rf.js} +1 -1
  98. package/web/chunk-bc3ajvfg.js +24 -0
  99. package/web/chunk-bwy3e58v.js +1 -0
  100. package/web/{chunk-ja7w629n.js → chunk-c57f714b.js} +2 -2
  101. package/web/chunk-d5gshd1a.js +1 -0
  102. package/web/chunk-de40q05r.js +30 -0
  103. package/web/chunk-dp0k5vhd.js +1 -0
  104. package/web/{chunk-qq2v8h6d.js → chunk-dv1berk6.js} +5 -5
  105. package/web/{chunk-jzte2phh.js → chunk-eh7wp62z.js} +1 -1
  106. package/web/{chunk-823b7866.js → chunk-ehtmb6sn.js} +18 -18
  107. package/web/{chunk-d9wdsjkk.js → chunk-eqndhs21.js} +2 -2
  108. package/web/chunk-et1hytyv.js +1 -0
  109. package/web/chunk-f7jpakwh.js +1 -0
  110. package/web/chunk-f9m9seam.js +1 -0
  111. package/web/{chunk-7a4xk6j9.js → chunk-fmmrthpa.js} +5 -5
  112. package/web/{chunk-fv6vm14n.js → chunk-frnh4zqf.js} +2 -2
  113. package/web/chunk-g2erm7k0.js +1 -0
  114. package/web/chunk-g3kbn0t2.js +1 -0
  115. package/web/{chunk-h5cfg3vv.js → chunk-g7dc4hrd.js} +2 -2
  116. package/web/{chunk-dgwkqcz6.js → chunk-g7kz8f7q.js} +2 -2
  117. package/web/chunk-ght0t49g.js +1 -0
  118. package/web/{chunk-jjjtv2r1.js → chunk-ghwm7bdj.js} +2 -2
  119. package/web/{chunk-sda7cyrt.js → chunk-grm2208k.js} +21 -21
  120. package/web/{chunk-0zwc2rvh.js → chunk-gsw1tv96.js} +1 -1
  121. package/web/chunk-gw8x1g61.js +24 -0
  122. package/web/chunk-gx340asc.js +1 -0
  123. package/web/chunk-h2txs73e.js +39 -0
  124. package/web/chunk-h3tkacc7.js +1 -0
  125. package/web/{chunk-cyjnert7.js → chunk-h5ckjk48.js} +16 -16
  126. package/web/{chunk-1s8zg6fb.js → chunk-j37p0b13.js} +5 -5
  127. package/web/chunk-j89s11x8.js +78 -0
  128. package/web/{chunk-jam45rqg.js → chunk-jccz14ye.js} +2 -2
  129. package/web/chunk-je78j3vr.js +1 -0
  130. package/web/chunk-jke2ev6m.js +2 -0
  131. package/web/{chunk-1gx0zpmp.js → chunk-js6kb05s.js} +9 -9
  132. package/web/{chunk-30b33r2w.js → chunk-k0cg4n2k.js} +2 -2
  133. package/web/{chunk-tkp72r9b.js → chunk-knm82fw9.js} +1 -1
  134. package/web/{chunk-xb9m0092.js → chunk-kxdtg9dt.js} +1 -1
  135. package/web/{chunk-w37n09px.js → chunk-m4fxd5d9.js} +10 -10
  136. package/web/chunk-m9xzt9p7.js +1 -0
  137. package/web/{chunk-8773nwdc.js → chunk-myd6sc76.js} +1 -1
  138. package/web/{chunk-sf101c23.js → chunk-mykrm8ba.js} +2 -2
  139. package/web/chunk-mzzaet63.js +1 -0
  140. package/web/{chunk-2axwda8c.js → chunk-n4yzs2q0.js} +7 -7
  141. package/web/{chunk-wj3ymejj.js → chunk-nawxgz87.js} +4 -4
  142. package/web/chunk-ngt1j8py.js +1139 -0
  143. package/web/{chunk-hstbgb83.js → chunk-p55vhns6.js} +5 -5
  144. package/web/{chunk-xabcx3ry.js → chunk-pgwf37s2.js} +3 -3
  145. package/web/chunk-q34as3v6.js +1 -0
  146. package/web/{chunk-dtg5yhhs.js → chunk-q4bst4an.js} +1 -1
  147. package/web/chunk-qdzy124b.js +4 -0
  148. package/web/chunk-qe0bgeda.js +1 -0
  149. package/web/{chunk-sd3cdqcm.js → chunk-qh62nkem.js} +2 -2
  150. package/web/{chunk-j1bw5v1g.js → chunk-qq6m2my8.js} +2 -2
  151. package/web/{chunk-8dp7h6w8.js → chunk-qy1zx2yw.js} +16 -16
  152. package/web/chunk-rag65pfs.js +4 -0
  153. package/web/chunk-rbqnre6q.js +36 -0
  154. package/web/{chunk-hbkasy6c.js → chunk-rh3xb76f.js} +22 -22
  155. package/web/{chunk-fx4mackk.js → chunk-rwfmccmh.js} +4 -4
  156. package/web/{chunk-mf6xng5b.js → chunk-rxvm70w5.js} +2 -2
  157. package/web/chunk-sat7zyva.js +1 -0
  158. package/web/{chunk-cn0tmwjs.js → chunk-sc63488q.js} +2 -2
  159. package/web/{chunk-xsz1dfm2.js → chunk-sd3xat3r.js} +20 -20
  160. package/web/{chunk-nky3bqfg.js → chunk-se4h6wx0.js} +1 -1
  161. package/web/chunk-sjkg40ay.js +7 -0
  162. package/web/chunk-sk0hpa80.js +1 -0
  163. package/web/{chunk-xqyazzm7.js → chunk-t5nvgz7z.js} +5 -5
  164. package/web/{chunk-3q0v8w45.js → chunk-tfqarvdx.js} +80 -80
  165. package/web/{chunk-d0m0h0eb.js → chunk-tqze6d6b.js} +1 -1
  166. package/web/{chunk-rbdvc8x7.js → chunk-tt93zbn4.js} +7 -7
  167. package/web/chunk-tvcxrx6h.js +1 -0
  168. package/web/chunk-tzpnh70q.js +1 -0
  169. package/web/{chunk-8wg44w91.js → chunk-vasppf6b.js} +2 -2
  170. package/web/chunk-vb7g4xg6.js +1 -0
  171. package/web/chunk-w3zgfhjb.js +2 -0
  172. package/web/{chunk-0j9a7811.js → chunk-wrevb4ew.js} +6 -6
  173. package/web/chunk-wtvch4ad.js +106 -0
  174. package/web/chunk-wzfe6jtq.js +1 -0
  175. package/web/{chunk-cez1k71m.js → chunk-x5g1yy12.js} +1 -1
  176. package/web/chunk-x850q01z.js +1 -0
  177. package/web/chunk-xh4xn1az.js +1 -0
  178. package/web/chunk-xk904wqv.js +1 -0
  179. package/web/chunk-xtn305fd.js +1 -0
  180. package/web/chunk-xzwxcxb4.js +1 -0
  181. package/web/{chunk-4anjs6yp.js → chunk-y2rzeb4v.js} +2 -2
  182. package/web/chunk-yekaz74b.js +1 -0
  183. package/web/{chunk-8nv7q5ac.js → chunk-yppgejg7.js} +15 -15
  184. package/web/chunk-ys2tns0p.js +1 -0
  185. package/web/chunk-z4bp6p32.js +62 -0
  186. package/web/{chunk-p0cjvjdx.js → chunk-z5qn0xev.js} +1 -1
  187. package/web/{chunk-rkjkynm3.js → chunk-zms6mrqk.js} +12 -12
  188. package/web/{chunk-6e38yf3a.js → chunk-zse05v6j.js} +4 -4
  189. package/web/{chunk-cn1xpg3q.js → chunk-zz1qkaar.js} +2 -2
  190. package/web/index.html +1 -1
  191. package/worker.js +1 -1
  192. package/chunk-2gcp3xdc.js +0 -2
  193. package/chunk-320174qe.js +0 -2
  194. package/chunk-dvb5nd2x.js +0 -2
  195. package/chunk-frt9k18g.js +0 -480
  196. package/chunk-ndt6rjt9.js +0 -2
  197. package/chunk-xy2bxwq8.js +0 -2
  198. package/chunk-yzevjkms.js +0 -25
  199. package/chunk-zdyd8hbn.js +0 -2
  200. package/web/chunk-0jfda4jw.js +0 -2
  201. package/web/chunk-2p3fkhy8.js +0 -1
  202. package/web/chunk-3sz5qcwj.js +0 -1
  203. package/web/chunk-433c80pc.js +0 -1
  204. package/web/chunk-48cnmhvd.js +0 -106
  205. package/web/chunk-5r37rwq1.js +0 -4
  206. package/web/chunk-6bwgdvf6.js +0 -1
  207. package/web/chunk-7f1t7z72.js +0 -2
  208. package/web/chunk-7x35g67d.js +0 -78
  209. package/web/chunk-8pzg8qw4.js +0 -1
  210. package/web/chunk-8r0s8tx7.js +0 -1
  211. package/web/chunk-9p5dfvav.js +0 -1
  212. package/web/chunk-9q9w9pay.js +0 -1
  213. package/web/chunk-a3teqvz2.js +0 -39
  214. package/web/chunk-ahztazsg.js +0 -1
  215. package/web/chunk-bd8ftfxn.js +0 -3
  216. package/web/chunk-c03bt2pz.js +0 -1
  217. package/web/chunk-c1ha2xg6.js +0 -8
  218. package/web/chunk-cgng31df.js +0 -1
  219. package/web/chunk-cvd4f51j.js +0 -1
  220. package/web/chunk-cybvxssy.js +0 -1
  221. package/web/chunk-d22wq71s.js +0 -1
  222. package/web/chunk-dynajx8x.js +0 -2
  223. package/web/chunk-f3vv7n52.js +0 -1
  224. package/web/chunk-fmthkpff.js +0 -1
  225. package/web/chunk-fpa81dv7.js +0 -62
  226. package/web/chunk-g17n6asp.js +0 -1
  227. package/web/chunk-g9dzaw9e.js +0 -30
  228. package/web/chunk-gcwhx3av.js +0 -1139
  229. package/web/chunk-gf8vm6b5.js +0 -1
  230. package/web/chunk-gnmeyy4h.js +0 -1
  231. package/web/chunk-hn7mhsbg.js +0 -1
  232. package/web/chunk-jfvxxp5c.js +0 -1
  233. package/web/chunk-k8h8zx6r.js +0 -24
  234. package/web/chunk-m3ajw575.js +0 -1
  235. package/web/chunk-mbwwj216.js +0 -1
  236. package/web/chunk-mz9b5bsa.js +0 -1
  237. package/web/chunk-np33kmn4.js +0 -1
  238. package/web/chunk-nvk8mazs.js +0 -1
  239. package/web/chunk-nyw5ewgv.js +0 -1
  240. package/web/chunk-p56dcqpr.js +0 -1
  241. package/web/chunk-pdn4r8x4.js +0 -1
  242. package/web/chunk-qpt34d8d.js +0 -1
  243. package/web/chunk-qskt3tqa.js +0 -1
  244. package/web/chunk-qt3n897m.js +0 -4
  245. package/web/chunk-r1rt48h9.js +0 -1
  246. package/web/chunk-r7tgd2fm.js +0 -7
  247. package/web/chunk-rznszqmy.js +0 -1
  248. package/web/chunk-s1pefd34.js +0 -1
  249. package/web/chunk-sc29azev.js +0 -1
  250. package/web/chunk-t4jc4nac.js +0 -1
  251. package/web/chunk-t7g366a5.js +0 -24
  252. package/web/chunk-thbqwq6b.js +0 -1
  253. package/web/chunk-v94v68xg.js +0 -36
  254. package/web/chunk-wcphswcx.js +0 -2
  255. package/web/chunk-wwcnvyjh.css +0 -1
  256. package/web/chunk-xce8n339.js +0 -1
  257. package/web/chunk-xfd3b01q.js +0 -1
  258. package/web/chunk-xtss82z2.js +0 -1
@@ -0,0 +1 @@
1
+ import"./chunk-tfqarvdx.js";import"./chunk-88wd49xe.js";import"./chunk-rxvm70w5.js";import{oo}from"./chunk-qdzy124b.js";export{oo as render};
@@ -0,0 +1 @@
1
+ import{Ni}from"./chunk-qy1zx2yw.js";export{Ni as createArchitectureServices};
@@ -1,2 +1,2 @@
1
- import{t,Fn,p,Gn}from"./chunk-3q0v8w45.js";import{Se}from"./chunk-gcwhx3av.js";var o=Se(Gn(),1);var on=t((s,e)=>{let r=s.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name)r.attr("name",e.name);if(e.rx)r.attr("rx",e.rx);if(e.ry)r.attr("ry",e.ry);if(e.attrs!==void 0)for(let a in e.attrs)r.attr(a,e.attrs[a]);if(e.class)r.attr("class",e.class);return r},"drawRect"),zr=t((s,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};on(s,r).lower()},"drawBackgroundRect"),to=t((s,e)=>{let r=e.text.replace(Fn," "),a=s.append("text");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class)a.attr("class",e.class);let i=a.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),a},"drawText"),_a=t((s,e,r,a)=>{let i=s.append("image");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),wa=t((s,e,r,a)=>{let i=s.append("use");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),Je=t(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),ka=t(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ft=t(()=>{let s=p(".mermaidTooltip");if(s.empty())s=p("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
- export{on,zr,to,_a,wa,Je,ka,Ft};
1
+ import{t,Fn,p,Gn}from"./chunk-tfqarvdx.js";import{Se}from"./chunk-ngt1j8py.js";var o=Se(Gn(),1);var an=t((s,e)=>{let r=s.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name)r.attr("name",e.name);if(e.rx)r.attr("rx",e.rx);if(e.ry)r.attr("ry",e.ry);if(e.attrs!==void 0)for(let a in e.attrs)r.attr(a,e.attrs[a]);if(e.class)r.attr("class",e.class);return r},"drawRect"),qr=t((s,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};an(s,r).lower()},"drawBackgroundRect"),lo=t((s,e)=>{let r=e.text.replace(Fn," "),a=s.append("text");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class)a.attr("class",e.class);let i=a.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),a},"drawText"),Aa=t((s,e,r,a)=>{let i=s.append("image");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),Ra=t((s,e,r,a)=>{let i=s.append("use");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),Je=t(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),La=t(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ft=t(()=>{let s=p(".mermaidTooltip");if(s.empty())s=p("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
+ export{an,qr,lo,Aa,Ra,Je,La,Ft};
@@ -0,0 +1 @@
1
+ import{Ti}from"./chunk-qy1zx2yw.js";export{Ti as createWardleyServices};
@@ -0,0 +1,2 @@
1
+ import{g,o,r,e,n,y,ne}from"./chunk-ngt1j8py.js";import{na}from"./chunk-918e5t4x.js";function Nn(t){let{Button:i,SettingActions:l,cn:d}=y();return n(l,{children:[t.notice&&n("span",{role:t.notice.type==="error"?"alert":"status",className:d("mr-auto flex min-w-0 items-center gap-1.5 text-xs",t.notice.type==="success"?"text-success":"text-danger"),children:[t.notice.type==="success"?e(na,{className:"size-3.5 shrink-0"}):e(ne,{className:"size-3.5 shrink-0"}),e("span",{className:"min-w-0 break-words",children:t.notice.text})]}),t.dirty&&e(i,{type:"button",variant:"ghost",size:"sm",disabled:t.busy,onClick:t.onReset,children:"撤销更改"}),e(i,{form:t.formID,type:"submit",variant:"primary",size:"sm",disabled:t.busy||!t.dirty,children:t.saving?"保存中…":"保存"})]})}function ta(t){let{connection:i,endpoint:l,loadError:d}=t,[m,b]=r(null),[c,f]=r(null),[N,P]=r({models:[]}),[p,T]=r(!0),[M,v]=r(!1),[h,x]=r(!1),[k,a]=r(null),S=g(async(u=!1)=>{if(u)v(!0);else T(!0);a(null);try{let[s,C]=await Promise.all([i.request(l),i.request("/api/models")]);b(s),f(s),P(C)}catch(s){a({type:"error",text:s instanceof Error?s.message:d})}finally{T(!1),v(!1)}},[i,l,d]);o(()=>{S()},[S]);let w=c&&m?t.differs(c,m):!1;return{settings:c,modelList:N,loading:p,refreshing:M,saving:h,notice:k,dirty:w,load:S,save:async(u)=>{if(u?.preventDefault(),!c||h||p)return;x(!0),a(null);try{let s=await i.request(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.toBody(c))});b(s),f(s),a({type:"success",text:"设置已保存"})}catch(s){a({type:"error",text:s instanceof Error?s.message:"保存设置失败"})}finally{x(!1)}},reset:()=>{f(m),a(null)},edit:(u)=>{f((s)=>s?u(s):null),a(null)}}}
2
+ export{Nn,ta};
@@ -1,7 +1,7 @@
1
- import{t,a,ke,D,x,O,B,C,S,E,T,A,L,R,Vn,V,U,Vi}from"./chunk-3q0v8w45.js";import"./chunk-fe31sv6t.js";import{Xe}from"./chunk-07agqp8h.js";import{kt}from"./chunk-cn1xpg3q.js";import{Ot}from"./chunk-h0c42zy3.js";function Pt(e,i,s){e=+e,i=+i,s=(o=arguments.length)<2?(i=e,e=0,1):o<3?1:+s;var n=-1,o=Math.max(0,Math.ceil((i-e)/s))|0,c=Array(o);while(++n<o)c[n]=e+n*s;return c}function xt(){var e=Xe().unknown(void 0),{domain:i,range:s}=e,n=0,o=1,c,l,p=!1,g=0,y=0,z=0.5;delete e.unknown;function M(){var k=i().length,G=o<n,Y=G?o:n,N=G?n:o;if(c=(N-Y)/Math.max(1,k-g+y*2),p)c=Math.floor(c);if(Y+=(N-Y-c*(k-g))*z,l=c*(1-g),p)Y=Math.round(Y),l=Math.round(l);var j=Pt(k).map(function(it){return Y+c*it});return s(G?j.reverse():j)}return e.domain=function(k){return arguments.length?(i(k),M()):i()},e.range=function(k){return arguments.length?([n,o]=k,n=+n,o=+o,M()):[n,o]},e.rangeRound=function(k){return[n,o]=k,n=+n,o=+o,p=!0,M()},e.bandwidth=function(){return l},e.step=function(){return c},e.round=function(k){return arguments.length?(p=!!k,M()):p},e.padding=function(k){return arguments.length?(g=Math.min(1,y=+k),M()):g},e.paddingInner=function(k){return arguments.length?(g=Math.min(1,k),M()):g},e.paddingOuter=function(k){return arguments.length?(y=+k,M()):y},e.align=function(k){return arguments.length?(z=Math.max(0,Math.min(1,k)),M()):z},e.copy=function(){return xt(i(),[n,o]).round(p).paddingInner(g).paddingOuter(y).align(z)},Ot.apply(M(),arguments)}var Lt=function(){var e=t(function(J,h,u,f){for(u=u||{},f=J.length;f--;u[J[f]]=h);return u},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],o=[1,5],c=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],g=[1,25],y=[1,26],z=[1,28],M=[1,29],k=[1,30],G=[1,31],Y=[1,32],N=[1,33],j=[1,34],it=[1,35],nt=[1,36],_=[1,37],K=[1,43],d=[1,42],Q=[1,47],Z=[1,50],P=[1,10,12,14,16,18,19,21,23,36,37,38],ot=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],gt=[1,65],F=[26,28],v={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(h,u,f,m,I,r,rt){var b=r.length-1;switch(I){case 5:m.setOrientation(r[b]);break;case 9:m.setDiagramTitle(r[b].text.trim());break;case 12:m.setLineData({text:"",type:"text"},r[b]);break;case 13:m.setLineData(r[b-1],r[b]);break;case 14:m.setBarData({text:"",type:"text"},r[b]);break;case 15:m.setBarData(r[b-1],r[b]);break;case 16:this.$=r[b].trim(),m.setAccTitle(this.$);break;case 17:case 18:this.$=r[b].trim(),m.setAccDescription(this.$);break;case 19:this.$=r[b-1];break;case 20:case 30:this.$=[r[b-2],...r[b]];break;case 21:case 31:this.$=[r[b]];break;case 22:this.$={value:Number(r[b-1]),label:r[b]};break;case 23:this.$={value:Number(r[b]),label:""};break;case 24:m.setXAxisTitle(r[b]);break;case 25:m.setXAxisTitle(r[b-1]);break;case 26:m.setXAxisTitle({type:"text",text:""});break;case 27:m.setXAxisBand(r[b]);break;case 28:m.setXAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 29:this.$=r[b-1];break;case 32:m.setYAxisTitle(r[b]);break;case 33:m.setYAxisTitle(r[b-1]);break;case 34:m.setYAxisTitle({type:"text",text:""});break;case 35:m.setYAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 39:this.$={text:r[b],type:"text"};break;case 40:this.$={text:r[b],type:"text"};break;case 41:this.$={text:r[b],type:"markdown"};break;case 42:this.$=r[b];break;case 43:this.$=r[b-1]+""+r[b];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:o,37:c,38:l}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:o,37:c,38:l}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:o,37:c,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:o,37:c,38:l}),{1:[2,3]},e(p,[2,5]),e(i,[2,7],{4:22,36:o,37:c,38:l}),{11:23,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:39,13:38,24:K,29:d,30:g,31:40,32:41,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:45,15:44,29:Q,30:g,35:46,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:49,17:48,24:Z,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:52,17:51,24:Z,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{20:[1,53]},{22:[1,54]},e(P,[2,18]),{1:[2,2]},e(P,[2,8]),e(P,[2,9]),e(ot,[2,39],{41:55,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_}),e(ot,[2,40]),e(ot,[2,41]),e(H,[2,42]),e(H,[2,44]),e(H,[2,45]),e(H,[2,46]),e(H,[2,47]),e(H,[2,48]),e(H,[2,49]),e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(P,[2,10]),e(P,[2,24],{32:41,31:56,24:K,29:d}),e(P,[2,26]),e(P,[2,27]),{33:[1,57]},{11:59,30:g,34:58,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},e(P,[2,11]),e(P,[2,32],{35:60,29:Q}),e(P,[2,34]),{33:[1,61]},e(P,[2,12]),{17:62,24:Z},{25:63,27:64,29:gt},e(P,[2,14]),{17:66,24:Z},e(P,[2,16]),e(P,[2,17]),e(H,[2,43]),e(P,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(P,[2,33]),{29:[1,70]},e(P,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(F,[2,23],{30:[1,73]}),e(P,[2,15]),e(P,[2,28]),e(P,[2,29]),{11:59,30:g,34:74,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},e(P,[2,35]),e(P,[2,19]),{25:75,27:64,29:gt},e(F,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(h,u){if(u.recoverable)this.trace(h);else{var f=Error(h);throw f.hash=u,f}},"parseError"),parse:t(function(h){var u=this,f=[0],m=[],I=[null],r=[],rt=this.table,b="",bt=0,Ht=0,$t=0,fe=2,Ut=1,pe=r.slice.call(arguments,1),X=Object.create(this.lexer),ht={yy:{}};for(var Rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Rt))ht.yy[Rt]=this.yy[Rt];if(X.setInput(h,ht.yy),ht.yy.lexer=X,ht.yy.parser=this,typeof X.yylloc>"u")X.yylloc={};var _t=X.yylloc;r.push(_t);var me=X.options&&X.options.ranges;if(typeof ht.yy.parseError==="function")this.parseError=ht.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(et){f.length=f.length-2*et,I.length=I.length-et,r.length=r.length-et}t(be,"popStack");function qt(){var et=m.pop()||X.lex()||Ut;if(typeof et!=="number"){if(et instanceof Array)m=et,et=m.pop();et=u.symbols_[et]||et}return et}t(qt,"lex");var q,Tt,lt,tt,Oe,Dt,ut={},yt,at,Gt,wt;while(!0){if(lt=f[f.length-1],this.defaultActions[lt])tt=this.defaultActions[lt];else{if(q===null||typeof q>"u")q=qt();tt=rt[lt]&&rt[lt][q]}if(typeof tt>"u"||!tt.length||!tt[0]){var vt="";wt=[];for(yt in rt[lt])if(this.terminals_[yt]&&yt>fe)wt.push("'"+this.terminals_[yt]+"'");if(X.showPosition)vt="Parse error on line "+(bt+1)+`:
2
- `+X.showPosition()+`
3
- Expecting `+wt.join(", ")+", got '"+(this.terminals_[q]||q)+"'";else vt="Parse error on line "+(bt+1)+": Unexpected "+(q==Ut?"end of input":"'"+(this.terminals_[q]||q)+"'");this.parseError(vt,{text:X.match,token:this.terminals_[q]||q,line:X.yylineno,loc:_t,expected:wt})}if(tt[0]instanceof Array&&tt.length>1)throw Error("Parse Error: multiple actions possible at state: "+lt+", token: "+q);switch(tt[0]){case 1:if(f.push(q),I.push(X.yytext),r.push(X.yylloc),f.push(tt[1]),q=null,!Tt){if(Ht=X.yyleng,b=X.yytext,bt=X.yylineno,_t=X.yylloc,$t>0)$t--}else q=Tt,Tt=null;break;case 2:if(at=this.productions_[tt[1]][1],ut.$=I[I.length-at],ut._$={first_line:r[r.length-(at||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(at||1)].first_column,last_column:r[r.length-1].last_column},me)ut._$.range=[r[r.length-(at||1)].range[0],r[r.length-1].range[1]];if(Dt=this.performAction.apply(ut,[b,Ht,bt,ht.yy,tt[1],I,r].concat(pe)),typeof Dt<"u")return Dt;if(at)f=f.slice(0,-1*at*2),I=I.slice(0,-1*at),r=r.slice(0,-1*at);f.push(this.productions_[tt[1]][0]),I.push(ut.$),r.push(ut._$),Gt=rt[f[f.length-2]][f[f.length-1]],f.push(Gt);break;case 3:return!0}}return!0},"parse")},st=function(){var J={EOF:1,parseError:t(function(u,f){if(this.yy.parser)this.yy.parser.parseError(u,f);else throw Error(u)},"parseError"),setInput:t(function(h,u){if(this.yy=u||this.yy||{},this._input=h,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 h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);if(u)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),h},"input"),unput:t(function(h){var u=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var m=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 I=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===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-u},this.options.ranges)this.yylloc.range=[I[0],I[0]+this.yyleng-u];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).
1
+ import{t,a,ke,N,x,O,F,C,S,E,T,A,L,R,Vn,V,U,Ki}from"./chunk-tfqarvdx.js";import"./chunk-9yfftz38.js";import{Xe}from"./chunk-07agqp8h.js";import{kt}from"./chunk-zz1qkaar.js";import{Ot}from"./chunk-h0c42zy3.js";function Pt(e,i,s){e=+e,i=+i,s=(o=arguments.length)<2?(i=e,e=0,1):o<3?1:+s;var n=-1,o=Math.max(0,Math.ceil((i-e)/s))|0,c=Array(o);while(++n<o)c[n]=e+n*s;return c}function xt(){var e=Xe().unknown(void 0),{domain:i,range:s}=e,n=0,o=1,c,l,p=!1,g=0,y=0,I=0.5;delete e.unknown;function P(){var k=i().length,G=o<n,X=G?o:n,Y=G?n:o;if(c=(Y-X)/Math.max(1,k-g+y*2),p)c=Math.floor(c);if(X+=(Y-X-c*(k-g))*I,l=c*(1-g),p)X=Math.round(X),l=Math.round(l);var j=Pt(k).map(function(it){return X+c*it});return s(G?j.reverse():j)}return e.domain=function(k){return arguments.length?(i(k),P()):i()},e.range=function(k){return arguments.length?([n,o]=k,n=+n,o=+o,P()):[n,o]},e.rangeRound=function(k){return[n,o]=k,n=+n,o=+o,p=!0,P()},e.bandwidth=function(){return l},e.step=function(){return c},e.round=function(k){return arguments.length?(p=!!k,P()):p},e.padding=function(k){return arguments.length?(g=Math.min(1,y=+k),P()):g},e.paddingInner=function(k){return arguments.length?(g=Math.min(1,k),P()):g},e.paddingOuter=function(k){return arguments.length?(y=+k,P()):y},e.align=function(k){return arguments.length?(I=Math.max(0,Math.min(1,k)),P()):I},e.copy=function(){return xt(i(),[n,o]).round(p).paddingInner(g).paddingOuter(y).align(I)},Ot.apply(P(),arguments)}var Lt=function(){var e=t(function(J,h,u,f){for(u=u||{},f=J.length;f--;u[J[f]]=h);return u},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],o=[1,5],c=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],g=[1,25],y=[1,26],I=[1,28],P=[1,29],k=[1,30],G=[1,31],X=[1,32],Y=[1,33],j=[1,34],it=[1,35],nt=[1,36],_=[1,37],K=[1,43],d=[1,42],Q=[1,47],Z=[1,50],v=[1,10,12,14,16,18,19,21,23,36,37,38],ot=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],gt=[1,65],z=[26,28],D={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(h,u,f,m,M,r,rt){var b=r.length-1;switch(M){case 5:m.setOrientation(r[b]);break;case 9:m.setDiagramTitle(r[b].text.trim());break;case 12:m.setLineData({text:"",type:"text"},r[b]);break;case 13:m.setLineData(r[b-1],r[b]);break;case 14:m.setBarData({text:"",type:"text"},r[b]);break;case 15:m.setBarData(r[b-1],r[b]);break;case 16:this.$=r[b].trim(),m.setAccTitle(this.$);break;case 17:case 18:this.$=r[b].trim(),m.setAccDescription(this.$);break;case 19:this.$=r[b-1];break;case 20:case 30:this.$=[r[b-2],...r[b]];break;case 21:case 31:this.$=[r[b]];break;case 22:this.$={value:Number(r[b-1]),label:r[b]};break;case 23:this.$={value:Number(r[b]),label:""};break;case 24:m.setXAxisTitle(r[b]);break;case 25:m.setXAxisTitle(r[b-1]);break;case 26:m.setXAxisTitle({type:"text",text:""});break;case 27:m.setXAxisBand(r[b]);break;case 28:m.setXAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 29:this.$=r[b-1];break;case 32:m.setYAxisTitle(r[b]);break;case 33:m.setYAxisTitle(r[b-1]);break;case 34:m.setYAxisTitle({type:"text",text:""});break;case 35:m.setYAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 39:this.$={text:r[b],type:"text"};break;case 40:this.$={text:r[b],type:"text"};break;case 41:this.$={text:r[b],type:"markdown"};break;case 42:this.$=r[b];break;case 43:this.$=r[b-1]+""+r[b];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:o,37:c,38:l}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:o,37:c,38:l}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:o,37:c,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:o,37:c,38:l}),{1:[2,3]},e(p,[2,5]),e(i,[2,7],{4:22,36:o,37:c,38:l}),{11:23,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:39,13:38,24:K,29:d,30:g,31:40,32:41,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:45,15:44,29:Q,30:g,35:46,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:49,17:48,24:Z,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:52,17:51,24:Z,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{20:[1,53]},{22:[1,54]},e(v,[2,18]),{1:[2,2]},e(v,[2,8]),e(v,[2,9]),e(ot,[2,39],{41:55,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_}),e(ot,[2,40]),e(ot,[2,41]),e(H,[2,42]),e(H,[2,44]),e(H,[2,45]),e(H,[2,46]),e(H,[2,47]),e(H,[2,48]),e(H,[2,49]),e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(v,[2,10]),e(v,[2,24],{32:41,31:56,24:K,29:d}),e(v,[2,26]),e(v,[2,27]),{33:[1,57]},{11:59,30:g,34:58,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},e(v,[2,11]),e(v,[2,32],{35:60,29:Q}),e(v,[2,34]),{33:[1,61]},e(v,[2,12]),{17:62,24:Z},{25:63,27:64,29:gt},e(v,[2,14]),{17:66,24:Z},e(v,[2,16]),e(v,[2,17]),e(H,[2,43]),e(v,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(v,[2,33]),{29:[1,70]},e(v,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(z,[2,23],{30:[1,73]}),e(v,[2,15]),e(v,[2,28]),e(v,[2,29]),{11:59,30:g,34:74,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},e(v,[2,35]),e(v,[2,19]),{25:75,27:64,29:gt},e(z,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(h,u){if(u.recoverable)this.trace(h);else{var f=Error(h);throw f.hash=u,f}},"parseError"),parse:t(function(h){var u=this,f=[0],m=[],M=[null],r=[],rt=this.table,b="",bt=0,Ht=0,$t=0,fe=2,Ut=1,pe=r.slice.call(arguments,1),W=Object.create(this.lexer),ht={yy:{}};for(var Rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Rt))ht.yy[Rt]=this.yy[Rt];if(W.setInput(h,ht.yy),ht.yy.lexer=W,ht.yy.parser=this,typeof W.yylloc>"u")W.yylloc={};var _t=W.yylloc;r.push(_t);var me=W.options&&W.options.ranges;if(typeof ht.yy.parseError==="function")this.parseError=ht.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(et){f.length=f.length-2*et,M.length=M.length-et,r.length=r.length-et}t(be,"popStack");function qt(){var et=m.pop()||W.lex()||Ut;if(typeof et!=="number"){if(et instanceof Array)m=et,et=m.pop();et=u.symbols_[et]||et}return et}t(qt,"lex");var q,Tt,lt,tt,Oe,Dt,ut={},yt,at,Gt,wt;while(!0){if(lt=f[f.length-1],this.defaultActions[lt])tt=this.defaultActions[lt];else{if(q===null||typeof q>"u")q=qt();tt=rt[lt]&&rt[lt][q]}if(typeof tt>"u"||!tt.length||!tt[0]){var vt="";wt=[];for(yt in rt[lt])if(this.terminals_[yt]&&yt>fe)wt.push("'"+this.terminals_[yt]+"'");if(W.showPosition)vt="Parse error on line "+(bt+1)+`:
2
+ `+W.showPosition()+`
3
+ Expecting `+wt.join(", ")+", got '"+(this.terminals_[q]||q)+"'";else vt="Parse error on line "+(bt+1)+": Unexpected "+(q==Ut?"end of input":"'"+(this.terminals_[q]||q)+"'");this.parseError(vt,{text:W.match,token:this.terminals_[q]||q,line:W.yylineno,loc:_t,expected:wt})}if(tt[0]instanceof Array&&tt.length>1)throw Error("Parse Error: multiple actions possible at state: "+lt+", token: "+q);switch(tt[0]){case 1:if(f.push(q),M.push(W.yytext),r.push(W.yylloc),f.push(tt[1]),q=null,!Tt){if(Ht=W.yyleng,b=W.yytext,bt=W.yylineno,_t=W.yylloc,$t>0)$t--}else q=Tt,Tt=null;break;case 2:if(at=this.productions_[tt[1]][1],ut.$=M[M.length-at],ut._$={first_line:r[r.length-(at||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(at||1)].first_column,last_column:r[r.length-1].last_column},me)ut._$.range=[r[r.length-(at||1)].range[0],r[r.length-1].range[1]];if(Dt=this.performAction.apply(ut,[b,Ht,bt,ht.yy,tt[1],M,r].concat(pe)),typeof Dt<"u")return Dt;if(at)f=f.slice(0,-1*at*2),M=M.slice(0,-1*at),r=r.slice(0,-1*at);f.push(this.productions_[tt[1]][0]),M.push(ut.$),r.push(ut._$),Gt=rt[f[f.length-2]][f[f.length-1]],f.push(Gt);break;case 3:return!0}}return!0},"parse")},st=function(){var J={EOF:1,parseError:t(function(u,f){if(this.yy.parser)this.yy.parser.parseError(u,f);else throw Error(u)},"parseError"),setInput:t(function(h,u){if(this.yy=u||this.yy||{},this._input=h,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 h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);if(u)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),h},"input"),unput:t(function(h){var u=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var m=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 M=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===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-u},this.options.ranges)this.yylloc.range=[M[0],M[0]+this.yyleng-u];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(h){this.unput(this.match.slice(h))},"less"),pastInput:t(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var h=this.pastInput(),u=Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
- `+u+"^"},"showPosition"),test_match:t(function(h,u){var f,m,I;if(this.options.backtrack_lexer){if(I={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)I.yylloc.range=this.yylloc.range.slice(0)}if(m=h[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],f=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var r in I)this[r]=I[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,u,f,m;if(!this._more)this.yytext="",this.match="";var I=this._currentRules();for(var r=0;r<I.length;r++)if(f=this._input.match(this.rules[I[r]]),f&&(!u||f[0].length>u[0].length)){if(u=f,m=r,this.options.backtrack_lexer)if(h=this.test_match(f,I[r]),h!==!1)return h;else if(this._backtrack){u=!1;continue}else return!1;else if(!this.options.flex)break}if(u){if(h=this.test_match(u,I[m]),h!==!1)return h;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 u=this.next();if(u)return u;else return this.lex()},"lex"),begin:t(function(u){this.conditionStack.push(u)},"begin"),popState:t(function(){var u=this.conditionStack.length-1;if(u>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(u){if(u=this.conditionStack.length-1-Math.abs(u||0),u>=0)return this.conditionStack[u];else return"INITIAL"},"topState"),pushState:t(function(u){this.begin(u)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(u,f,m,I){var r=I;switch(m){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return J}();v.lexer=st;function W(){this.yy={}}return t(W,"Parser"),W.prototype=v,v.Parser=W,new W}();Lt.parser=Lt;var ye=Lt;function At(e){return e.type==="bar"}t(At,"isBarPlot");function Ct(e){return e.type==="band"}t(Ct,"isBandAxisData");function dt(e){return e.type==="linear"}t(dt,"isLinearAxisData");var Bt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((g,y)=>Math.max(y.length,g),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),c=t((g)=>g&&g>0?g:1,"toScale"),l=c(o?.a),p=c(o?.d);for(let g of e){let y=Vi(n,1,g),z=y?y.width/l:g.length*i,M=y?y.height/p:i;s.width=Math.max(s.width,z),s.height=Math.max(s.height,M)}return n.remove(),s}},jt=0.7,Qt=0.2,Kt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(jt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(jt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.height;this.outerPadding=Math.min(s.height/2,n);let o=s.width+this.axisConfig.labelPadding*2;if(o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},we=class extends Kt{static{t(this,"BandAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),a.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},Ae=class extends Kt{static{t(this,"LinearAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.domain=s,this.scale=kt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=kt().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Et(e,i,s,n){let o=new Bt(n);if(Ct(e))return new we(i,s,e.categories,e.title,o);return new Ae(i,s,[e.min,e.max],e.title,o)}t(Et,"getAxis");var Ce=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(n<=e.height&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(e,i){let s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((e+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Zt(e,i,s,n){let o=new Bt(n);return new Ce(o,e,i,s)}t(Zt,"getChartTitleComponent");var Se=0.75,Re=0.5,_e=0.35;function Mt(e){return{fontSize:e,markerSize:e*Se,markerSpacing:e*_e,itemSpacing:e*Re}}t(Mt,"getLegendLayout");var Te=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((g)=>g.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=Mt(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((g)=>g.title),i),l=this.chartConfig.legendPadding*2+s+n+c.width,p=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;if(l<=e.width&&p<=e.height)this.boundingRect.width=l,this.boundingRect.height=p;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Mt(this.chartConfig.legendFontSize),o=e+n,c=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,p=[],g=[];for(let[y,z]of this.visiblePlots.entries())if(At(z))p.push({x:c,y:l+y*o,width:i,height:i,fill:z.fill,strokeFill:z.fill,strokeWidth:0});else{let M=l+y*o+i/2;g.push({path:`M ${c},${M} L ${c+i},${M}`,strokeFill:z.strokeFill,strokeWidth:z.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:p},{groupTexts:["legend","markers"],type:"path",data:g},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((y,z)=>({text:y.title,x:c+i+s,y:l+z*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(e,i,s,n){let o=new Bt(n);return new Te(o,e,i,s)}t(Jt,"getChartLegendComponent");var De=class{constructor(e,i,s,n,o){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Vn().y((n)=>n[0]).x((n)=>n[1])(e);else i=Vn().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let c=[];for(let[l,[p,g]]of e.entries()){let y=this.plotData.pointLabels[l];if(!y)continue;if(this.orientation==="horizontal")c.push({x:g+10,y:p,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else c.push({x:p,y:g-10,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(c.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},ve=class{constructor(e,i,s,n,o,c){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=c}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((o)=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new De(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function te(e,i,s){return new Pe(e,i,s)}t(te,"getPlotComponent");var Le=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Zt(e,i,s,n),plot:te(e,i,s),legend:Jt(e,i,s,n),xAxis:Et(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Et(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:l});if(e-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=p.width,e-=p.width,o=this.componentStore.legend.calculateSpace({width:e,height:l}),e-=o.width,e>0)c+=e,e=0;if(i>0)l+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+c),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:n+Math.max((l-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+l}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((g)=>At(g)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,c={width:0,height:0},l=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:l,height:p});if(e-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("left"),g=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=g.width,n=g.width,this.componentStore.yAxis.setAxisPosition("top"),g=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=g.height,o=s+g.height,c=this.componentStore.legend.calculateSpace({width:e,height:p}),e-=c.width,e>0)l+=e,e=0;if(i>0)p+=i,i=0;if(this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+l),this.componentStore.legend.setBoundingBoxXY({x:n+l,y:o+Math.max((p-c.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some((y)=>At(y)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Ee=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new Le(e,i,s,n).getDrawableElement()}},ft=0,ee,pt=Wt(),mt=Vt(),w=Ft(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1;function Vt(){let e=ke(),i=x();return U(e.xyChart,i.themeVariables.xyChart)}t(Vt,"getChartDefaultThemeConfig");function Wt(){let e=x();return U(D.xyChart,e.xyChart)}t(Wt,"getChartDefaultConfig");function Ft(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Ft,"getChartDefaultData");function ct(e){let i=x();return O(e.trim(),i)}t(ct,"textSanitizer");function ie(e){ee=e}t(ie,"setTmpSVGG");function se(e){if(e==="horizontal")pt.chartOrientation="horizontal";else pt.chartOrientation="vertical"}t(se,"setOrientation");function ne(e){w.xAxis.title=ct(e.text)}t(ne,"setXAxisTitle");function Xt(e,i){w.xAxis={type:"linear",title:w.xAxis.title,min:e,max:i},St=!0}t(Xt,"setXAxisRangeData");function ae(e){w.xAxis={type:"band",title:w.xAxis.title,categories:e.map((i)=>ct(i.text))},St=!0}t(ae,"setXAxisBand");function oe(e){w.yAxis.title=ct(e.text)}t(oe,"setYAxisTitle");function re(e,i){w.yAxis={type:"linear",title:w.yAxis.title,min:e,max:i},zt=!0}t(re,"setYAxisRangeData");function he(e){let i=Math.min(...e),s=Math.max(...e),n=dt(w.yAxis)?w.yAxis.min:1/0,o=dt(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(n,i),max:Math.max(o,s)}}t(he,"setYAxisRangeFromPlotData");function Yt(e){let i=[];if(e.length===0)return i;if(!St){let s=dt(w.xAxis)?w.xAxis.min:1/0,n=dt(w.xAxis)?w.xAxis.max:-1/0;Xt(Math.min(s,1),Math.max(n,e.length))}if(Ct(w.xAxis)&&e.length>w.xAxis.categories.length)e=e.slice(0,w.xAxis.categories.length);if(!zt)he(e);if(Ct(w.xAxis))i=w.xAxis.categories.map((s,n)=>[s,e[n]]);if(dt(w.xAxis)){let s=w.xAxis.min,n=w.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let o=(n-s)/(e.length-1);i=e.map((c,l)=>[`${s+l*o}`,c])}}return i}t(Yt,"transformDataWithoutCategory");function Nt(e){return It[e===0?0:e%It.length]}t(Nt,"getPlotColorFromPalette");function le(e,i){let s=i.map((l)=>l.value),n=i.map((l)=>l.label?ct(l.label):""),o=Yt(s),c=n.some((l)=>l!=="");w.plots.push({type:"line",title:ct(e.text),strokeFill:Nt(ft),strokeWidth:2,data:o,...c?{pointLabels:n}:{}}),ft++}t(le,"setLineData");function ce(e,i){let s=i.map((o)=>o.value),n=Yt(s);w.plots.push({type:"bar",title:ct(e.text),fill:Nt(ft),data:n}),ft++}t(ce,"setBarData");function ge(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=R(),Ee.build(pt,w,mt,ee)}t(ge,"getDrawableElem");function ue(){return mt}t(ue,"getChartThemeConfig");function de(){return pt}t(de,"getChartConfig");function xe(){return w}t(xe,"getXYChartData");var Me=t(function(){C(),ft=0,pt=Wt(),w=Ft(),mt=Vt(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1},"clear"),Ie={getDrawableElem:ge,clear:Me,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T,setOrientation:se,setXAxisTitle:ne,setXAxisRangeData:Xt,setXAxisBand:ae,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Be=t((e,i,s,n)=>{let o=n.db,c=o.getChartThemeConfig(),l=o.getChartConfig(),p=o.getXYChartData().plots[0].data.map((_)=>_[1]);function g(_){return _==="top"?"text-before-edge":"middle"}t(g,"getDominantBaseLine");function y(_){return _==="left"?"start":_==="right"?"end":"middle"}t(y,"getTextAnchor");function z(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}t(z,"getTextTransformation"),a.debug(`Rendering xychart chart
7
- `+e);let M=V(i),k=M.append("g").attr("class","main"),G=k.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");B(M,l.height,l.width,!0),M.attr("viewBox",`0 0 ${l.width} ${l.height}`),G.attr("fill",c.backgroundColor),o.setTmpSVGG(M.append("g").attr("class","mermaid-tmp-group"));let Y=o.getDrawableElem(),N={};function j(_){let K=k,d="";for(let[Q]of _.entries()){let Z=k;if(Q>0&&N[d])Z=N[d];if(d+=_[Q],K=N[d],!K)K=N[d]=Z.append("g").attr("class",_[Q])}return K}t(j,"getGroup");for(let _ of Y){if(_.data.length===0)continue;let K=j(_.groupTexts);switch(_.type){case"rect":if(K.selectAll("rect").data(_.data).enter().append("rect").attr("x",(d)=>d.x).attr("y",(d)=>d.y).attr("width",(d)=>d.width).attr("height",(d)=>d.height).attr("fill",(d)=>d.fill).attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth),l.showDataLabel){let d=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let Q=function(v,st){let{data:W,label:J}=v;return st*J.length*Z<=W.width-P};var it=Q;t(Q,"fitsHorizontally");let Z=0.7,P=10,ot=_.data.map((v,st)=>({data:v,label:p[st].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),H=ot.map((v)=>{let{data:st}=v,W=st.height*0.7;while(!Q(v,W)&&W>0)W-=1;return W}),gt=Math.floor(Math.min(...H)),F=t((v)=>{if(d)return v.data.x+v.data.width+P;else return v.data.x+v.data.width-P},"determineLabelXPosition");K.selectAll("text").data(ot).enter().append("text").attr("x",F).attr("y",(v)=>v.data.y+v.data.height/2).attr("text-anchor",d?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${gt}px`).text((v)=>v.label)}else{let Q=function(F,v,st){let{data:W,label:J}=F,h=0.7,u=v*J.length*0.7,f=W.x+W.width/2,m=f-u/2,I=f+u/2,r=m>=W.x&&I<=W.x+W.width,rt=W.y+st+v<=W.y+W.height;return r&&rt};var nt=Q;t(Q,"fitsInBar");let Z=10,P=_.data.map((F,v)=>({data:F,label:p[v].toString()})).filter((F)=>F.data.width>0&&F.data.height>0),ot=P.map((F)=>{let{data:v,label:st}=F,W=v.width/(st.length*0.7);while(!Q(F,W,Z)&&W>0)W-=1;return W}),H=Math.floor(Math.min(...ot)),gt=t((F)=>{if(d)return F.data.y-Z;else return F.data.y+Z},"determineLabelYPosition");K.selectAll("text").data(P).enter().append("text").attr("x",(F)=>F.data.x+F.data.width/2).attr("y",gt).attr("text-anchor","middle").attr("dominant-baseline",d?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text((F)=>F.label)}}break;case"text":K.selectAll("text").data(_.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(d)=>d.fill).attr("font-size",(d)=>d.fontSize).attr("dominant-baseline",(d)=>g(d.verticalPos)).attr("text-anchor",(d)=>y(d.horizontalPos)).attr("transform",(d)=>z(d)).text((d)=>d.text);break;case"path":K.selectAll("path").data(_.data).enter().append("path").attr("d",(d)=>d.path).attr("fill",(d)=>d.fill?d.fill:"none").attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth);break}}},"draw"),ze={draw:Be},ti={parser:ye,db:Ie,renderer:ze};export{ti as diagram};
5
+ `+u+"^"},"showPosition"),test_match:t(function(h,u){var f,m,M;if(this.options.backtrack_lexer){if(M={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)M.yylloc.range=this.yylloc.range.slice(0)}if(m=h[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],f=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var r in M)this[r]=M[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,u,f,m;if(!this._more)this.yytext="",this.match="";var M=this._currentRules();for(var r=0;r<M.length;r++)if(f=this._input.match(this.rules[M[r]]),f&&(!u||f[0].length>u[0].length)){if(u=f,m=r,this.options.backtrack_lexer)if(h=this.test_match(f,M[r]),h!==!1)return h;else if(this._backtrack){u=!1;continue}else return!1;else if(!this.options.flex)break}if(u){if(h=this.test_match(u,M[m]),h!==!1)return h;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 u=this.next();if(u)return u;else return this.lex()},"lex"),begin:t(function(u){this.conditionStack.push(u)},"begin"),popState:t(function(){var u=this.conditionStack.length-1;if(u>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(u){if(u=this.conditionStack.length-1-Math.abs(u||0),u>=0)return this.conditionStack[u];else return"INITIAL"},"topState"),pushState:t(function(u){this.begin(u)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(u,f,m,M){var r=M;switch(m){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return J}();D.lexer=st;function B(){this.yy={}}return t(B,"Parser"),B.prototype=D,D.Parser=B,new B}();Lt.parser=Lt;var ye=Lt;function At(e){return e.type==="bar"}t(At,"isBarPlot");function Ct(e){return e.type==="band"}t(Ct,"isBandAxisData");function dt(e){return e.type==="linear"}t(dt,"isLinearAxisData");var Bt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((g,y)=>Math.max(y.length,g),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),c=t((g)=>g&&g>0?g:1,"toScale"),l=c(o?.a),p=c(o?.d);for(let g of e){let y=Ki(n,1,g),I=y?y.width/l:g.length*i,P=y?y.height/p:i;s.width=Math.max(s.width,I),s.height=Math.max(s.height,P)}return n.remove(),s}},jt=0.7,Qt=0.2,Kt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(jt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(jt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.height;this.outerPadding=Math.min(s.height/2,n);let o=s.width+this.axisConfig.labelPadding*2;if(o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},we=class extends Kt{static{t(this,"BandAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),a.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},Ae=class extends Kt{static{t(this,"LinearAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.domain=s,this.scale=kt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=kt().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Et(e,i,s,n){let o=new Bt(n);if(Ct(e))return new we(i,s,e.categories,e.title,o);return new Ae(i,s,[e.min,e.max],e.title,o)}t(Et,"getAxis");var Ce=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(n<=e.height&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(e,i){let s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((e+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Zt(e,i,s,n){let o=new Bt(n);return new Ce(o,e,i,s)}t(Zt,"getChartTitleComponent");var Se=0.75,Re=0.5,_e=0.35;function Mt(e){return{fontSize:e,markerSize:e*Se,markerSpacing:e*_e,itemSpacing:e*Re}}t(Mt,"getLegendLayout");var Te=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((g)=>g.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=Mt(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((g)=>g.title),i),l=this.chartConfig.legendPadding*2+s+n+c.width,p=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;if(l<=e.width&&p<=e.height)this.boundingRect.width=l,this.boundingRect.height=p;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Mt(this.chartConfig.legendFontSize),o=e+n,c=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,p=[],g=[];for(let[y,I]of this.visiblePlots.entries())if(At(I))p.push({x:c,y:l+y*o,width:i,height:i,fill:I.fill,strokeFill:I.fill,strokeWidth:0});else{let P=l+y*o+i/2;g.push({path:`M ${c},${P} L ${c+i},${P}`,strokeFill:I.strokeFill,strokeWidth:I.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:p},{groupTexts:["legend","markers"],type:"path",data:g},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((y,I)=>({text:y.title,x:c+i+s,y:l+I*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(e,i,s,n){let o=new Bt(n);return new Te(o,e,i,s)}t(Jt,"getChartLegendComponent");var De=class{constructor(e,i,s,n,o){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Vn().y((n)=>n[0]).x((n)=>n[1])(e);else i=Vn().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let c=[];for(let[l,[p,g]]of e.entries()){let y=this.plotData.pointLabels[l];if(!y)continue;if(this.orientation==="horizontal")c.push({x:g+10,y:p,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else c.push({x:p,y:g-10,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(c.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},ve=class{constructor(e,i,s,n,o,c){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=c}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((o)=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new De(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function te(e,i,s){return new Pe(e,i,s)}t(te,"getPlotComponent");var Le=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Zt(e,i,s,n),plot:te(e,i,s),legend:Jt(e,i,s,n),xAxis:Et(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Et(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:l});if(e-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=p.width,e-=p.width,o=this.componentStore.legend.calculateSpace({width:e,height:l}),e-=o.width,e>0)c+=e,e=0;if(i>0)l+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+c),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:n+Math.max((l-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+l}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((g)=>At(g)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,c={width:0,height:0},l=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:l,height:p});if(e-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("left"),g=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=g.width,n=g.width,this.componentStore.yAxis.setAxisPosition("top"),g=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=g.height,o=s+g.height,c=this.componentStore.legend.calculateSpace({width:e,height:p}),e-=c.width,e>0)l+=e,e=0;if(i>0)p+=i,i=0;if(this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+l),this.componentStore.legend.setBoundingBoxXY({x:n+l,y:o+Math.max((p-c.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some((y)=>At(y)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Ee=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new Le(e,i,s,n).getDrawableElement()}},ft=0,ee,pt=Wt(),mt=Vt(),w=Ft(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1;function Vt(){let e=ke(),i=x();return U(e.xyChart,i.themeVariables.xyChart)}t(Vt,"getChartDefaultThemeConfig");function Wt(){let e=x();return U(N.xyChart,e.xyChart)}t(Wt,"getChartDefaultConfig");function Ft(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Ft,"getChartDefaultData");function ct(e){let i=x();return O(e.trim(),i)}t(ct,"textSanitizer");function ie(e){ee=e}t(ie,"setTmpSVGG");function se(e){if(e==="horizontal")pt.chartOrientation="horizontal";else pt.chartOrientation="vertical"}t(se,"setOrientation");function ne(e){w.xAxis.title=ct(e.text)}t(ne,"setXAxisTitle");function Xt(e,i){w.xAxis={type:"linear",title:w.xAxis.title,min:e,max:i},St=!0}t(Xt,"setXAxisRangeData");function ae(e){w.xAxis={type:"band",title:w.xAxis.title,categories:e.map((i)=>ct(i.text))},St=!0}t(ae,"setXAxisBand");function oe(e){w.yAxis.title=ct(e.text)}t(oe,"setYAxisTitle");function re(e,i){w.yAxis={type:"linear",title:w.yAxis.title,min:e,max:i},zt=!0}t(re,"setYAxisRangeData");function he(e){let i=Math.min(...e),s=Math.max(...e),n=dt(w.yAxis)?w.yAxis.min:1/0,o=dt(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(n,i),max:Math.max(o,s)}}t(he,"setYAxisRangeFromPlotData");function Yt(e){let i=[];if(e.length===0)return i;if(!St){let s=dt(w.xAxis)?w.xAxis.min:1/0,n=dt(w.xAxis)?w.xAxis.max:-1/0;Xt(Math.min(s,1),Math.max(n,e.length))}if(Ct(w.xAxis)&&e.length>w.xAxis.categories.length)e=e.slice(0,w.xAxis.categories.length);if(!zt)he(e);if(Ct(w.xAxis))i=w.xAxis.categories.map((s,n)=>[s,e[n]]);if(dt(w.xAxis)){let s=w.xAxis.min,n=w.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let o=(n-s)/(e.length-1);i=e.map((c,l)=>[`${s+l*o}`,c])}}return i}t(Yt,"transformDataWithoutCategory");function Nt(e){return It[e===0?0:e%It.length]}t(Nt,"getPlotColorFromPalette");function le(e,i){let s=i.map((l)=>l.value),n=i.map((l)=>l.label?ct(l.label):""),o=Yt(s),c=n.some((l)=>l!=="");w.plots.push({type:"line",title:ct(e.text),strokeFill:Nt(ft),strokeWidth:2,data:o,...c?{pointLabels:n}:{}}),ft++}t(le,"setLineData");function ce(e,i){let s=i.map((o)=>o.value),n=Yt(s);w.plots.push({type:"bar",title:ct(e.text),fill:Nt(ft),data:n}),ft++}t(ce,"setBarData");function ge(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=R(),Ee.build(pt,w,mt,ee)}t(ge,"getDrawableElem");function ue(){return mt}t(ue,"getChartThemeConfig");function de(){return pt}t(de,"getChartConfig");function xe(){return w}t(xe,"getXYChartData");var Me=t(function(){C(),ft=0,pt=Wt(),w=Ft(),mt=Vt(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1},"clear"),Ie={getDrawableElem:ge,clear:Me,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T,setOrientation:se,setXAxisTitle:ne,setXAxisRangeData:Xt,setXAxisBand:ae,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Be=t((e,i,s,n)=>{let o=n.db,c=o.getChartThemeConfig(),l=o.getChartConfig(),p=o.getXYChartData().plots[0].data.map((_)=>_[1]);function g(_){return _==="top"?"text-before-edge":"middle"}t(g,"getDominantBaseLine");function y(_){return _==="left"?"start":_==="right"?"end":"middle"}t(y,"getTextAnchor");function I(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}t(I,"getTextTransformation"),a.debug(`Rendering xychart chart
7
+ `+e);let P=V(i),k=P.append("g").attr("class","main"),G=k.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");F(P,l.height,l.width,!0),P.attr("viewBox",`0 0 ${l.width} ${l.height}`),G.attr("fill",c.backgroundColor),o.setTmpSVGG(P.append("g").attr("class","mermaid-tmp-group"));let X=o.getDrawableElem(),Y={};function j(_){let K=k,d="";for(let[Q]of _.entries()){let Z=k;if(Q>0&&Y[d])Z=Y[d];if(d+=_[Q],K=Y[d],!K)K=Y[d]=Z.append("g").attr("class",_[Q])}return K}t(j,"getGroup");for(let _ of X){if(_.data.length===0)continue;let K=j(_.groupTexts);switch(_.type){case"rect":if(K.selectAll("rect").data(_.data).enter().append("rect").attr("x",(d)=>d.x).attr("y",(d)=>d.y).attr("width",(d)=>d.width).attr("height",(d)=>d.height).attr("fill",(d)=>d.fill).attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth),l.showDataLabel){let d=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let Q=function(D,st){let{data:B,label:J}=D;return st*J.length*Z<=B.width-v};var it=Q;t(Q,"fitsHorizontally");let Z=0.7,v=10,ot=_.data.map((D,st)=>({data:D,label:p[st].toString()})).filter((D)=>D.data.width>0&&D.data.height>0),H=ot.map((D)=>{let{data:st}=D,B=st.height*0.7;while(!Q(D,B)&&B>0)B-=1;return B}),gt=Math.floor(Math.min(...H)),z=t((D)=>{if(d)return D.data.x+D.data.width+v;else return D.data.x+D.data.width-v},"determineLabelXPosition");K.selectAll("text").data(ot).enter().append("text").attr("x",z).attr("y",(D)=>D.data.y+D.data.height/2).attr("text-anchor",d?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${gt}px`).text((D)=>D.label)}else{let Q=function(z,D,st){let{data:B,label:J}=z,h=0.7,u=D*J.length*0.7,f=B.x+B.width/2,m=f-u/2,M=f+u/2,r=m>=B.x&&M<=B.x+B.width,rt=B.y+st+D<=B.y+B.height;return r&&rt};var nt=Q;t(Q,"fitsInBar");let Z=10,v=_.data.map((z,D)=>({data:z,label:p[D].toString()})).filter((z)=>z.data.width>0&&z.data.height>0),ot=v.map((z)=>{let{data:D,label:st}=z,B=D.width/(st.length*0.7);while(!Q(z,B,Z)&&B>0)B-=1;return B}),H=Math.floor(Math.min(...ot)),gt=t((z)=>{if(d)return z.data.y-Z;else return z.data.y+Z},"determineLabelYPosition");K.selectAll("text").data(v).enter().append("text").attr("x",(z)=>z.data.x+z.data.width/2).attr("y",gt).attr("text-anchor","middle").attr("dominant-baseline",d?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text((z)=>z.label)}}break;case"text":K.selectAll("text").data(_.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(d)=>d.fill).attr("font-size",(d)=>d.fontSize).attr("dominant-baseline",(d)=>g(d.verticalPos)).attr("text-anchor",(d)=>y(d.horizontalPos)).attr("transform",(d)=>I(d)).text((d)=>d.text);break;case"path":K.selectAll("path").data(_.data).enter().append("path").attr("d",(d)=>d.path).attr("fill",(d)=>d.fill?d.fill:"none").attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth);break}}},"draw"),ze={draw:Be},ti={parser:ye,db:Ie,renderer:ze};export{ti as diagram};
@@ -0,0 +1,106 @@
1
+ import{fn}from"./chunk-g7dc4hrd.js";import{G}from"./chunk-eh7wp62z.js";import{t,a,N,x,b,C,S,E,T,A,L,R,l,kr,p,Zi,U,M}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";var v={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ce=N.gitGraph,X=t(()=>U({...Ce,...x().gitGraph}),"getConfig"),m=new fn(()=>{let e=X(),{mainBranchName:r,mainBranchOrder:o}=e;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:o}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function ne(){return Zi({length:7})}t(ne,"getID");function pe(e,r){let o=Object.create(null);return e.reduce((c,i)=>{let h=r(i);if(!o[h])o[h]=!0,c.push(i);return c},[])}t(pe,"uniqBy");var ve=t(function(e){m.records.direction=e},"setDirection"),Ee=t(function(e){a.debug("options str",e),e=e?.trim(),e=e||"{}";try{m.records.options=JSON.parse(e)}catch(r){a.error("error while parsing gitGraph options",r.message)}},"setOptions"),Te=t(function(){return m.records.options},"getOptions"),Le=t(function(e){let{msg:r,id:o,type:c,tags:i}=e;a.info("commit",r,o,c,i),a.debug("Entering commit:",r,o,c,i);let h=X();o=b.sanitizeText(o,h),r=b.sanitizeText(r,h),i=i?.map((s)=>b.sanitizeText(s,h));let n={id:o?o:m.records.seq+"-"+ne(),message:r,seq:m.records.seq++,type:c??v.NORMAL,tags:i??[],parents:m.records.head==null?[]:[m.records.head.id],branch:m.records.currBranch};if(m.records.head=n,a.info("main branch",h.mainBranchName),m.records.commits.has(n.id))a.warn(`Commit ID ${n.id} already exists`);m.records.commits.set(n.id,n),m.records.branches.set(m.records.currBranch,n.id),a.debug("in pushCommit "+n.id)},"commit"),Me=t(function(e){let{name:r,order:o}=e;if(r=b.sanitizeText(r,X()),m.records.branches.has(r))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);m.records.branches.set(r,m.records.head!=null?m.records.head.id:null),m.records.branchConfig.set(r,{name:r,order:o}),ye(r),a.debug("in createBranch")},"branch"),Pe=t((e)=>{let{branch:r,id:o,type:c,tags:i}=e,h=X();if(r=b.sanitizeText(r,h),o)o=b.sanitizeText(o,h);let n=m.records.branches.get(m.records.currBranch),s=m.records.branches.get(r),g=n?m.records.commits.get(n):void 0,y=s?m.records.commits.get(s):void 0;if(g&&y&&g.branch===r)throw Error(`Cannot merge branch '${r}' into itself.`);if(m.records.currBranch===r){let d=Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(g===void 0||!g){let d=Error(`Incorrect usage of "merge". Current branch (${m.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!m.records.branches.has(r)){let d=Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(y===void 0||!y){let d=Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if(g===y){let d=Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(o&&m.records.commits.has(o)){let d=Error('Incorrect usage of "merge". Commit with id:'+o+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${o} ${c} ${i?.join(" ")}`,token:`merge ${r} ${o} ${c} ${i?.join(" ")}`,expected:[`merge ${r} ${o}_UNIQUE ${c} ${i?.join(" ")}`]},d}let u=s?s:"",f={id:o||`${m.records.seq}-${ne()}`,message:`merged branch ${r} into ${m.records.currBranch}`,seq:m.records.seq++,parents:m.records.head==null?[]:[m.records.head.id,u],branch:m.records.currBranch,type:v.MERGE,customType:c,customId:o?!0:!1,tags:i??[]};m.records.head=f,m.records.commits.set(f.id,f),m.records.branches.set(m.records.currBranch,f.id),a.debug(m.records.branches),a.debug("in mergeBranch")},"merge"),Re=t(function(e){let{id:r,targetId:o,tags:c,parent:i}=e;a.debug("Entering cherryPick:",r,o,c);let h=X();if(r=b.sanitizeText(r,h),o=b.sanitizeText(o,h),c=c?.map((g)=>b.sanitizeText(g,h)),i=b.sanitizeText(i,h),!r||!m.records.commits.has(r)){let g=Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw g.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},g}let n=m.records.commits.get(r);if(n===void 0||!n)throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(n.parents)&&n.parents.includes(i)))throw Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let s=n.branch;if(n.type===v.MERGE&&!i)throw Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!o||!m.records.commits.has(o)){if(s===m.records.currBranch){let f=Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let g=m.records.branches.get(m.records.currBranch);if(g===void 0||!g){let f=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let y=m.records.commits.get(g);if(y===void 0||!y){let f=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let u={id:m.records.seq+"-"+ne(),message:`cherry-picked ${n?.message} into ${m.records.currBranch}`,seq:m.records.seq++,parents:m.records.head==null?[]:[m.records.head.id,n.id],branch:m.records.currBranch,type:v.CHERRY_PICK,tags:c?c.filter(Boolean):[`cherry-pick:${n.id}${n.type===v.MERGE?`|parent:${i}`:""}`]};m.records.head=u,m.records.commits.set(u.id,u),m.records.branches.set(m.records.currBranch,u.id),a.debug(m.records.branches),a.debug("in cherryPick")}},"cherryPick"),ye=t(function(e){if(e=b.sanitizeText(e,X()),!m.records.branches.has(e)){let r=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}else{m.records.currBranch=e;let r=m.records.branches.get(m.records.currBranch);if(r===void 0||!r)m.records.head=null;else m.records.head=m.records.commits.get(r)??null}},"checkout");function he(e,r,o){let c=e.indexOf(r);if(c===-1)e.push(o);else e.splice(c,1,o)}t(he,"upsert");function me(e){let r=e.reduce((i,h)=>{if(i.seq>h.seq)return i;return h},e[0]),o="";e.forEach(function(i){if(i===r)o+="\t*";else o+="\t|"});let c=[o,r.id,r.seq];for(let i in m.records.branches)if(m.records.branches.get(i)===r.id)c.push(i);if(a.debug(c.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){let i=m.records.commits.get(r.parents[0]);if(he(e,r,i),r.parents[1])e.push(m.records.commits.get(r.parents[1]))}else if(r.parents.length==0)return;else if(r.parents[0]){let i=m.records.commits.get(r.parents[0]);he(e,r,i)}e=pe(e,(i)=>i.id),me(e)}t(me,"prettyPrintCommitHistory");var Oe=t(function(){a.debug(m.records.commits);let e=xe()[0];me([e])},"prettyPrint"),Ie=t(function(){m.reset(),C()},"clear"),_e=t(function(){return[...m.records.branchConfig.values()].map((r,o)=>{if(r.order!==null&&r.order!==void 0)return r;return{...r,order:parseFloat(`0.${o}`)}}).sort((r,o)=>(r.order??0)-(o.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ge=t(function(){return m.records.branches},"getBranches"),De=t(function(){return m.records.commits},"getCommits"),xe=t(function(){let e=[...m.records.commits.values()];return e.forEach(function(r){a.debug(r.id)}),e.sort((r,o)=>r.seq-o.seq),e},"getCommitsArray"),We=t(function(){return m.records.currBranch},"getCurrentBranch"),qe=t(function(){return m.records.direction},"getDirection"),Ae=t(function(){return m.records.head},"getHead"),ue={commitType:v,getConfig:X,setDirection:ve,setOptions:Ee,getOptions:Te,commit:Le,branch:Me,merge:Pe,cherryPick:Re,checkout:ye,prettyPrint:Oe,clear:Ie,getBranchesAsObjArray:_e,getBranches:Ge,getCommits:De,getCommitsArray:xe,getCurrentBranch:We,getDirection:qe,getHead:Ae,setAccTitle:S,getAccTitle:E,getAccDescription:A,setAccDescription:T,setDiagramTitle:L,getDiagramTitle:R},He=t((e,r)=>{if(G(e,r),e.dir)r.setDirection(e.dir);for(let o of e.statements)Se(o,r)},"populate"),Se=t((e,r)=>{let c={Commit:t((i)=>r.commit(Ne(i)),"Commit"),Branch:t((i)=>r.branch(Fe(i)),"Branch"),Merge:t((i)=>r.merge(ze(i)),"Merge"),Checkout:t((i)=>r.checkout(Ye(i)),"Checkout"),CherryPicking:t((i)=>r.cherryPick(je(i)),"CherryPicking")}[e.$type];if(c)c(e);else a.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ne=t((e)=>({id:e.id,msg:e.message??"",type:e.type!==void 0?v[e.type]:v.NORMAL,tags:e.tags??void 0}),"parseCommit"),Fe=t((e)=>({name:e.name,order:e.order??0}),"parseBranch"),ze=t((e)=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?v[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ye=t((e)=>e.branch,"parseCheckout"),je=t((e)=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ke={parse:t(async(e)=>{let r=await J("gitGraph",e);a.debug(r),He(r,ue)},"parse")},j=10,K=40,H=4,z=2,V=8,ce=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),le=12,ge=new Set(["redux-color","redux-dark-color"]),Ue=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Z=t((e,r,o=!1)=>{if(o&&e>0)return(e-1)%(r-1)+1;return e%r},"calcColorIndex"),D=new Map,W=new Map,oe=30,te=new Map,se=[],Y=0,B="LR",Ve=t(()=>{D.clear(),W.clear(),te.clear(),Y=0,se=[],B="LR"},"clear"),be=t((e)=>{let r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e==="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach((c)=>{let i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=c.trim(),r.appendChild(i)}),r},"drawText"),we=t((e)=>{let r,o,c;if(B==="BT")o=t((i,h)=>i<=h,"comparisonFunc"),c=1/0;else o=t((i,h)=>i>=h,"comparisonFunc"),c=0;return e.forEach((i)=>{let h=B==="TB"||B=="BT"?W.get(i)?.y:W.get(i)?.x;if(h!==void 0&&o(h,c))r=i,c=h}),r},"findClosestParent"),Ze=t((e)=>{let r="",o=1/0;return e.forEach((c)=>{let i=W.get(c).y;if(i<=o)r=c,o=i}),r||void 0},"findClosestParentBT"),Xe=t((e,r,o)=>{let c=o,i=o,h=[];e.forEach((n)=>{let s=r.get(n);if(!s)throw Error(`Commit not found for key ${n}`);if(s.parents.length)c=Qe(s),i=Math.max(c,i);else h.push(s);et(s,c)}),c=i,h.forEach((n)=>{tt(n,c,o)}),e.forEach((n)=>{let s=r.get(n);if(s?.parents.length){let g=Ze(s.parents);if(c=W.get(g).y-K,c<=i)i=c;let y=D.get(s.branch).pos,u=c-j;W.set(s.id,{x:y,y:u})}})},"setParallelBTPos"),Je=t((e)=>{let r=we(e.parents.filter((c)=>c!==null));if(!r)throw Error(`Closest parent not found for commit ${e.id}`);let o=W.get(r)?.y;if(o===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return o},"findClosestParentPos"),Qe=t((e)=>Je(e)+K,"calculateCommitPosition"),et=t((e,r)=>{let o=D.get(e.branch);if(!o)throw Error(`Branch not found for commit ${e.id}`);let c=o.pos,i=r+j;return W.set(e.id,{x:c,y:i}),{x:c,y:i}},"setCommitPosition"),tt=t((e,r,o)=>{let c=D.get(e.branch);if(!c)throw Error(`Branch not found for commit ${e.id}`);let i=r+o,h=c.pos;W.set(e.id,{x:h,y:i})},"setRootPosition"),rt=t((e,r,o,c,i,h)=>{let{theme:n}=l(),s=ce.has(n??""),g=ge.has(n??""),y=Ue.has(n??"");if(h===v.HIGHLIGHT)e.append("rect").attr("x",o.x-10+(s?3:0)).attr("y",o.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${r.id} commit-highlight${Z(i,V,g)} ${c}-outer`),e.append("rect").attr("x",o.x-6+(s?2:0)).attr("y",o.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${r.id} commit${Z(i,V,g)} ${c}-inner`);else if(h===v.CHERRY_PICK)e.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",s?7:10).attr("class",`commit ${r.id} ${c}`),e.append("circle").attr("cx",o.x-3).attr("cy",o.y+2).attr("r",s?2.5:2.75).attr("fill",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),e.append("circle").attr("cx",o.x+3).attr("cy",o.y+2).attr("r",s?2.5:2.75).attr("fill",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),e.append("line").attr("x1",o.x+3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),e.append("line").attr("x1",o.x-3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`);else{let u=e.append("circle");if(u.attr("cx",o.x),u.attr("cy",o.y),u.attr("r",s?7:10),u.attr("class",`commit ${r.id} commit${Z(i,V,g)}`),h===v.MERGE){let f=e.append("circle");f.attr("cx",o.x),f.attr("cy",o.y),f.attr("r",s?5:6),f.attr("class",`commit ${c} ${r.id} commit${Z(i,V,g)}`)}if(h===v.REVERSE){let f=e.append("path"),d=s?4:5;f.attr("d",`M ${o.x-d},${o.y-d}L${o.x+d},${o.y+d}M${o.x-d},${o.y+d}L${o.x+d},${o.y-d}`).attr("class",`commit ${c} ${r.id} commit${Z(i,V,g)}`)}}},"drawCommitBullet"),at=t((e,r,o,c,i)=>{if(r.type!==v.CHERRY_PICK&&(r.customId&&r.type===v.MERGE||r.type!==v.MERGE)&&i.showCommitLabel){let h=e.append("g"),n=h.insert("rect").attr("class","commit-label-bkg"),s=h.append("text").attr("x",c).attr("y",o.y+25).attr("class","commit-label").text(r.id),g=s.node()?.getBBox();if(g){if(n.attr("x",o.posWithOffset-g.width/2-z).attr("y",o.y+13.5).attr("width",g.width+2*z).attr("height",g.height+2*z),B==="TB"||B==="BT")n.attr("x",o.x-(g.width+4*H+5)).attr("y",o.y-12),s.attr("x",o.x-(g.width+4*H)).attr("y",o.y+g.height-12);else s.attr("x",o.posWithOffset-g.width/2);if(i.rotateCommitLabel)if(B==="TB"||B==="BT")s.attr("transform","rotate(-45, "+o.x+", "+o.y+")"),n.attr("transform","rotate(-45, "+o.x+", "+o.y+")");else{let y=-7.5-(g.width+10)/25*9.5,u=10+g.width/25*8.5;h.attr("transform","translate("+y+", "+u+") rotate(-45, "+c+", "+o.y+")")}}}},"drawCommitLabel"),ot=t((e,r,o,c)=>{if(r.tags.length>0){let i=0,h=0,n=0,s=[];for(let g of r.tags.reverse()){let y=e.insert("polygon"),u=e.append("circle"),f=e.append("text").attr("y",o.y-16-i).attr("class","tag-label").text(g),d=f.node()?.getBBox();if(!d)throw Error("Tag bbox not found");h=Math.max(h,d.width),n=Math.max(n,d.height),f.attr("x",o.posWithOffset-d.width/2),s.push({tag:f,hole:u,rect:y,yOffset:i}),i+=20}for(let{tag:g,hole:y,rect:u,yOffset:f}of s){let d=n/2,k=o.y-19.2-f;if(u.attr("class","tag-label-bkg").attr("points",`
2
+ ${c-h/2-H/2},${k+z}
3
+ ${c-h/2-H/2},${k-z}
4
+ ${o.posWithOffset-h/2-H},${k-d-z}
5
+ ${o.posWithOffset+h/2+H},${k-d-z}
6
+ ${o.posWithOffset+h/2+H},${k+d+z}
7
+ ${o.posWithOffset-h/2-H},${k+d+z}`),y.attr("cy",k).attr("cx",c-h/2+H/2).attr("r",1.5).attr("class","tag-hole"),B==="TB"||B==="BT"){let w=c+f;u.attr("class","tag-label-bkg").attr("points",`
8
+ ${o.x},${w+2}
9
+ ${o.x},${w-2}
10
+ ${o.x+j},${w-d-2}
11
+ ${o.x+j+h+4},${w-d-2}
12
+ ${o.x+j+h+4},${w+d+2}
13
+ ${o.x+j},${w+d+2}`).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),y.attr("cx",o.x+H/2).attr("cy",w).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),g.attr("x",o.x+5).attr("y",w+3).attr("transform","translate(14,14) rotate(45, "+o.x+","+c+")")}}}},"drawCommitTags"),st=t((e)=>{switch(e.customType??e.type){case v.NORMAL:return"commit-normal";case v.REVERSE:return"commit-reverse";case v.HIGHLIGHT:return"commit-highlight";case v.MERGE:return"commit-merge";case v.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),nt=t((e,r,o,c)=>{let i={x:0,y:0};if(e.parents.length>0){let h=we(e.parents);if(h){let n=c.get(h)??i;if(r==="TB")return n.y+K;else if(r==="BT")return(c.get(e.id)??i).y-K;else return n.x+K}}else if(r==="TB")return oe;else if(r==="BT")return(c.get(e.id)??i).y-K;else return 0;return 0},"calculatePosition"),ct=t((e,r,o)=>{let c=B==="BT"&&o?r:r+j,i=D.get(e.branch)?.pos,h=B==="TB"||B==="BT"?D.get(e.branch)?.pos:c;if(h===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.id}`);let n=ce.has(l().theme??""),s=B==="TB"||B==="BT"?c:i+(n?le/2+1:-2);return{x:h,y:s,posWithOffset:c}},"getCommitPosition"),$e=t((e,r,o,c)=>{let i=e.append("g").attr("class","commit-bullets"),h=e.append("g").attr("class","commit-labels"),n=B==="TB"||B==="BT"?oe:0,s=[...r.keys()],g=c.parallelCommits??!1,y=t((f,d)=>{let k=r.get(f)?.seq,w=r.get(d)?.seq;return k!==void 0&&w!==void 0?k-w:0},"sortKeys"),u=s.sort(y);if(B==="BT"){if(g)Xe(u,r,n);u=u.reverse()}u.forEach((f)=>{let d=r.get(f);if(!d)throw Error(`Commit not found for key ${f}`);if(g)n=nt(d,B,n,W);let k=ct(d,n,g);if(o){let w=st(d),P=d.customType??d.type,O=D.get(d.branch)?.index??0;rt(i,d,k,w,O,P),at(h,d,k,n,c),ot(h,d,k,n)}if(B==="TB"||B==="BT")W.set(d.id,{x:k.x,y:k.posWithOffset});else W.set(d.id,{x:k.posWithOffset,y:k.y});if(n=B==="BT"&&g?n+K:n+K+j,n>Y)Y=n})},"drawCommits"),it=t((e,r,o,c,i)=>{let n=(B==="TB"||B==="BT"?o.x<c.x:o.y<c.y)?r.branch:e.branch,s=t((y)=>y.branch===n,"isOnBranchToGetCurve"),g=t((y)=>y.seq>e.seq&&y.seq<r.seq,"isBetweenCommits");return[...i.values()].some((y)=>g(y)&&s(y))},"shouldRerouteArrow"),re=t((e,r,o=0)=>{let c=e+Math.abs(e-r)/2;if(o>5)return c;if(se.every((n)=>Math.abs(n-c)>=10))return se.push(c),c;let h=Math.abs(e-r);return re(e,r-h/5,o+1)},"findLane"),dt=t((e,r,o,c)=>{let{theme:i}=l(),h=ge.has(i??""),n=W.get(r.id),s=W.get(o.id);if(n===void 0||s===void 0)throw Error(`Commit positions not found for commits ${r.id} and ${o.id}`);let g=it(r,o,n,s,c),y="",u="",f=0,d=0,k=D.get(o.branch)?.index;if(o.type===v.MERGE&&r.id!==o.parents[0])k=D.get(r.branch)?.index;let w;if(g){y="A 10 10, 0, 0, 0,",u="A 10 10, 0, 0, 1,",f=10,d=10;let P=n.y<s.y?re(n.y,s.y):re(s.y,n.y),O=n.x<s.x?re(n.x,s.x):re(s.x,n.x);if(B==="TB")if(n.x<s.x)w=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${u} ${O} ${n.y+d} L ${O} ${s.y-f} ${y} ${O+d} ${s.y} L ${s.x} ${s.y}`;else k=D.get(r.branch)?.index,w=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${y} ${O} ${n.y+d} L ${O} ${s.y-f} ${u} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(B==="BT")if(n.x<s.x)w=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${y} ${O} ${n.y-d} L ${O} ${s.y+f} ${u} ${O+d} ${s.y} L ${s.x} ${s.y}`;else k=D.get(r.branch)?.index,w=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${u} ${O} ${n.y-d} L ${O} ${s.y+f} ${y} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(n.y<s.y)w=`M ${n.x} ${n.y} L ${n.x} ${P-f} ${y} ${n.x+d} ${P} L ${s.x-f} ${P} ${u} ${s.x} ${P+d} L ${s.x} ${s.y}`;else k=D.get(r.branch)?.index,w=`M ${n.x} ${n.y} L ${n.x} ${P+f} ${u} ${n.x+d} ${P} L ${s.x-f} ${P} ${y} ${s.x} ${P-d} L ${s.x} ${s.y}`}else if(y="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",f=20,d=20,B==="TB"){if(n.x<s.x)if(o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${u} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",f=20,d=20,o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${u} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${y} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x===s.x)w=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else if(B==="BT"){if(n.x<s.x)if(o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${u} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",f=20,d=20,o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${y} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${u} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x===s.x)w=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else{if(n.y<s.y)if(o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${u} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y>s.y)if(o.type===v.MERGE&&r.id!==o.parents[0])w=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;else w=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${u} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y===s.y)w=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}if(w===void 0)throw Error("Line definition not found");e.append("path").attr("d",w).attr("class","arrow arrow"+Z(k,V,h))},"drawArrow"),ht=t((e,r)=>{let o=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach((c)=>{let i=r.get(c);if(i.parents&&i.parents.length>0)i.parents.forEach((h)=>{dt(o,r.get(h),i,r)})})},"drawArrows"),lt=t((e,r,o,c)=>{let{look:i,theme:h,themeVariables:n}=l(),{dropShadow:s,THEME_COLOR_LIMIT:g}=n,y=ce.has(h??""),u=ge.has(h??""),f=e.append("g");r.forEach((d,k)=>{let w=Z(k,y?g:V,u),P=D.get(d.name)?.pos;if(P===void 0)throw Error(`Position not found for branch ${d.name}`);let O=B==="TB"||B==="BT"?P:y?P+le/2+1:P-2,I=f.append("line");if(I.attr("x1",0),I.attr("y1",O),I.attr("x2",Y),I.attr("y2",O),I.attr("class","branch branch"+w),B==="TB")I.attr("y1",oe),I.attr("x1",P),I.attr("y2",Y),I.attr("x2",P);else if(B==="BT")I.attr("y1",Y),I.attr("x1",P),I.attr("y2",oe),I.attr("x2",P);se.push(O);let ie=d.name,ee=be(ie),q=f.insert("rect"),F=f.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+w);F.node().appendChild(ee);let _=ee.getBBox(),fe=y?0:4,ae=y?16:0,Q=y?le:0;if(i==="neo")q.attr("data-look","neo");if(q.attr("class","branchLabelBkg label"+w).attr("style",i==="neo"?`filter:${y?`url(#${c}-drop-shadow)`:s}`:"").attr("rx",fe).attr("ry",fe).attr("x",-_.width-4-(o.rotateCommitLabel===!0?30:0)).attr("y",-_.height/2+10).attr("width",_.width+18+ae).attr("height",_.height+4+Q),F.attr("transform","translate("+(-_.width-14-(o.rotateCommitLabel===!0?30:0)+ae/2)+", "+(O-_.height/2-2)+")"),B==="TB"){if(q.attr("x",P-_.width/2-10).attr("y",0),F.attr("transform","translate("+(P-_.width/2-5)+", 0)"),y)q.attr("transform",`translate(${-ae/2-3}, ${-Q-10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(-Q*2+7)+")")}else if(B==="BT"){if(q.attr("x",P-_.width/2-10).attr("y",Y),F.attr("transform","translate("+(P-_.width/2-5)+", "+Y+")"),y)q.attr("transform",`translate(${-ae/2-3}, ${Q+10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(Y+Q*2+4)+")")}else q.attr("transform","translate(-19, "+(O-12-Q/2)+")")})},"drawBranches"),mt=t(function(e,r,o,c,i){return D.set(e,{pos:r,index:o}),r+=50+(i?40:0)+(B==="TB"||B==="BT"?c.width/2:0),r},"setBranchPosition"),gt=t(function(e,r,o,c){Ve(),a.debug("in gitgraph renderer",e+`
14
+ `,"id:",r,o);let i=c.db;if(!i.getConfig){a.error("getConfig method is not available on db");return}let h=i.getConfig(),n=h.rotateCommitLabel??!1;te=i.getCommits();let s=i.getBranchesAsObjArray();B=i.getDirection();let g=p(`[id="${r}"]`),{look:y,theme:u,themeVariables:f}=l(),{useGradient:d,gradientStart:k,gradientStop:w,filterColor:P}=f;if(d){let I=g.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");I.append("stop").attr("offset","0%").attr("stop-color",k).attr("stop-opacity",1),I.append("stop").attr("offset","100%").attr("stop-color",w).attr("stop-opacity",1)}if(y==="neo"&&ce.has(u??""))g.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",P);let O=0;if(s.forEach((I,ie)=>{let ee=be(I.name),q=g.append("g"),de=q.insert("g").attr("class","branchLabel"),F=de.insert("g").attr("class","label branch-label");F.node()?.appendChild(ee);let _=ee.getBBox();O=mt(I.name,O,ie,_,n),F.remove(),de.remove(),q.remove()}),$e(g,te,!1,h),h.showBranches)lt(g,s,h,r);ht(g,te),$e(g,te,!0,h),M.insertTitle(g,"gitTitleText",h.titleTopMargin??0,i.getDiagramTitle()),kr(void 0,g,h.diagramPadding,h.useMaxWidth)},"draw"),ft={draw:gt},Be=8,ke=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),$t=new Set(["redux-color","redux-dark-color"]),pt=new Set(["neo","neo-dark"]),yt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),xt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),ut=t((e)=>{let{svgId:r}=e,o="";if(e.useGradient&&r)for(let c=0;c<e.THEME_COLOR_LIMIT;c++)o+=`
15
+ .label${c} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
16
+ `;return o},"genGitGraphGradient"),bt=t((e)=>{let r=x(),{theme:o,themeVariables:c}=r,{borderColorArray:i}=c,h=ke.has(o);if(pt.has(o)){let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
17
+ .branch-label${s} { fill: ${e.nodeBorder};}
18
+ .commit${s} { stroke: ${e.nodeBorder}; }
19
+ .commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
20
+ .arrow${s} { stroke: ${e.nodeBorder}; }
21
+ .commit-bullets { fill: ${e.nodeBorder}; }
22
+ .commit-cherry-pick${s} { stroke: ${e.nodeBorder}; }
23
+ ${ut(e)}`;else{let g=s%Be;n+=`
24
+ .branch-label${s} { fill: ${e["gitBranchLabel"+g]}; }
25
+ .commit${s} { stroke: ${e["git"+g]}; fill: ${e["git"+g]}; }
26
+ .commit-highlight${s} { stroke: ${e["gitInv"+g]}; fill: ${e["gitInv"+g]}; }
27
+ .arrow${s} { stroke: ${e["git"+g]}; }
28
+ `}return n}else if(!$t.has(o)){let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)n+=`
29
+ .branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.noteFontWeight}`:""} }
30
+ .commit${s} { stroke: ${e.nodeBorder}; }
31
+ .commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
32
+ .label${s} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${h?`font-weight:${e.noteFontWeight}`:""}}
33
+ .arrow${s} { stroke: ${e.nodeBorder}; }
34
+ .commit-bullets { fill: ${e.nodeBorder}; }
35
+ .commit-cherry-pick${s} { stroke: ${e.nodeBorder}; }
36
+ `;return n}else{let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
37
+ .branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.noteFontWeight}`:""} }
38
+ .commit${s} { stroke: ${e.nodeBorder}; }
39
+ .commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
40
+ .label${s} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${h?`font-weight:${e.noteFontWeight}`:""} }
41
+ .arrow${s} { stroke: ${e.nodeBorder}; }
42
+ .commit-bullets { fill: ${e.nodeBorder}; }
43
+ `;else{let g=s%i.length;n+=`
44
+ .branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.noteFontWeight}`:""} }
45
+ .commit${s} { stroke: ${i[g]}; fill: ${i[g]}; }
46
+ .commit-highlight${s} { stroke: ${i[g]}; fill: ${i[g]}; }
47
+ .label${s} { fill: ${yt.has(o)?e.mainBkg:i[g]}; stroke: ${i[g]}; stroke-width: ${e.strokeWidth}; }
48
+ .arrow${s} { stroke: ${i[g]}; }
49
+ `}return n}},"genColor"),wt=t((e)=>`${Array.from({length:e.THEME_COLOR_LIMIT},(r,o)=>o).map((r)=>{let o=r%Be;return`
50
+ .branch-label${r} { fill: ${e["gitBranchLabel"+o]}; }
51
+ .commit${r} { stroke: ${e["git"+o]}; fill: ${e["git"+o]}; }
52
+ .commit-highlight${r} { stroke: ${e["gitInv"+o]}; fill: ${e["gitInv"+o]}; }
53
+ .label${r} { fill: ${e["git"+o]}; }
54
+ .arrow${r} { stroke: ${e["git"+o]}; }
55
+ `}).join(`
56
+ `)}`,"normalTheme"),Bt=t((e)=>{let r=x(),{theme:o}=r,c=xt.has(o);return`
57
+ .commit-id,
58
+ .commit-msg,
59
+ .branch-label {
60
+ fill: lightgrey;
61
+ color: lightgrey;
62
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
63
+ font-family: var(--mermaid-font-family);
64
+ }
65
+
66
+ ${c?bt(e):wt(e)}
67
+
68
+ .branch {
69
+ stroke-width: ${e.strokeWidth};
70
+ stroke: ${e.commitLineColor??e.lineColor};
71
+ stroke-dasharray: ${c?"4 2":"2"};
72
+ }
73
+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${c?e.nodeBorder:e.commitLabelColor}; ${c?`font-weight:${e.noteFontWeight};`:""}}
74
+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${c?"transparent":e.commitLabelBackground}; opacity: ${c?"":0.5}; }
75
+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
76
+ .tag-label-bkg { fill: ${c?e.mainBkg:e.tagLabelBackground}; stroke: ${c?e.nodeBorder:e.tagLabelBorder}; ${c?`filter:${e.dropShadow}`:""} }
77
+ .tag-hole { fill: ${e.textColor}; }
78
+
79
+ .commit-merge {
80
+ stroke: ${c?e.mainBkg:e.primaryColor};
81
+ fill: ${c?e.mainBkg:e.primaryColor};
82
+ }
83
+ .commit-reverse {
84
+ stroke: ${c?e.mainBkg:e.primaryColor};
85
+ fill: ${c?e.mainBkg:e.primaryColor};
86
+ stroke-width: ${c?e.strokeWidth:3};
87
+ }
88
+ .commit-highlight-outer {
89
+ }
90
+ .commit-highlight-inner {
91
+ stroke: ${c?e.mainBkg:e.primaryColor};
92
+ fill: ${c?e.mainBkg:e.primaryColor};
93
+ }
94
+
95
+ .arrow {
96
+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
97
+ stroke-width: ${ke.has(o)?e.strokeWidth:8};
98
+ stroke-linecap: round;
99
+ fill: none
100
+ }
101
+ .gitTitleText {
102
+ text-anchor: middle;
103
+ font-size: 18px;
104
+ fill: ${e.textColor};
105
+ }
106
+ `},"getStyles"),kt=Bt,Ot={parser:Ke,db:ue,renderer:ft,styles:kt};export{Ot as diagram};
@@ -0,0 +1 @@
1
+ import{Ci}from"./chunk-qy1zx2yw.js";export{Ci as createRadarServices};
@@ -1 +1 @@
1
- import{N,r,e,n,Ae,It,j,ie,Xi}from"./chunk-gcwhx3av.js";function T(s){let a=N(Ae);a?.useTheme?.();let t=s.payload,[i,m]=r(!1);if(!t||t.state==="pending")return null;let h=t.questions.map((o)=>o.header).join(" · "),l=t.state==="answered",u=l?j:It,d=l?"text-success":"text-faint",f=l?"已回答":t.state==="dismissed"?"已忽略提问":"提问已取消",p=l?C(t):h;if(a){let{Collapsible:o,CollapsibleTrigger:y,CollapsibleContent:v,Chevron:b,cn:g}=a;return n(o,{open:i,onOpenChange:m,className:"w-full text-xs text-ink/90 animate-fade",children:[n(y,{className:a.style("chat.timelineRow","cursor-pointer select-none"),children:[e("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e(u,{className:g("size-3.5",d)})}),e("span",{className:"shrink-0",children:f}),e("span",{className:"min-w-0 flex-1 truncate opacity-80",title:p,children:p}),e(b,{className:"size-3.5 shrink-0 text-faint opacity-0 transition-opacity group-hover/collapsible:opacity-100 group-data-[state=open]/collapsible:opacity-100"})]}),e(v,{children:e("div",{className:"mt-0.5 mb-1.5 ml-2 border-l border-line py-1 pl-[15px]",children:e(x,{question:t})})})]})}return n("div",{role:"status",className:"w-full animate-fade",children:[n("button",{type:"button","aria-expanded":i,className:"group -mx-2 flex w-[calc(100%+1rem)] cursor-pointer items-center gap-2 rounded-lg px-2 py-1 text-left text-[12.5px] text-faint transition-colors select-none hover:bg-raised/60 hover:text-dim",onClick:()=>m((o)=>!o),children:[e("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e(u,{className:`size-3.5 shrink-0 ${d}`})}),e("span",{className:"shrink-0",children:f}),e("span",{className:"min-w-0 flex-1 truncate opacity-80",title:p,children:p}),e(ie,{className:`size-3.5 shrink-0 text-faint opacity-0 transition-[opacity,transform] group-hover:opacity-100 ${i?"rotate-180 opacity-100":""}`})]}),i&&e("div",{className:"mt-0.5 mb-1.5 ml-2 border-l border-line py-1 pl-[15px]",children:e(x,{question:t})})]})}function c(s){if(!s)return"未作答";let a=s.selected.map((t)=>Xi(t).title);if(s.other)a.push(`其他:${s.other}`);return a.length?a.join("、"):"未作答"}function C(s){if(s.questions.length===1)return`${s.questions[0]?.header??""} · ${c(s.answers?.[0])}`;return s.questions.map((a,t)=>`${a.header} → ${c(s.answers?.[t])}`).join(";")}function x(s){let a=s.question;return e("div",{className:"space-y-2 text-xs",children:a.questions.map((t,i)=>n("div",{className:"space-y-0.5",children:[n("div",{className:"text-dim",children:[e("span",{className:"font-medium text-ink/90",children:t.header})," · ",t.question]}),e("div",{className:"text-ink",children:c(a.answers?.[i])})]},t.header))})}export{T as QuestionCard};
1
+ import{D,r,e,n,Ae,It,q,ie,ro}from"./chunk-ngt1j8py.js";function T(s){let a=D(Ae);a?.useTheme?.();let t=s.payload,[i,m]=r(!1);if(!t||t.state==="pending")return null;let h=t.questions.map((o)=>o.header).join(" · "),l=t.state==="answered",u=l?q:It,d=l?"text-success":"text-faint",f=l?"已回答":t.state==="dismissed"?"已忽略提问":"提问已取消",p=l?g(t):h;if(a){let{Collapsible:o,CollapsibleTrigger:y,CollapsibleContent:N,Chevron:v,cn:b}=a;return n(o,{open:i,onOpenChange:m,className:"w-full text-xs text-ink/90 animate-fade",children:[n(y,{className:a.style("chat.timelineRow","cursor-pointer select-none"),children:[e("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e(u,{className:b("size-3.5",d)})}),e("span",{className:"shrink-0",children:f}),e("span",{className:"min-w-0 flex-1 truncate opacity-80",title:p,children:p}),e(v,{className:"size-3.5 shrink-0 text-faint opacity-0 transition-opacity group-hover/collapsible:opacity-100 group-data-[state=open]/collapsible:opacity-100"})]}),e(N,{children:e("div",{className:"mt-0.5 mb-1.5 ml-2 border-l border-line py-1 pl-[15px]",children:e(x,{question:t})})})]})}return n("div",{role:"status",className:"w-full animate-fade",children:[n("button",{type:"button","aria-expanded":i,className:"group -mx-2 flex w-[calc(100%+1rem)] cursor-pointer items-center gap-2 rounded-lg px-2 py-1 text-left text-[12.5px] text-faint transition-colors select-none hover:bg-raised/60 hover:text-dim",onClick:()=>m((o)=>!o),children:[e("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e(u,{className:`size-3.5 shrink-0 ${d}`})}),e("span",{className:"shrink-0",children:f}),e("span",{className:"min-w-0 flex-1 truncate opacity-80",title:p,children:p}),e(ie,{className:`size-3.5 shrink-0 text-faint opacity-0 transition-[opacity,transform] group-hover:opacity-100 ${i?"rotate-180 opacity-100":""}`})]}),i&&e("div",{className:"mt-0.5 mb-1.5 ml-2 border-l border-line py-1 pl-[15px]",children:e(x,{question:t})})]})}function c(s){if(!s)return"未作答";let a=s.selected.map((t)=>ro(t).title);if(s.other)a.push(`其他:${s.other}`);return a.length?a.join("、"):"未作答"}function g(s){if(s.questions.length===1)return`${s.questions[0]?.header??""} · ${c(s.answers?.[0])}`;return s.questions.map((a,t)=>`${a.header} → ${c(s.answers?.[t])}`).join(";")}function x(s){let a=s.question;return e("div",{className:"space-y-2 text-xs",children:a.questions.map((t,i)=>n("div",{className:"space-y-0.5",children:[n("div",{className:"text-dim",children:[e("span",{className:"font-medium text-ink/90",children:t.header})," · ",t.question]}),e("div",{className:"text-ink",children:c(a.answers?.[i])})]},t.header))})}export{T as QuestionCard};
@@ -0,0 +1 @@
1
+ import{g,o,Y,i,r,f,e,n,y,qt,er,Ue,Mn,Ie,pn,ce,te,ia,Eo,oa}from"./chunk-ngt1j8py.js";function de(d){let{Button:b,confirm:L,PageLayout:x,Switch:_,cn:F,style:z}=y(),{connection:u,onOpen:O}=d,[D,p]=r([]),[w,H]=r([]),[q,J]=r([]),[I,T]=r(),[B,U]=r([]),[A,V]=r(!0),[k,N]=r(),[C,R]=r(),[W,P]=r(!1),[G,c]=r({}),s=i(0),E=g(async()=>{let t=++s.current;try{let[a,l,m,v]=await Promise.all([u.request("/api/automations"),u.request("/api/projects").catch(()=>[]),u.request("/api/info").catch(()=>{return}),u.request("/api/models").catch(()=>({models:[]}))]),ee=[...new Set(a.flatMap((h)=>h.lastSessionID?[h.lastSessionID]:[]))],ne=(await Promise.all(ee.map(async(h)=>u.request(`/api/sessions/${encodeURIComponent(h)}`).catch((j)=>{if(j instanceof Error&&"status"in j&&j.status===404)return;throw j})))).filter((h)=>h!==void 0);if(t!==s.current)return;if(p(a.sort((h,j)=>h.created-j.created)),H(l),J(ne),T(m),v?.models)U(v.models.map((h)=>h.id));N(void 0)}catch(a){if(t===s.current)N(a instanceof Error?a.message:"加载失败")}finally{if(t===s.current)V(!1)}},[u]);o(()=>(E(),()=>{s.current++}),[E]);let S=(t)=>{R(t),P(!0)},Q=async(t)=>{c((a)=>({...a,[t.id]:!0}));try{let a=await u.request(`/api/automations/${t.id}/run`,{method:"POST"});O(a.id)}catch(a){N(a instanceof Error?a.message:"运行失败")}finally{c((a)=>({...a,[t.id]:!1}))}},X=async(t)=>{if(!await L({title:`删除自动化「${t.name}」?`,description:"已经跑出来的会话会保留。",action:"删除",danger:!0}))return;try{await u.request(`/api/automations/${t.id}`,{method:"DELETE"}),p((l)=>l.filter((m)=>m.id!==t.id))}catch(l){N(l instanceof Error?l.message:"删除失败")}},Z=async(t,a)=>{try{let l=await u.request(`/api/automations/${t.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:a})});p((m)=>m.map((v)=>v.id===t.id?l:v))}catch(l){N(l instanceof Error?l.message:"状态切换失败")}};return n(x,{title:"自动化",description:n(f,{children:["到点自动开一个新会话执行提示词,跑完的结果在会话里查看。",I?.timezone&&n("span",{className:"text-faint",children:["按服务器时区 ",I.timezone,"。"]})]}),actions:n(b,{variant:"primary",onClick:()=>S(null),children:[e(ce,{className:"size-4"}),"新建"]}),children:[k&&e("div",{className:"mb-4 rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),A?e("div",{className:"flex justify-center py-12 text-xs text-faint",children:"正在加载自动化…"}):D.length===0?n("div",{className:z("surface.emptyDashed","animate-fade"),children:[e("div",{className:"grid size-11 place-items-center rounded-xl bg-raised text-dim",children:e(qt,{className:"size-5"})}),n("div",{children:[e("p",{className:"text-[15px] font-medium",children:"还没有自动化"}),e("p",{className:"mt-1 text-sm text-dim",children:"比如「每个工作日 9 点总结昨天的提交」。"})]}),n(b,{size:"sm",onClick:()=>S(null),className:"mt-1",children:[e(ce,{className:"size-3.5"}),"新建自动化"]})]}):e("ul",{className:"flex animate-fade flex-col gap-3",children:D.map((t)=>{let a=t.projectID?w.find((v)=>v.id===t.projectID):void 0,l=t.lastSessionID?q.find((v)=>v.id===t.lastSessionID):void 0,m=Boolean(G[t.id]);return e("li",{children:n("article",{className:z("surface.card","group p-4 transition-[border-color,box-shadow] duration-200 hover:border-line-strong hover:shadow-composer"),children:[n("div",{className:"flex items-start gap-3",children:[n("div",{className:F("min-w-0 flex-1 transition-opacity duration-200",!t.enabled&&"opacity-55"),children:[e("h2",{className:"truncate text-[15px] font-medium",children:t.name}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3.5 gap-y-1 text-[13px] text-dim",children:[n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[e(qt,{}),Eo(t.schedule)]}),n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[a?e(Ue,{}):e(Mn,{}),a?a.name:"聊天"]}),t.enabled&&t.nextRun!==null&&n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[e(er,{}),"下次 ",oa(t.nextRun)]})]})]}),e(_,{checked:t.enabled,label:t.enabled?"停用":"启用",onCheckedChange:(v)=>Z(t,v),className:"mt-0.5"})]}),e("p",{className:F("mt-3 line-clamp-2 text-sm leading-6 whitespace-pre-wrap text-faint transition-opacity duration-200",!t.enabled&&"opacity-55"),children:t.prompt}),n("div",{className:"mt-3 -mb-1 flex items-center gap-1",children:[n(b,{size:"sm",onClick:()=>Q(t),disabled:m,children:[e(pn,{className:"size-3.5"}),m?"正在启动…":"立即运行"]}),n(b,{size:"sm",variant:"ghost",onClick:()=>S(t),children:[e(Ie,{className:"size-3.5"}),"编辑"]}),n(b,{size:"sm",variant:"danger-ghost",onClick:()=>X(t),children:[e(te,{className:"size-3.5"}),"删除"]}),e("div",{className:"flex-1"}),t.lastRun!==null&&n("button",{type:"button",disabled:!l,onClick:()=>l&&O(l.id),className:"rounded-md px-1.5 py-1 text-[13px] text-faint transition-colors enabled:hover:bg-raised enabled:hover:text-ink",children:["上次运行 ",oa(t.lastRun),l?.archivedAt!=null?" · 已归档":"",!l?" · 会话已删除":""]})]})]})},t.id)})}),C!==void 0&&e(oe,{open:W,onOpenChange:P,automation:C??void 0,projects:w,models:B,timezone:I?.timezone,onSaved:(t)=>{p((a)=>{let l=a.findIndex((m)=>m.id===t.id);if(l>=0){let m=[...a];return m[l]=t,m}return[...a,t].sort((m,v)=>m.created-v.created)}),P(!1)},connection:u},C?.id??"new")]})}var M="custom",K="chat";function oe(d){let{Button:b,Dialog:L,Field:x,Form:_,FormError:F,Input:z,Select:u,Textarea:O}=y(),D=Y(),p=d.automation,[w,H]=r(p?.name??""),[q,J]=r(p?.prompt??""),[I,T]=r(p?.schedule??ia[0]?.cron??"0 9 * * *"),[B,U]=r(()=>!ia.some((c)=>c.cron===I)),[A,V]=r(p?.projectID??K),[k,N]=r(p?.model??""),[C,R]=r(!1),[W,P]=r();async function G(c){c.preventDefault(),R(!0),P(void 0);try{let s=A===K?void 0:A,E={name:w,prompt:q,schedule:I,model:k||void 0},S;if(p)S=await d.connection.request(`/api/automations/${p.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({...E,projectID:s??null})});else S=await d.connection.request("/api/automations",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...E,projectID:s})});d.onSaved(S)}catch(s){P(s instanceof Error?s.message:"保存失败")}finally{R(!1)}}return e(L,{open:d.open,onOpenChange:d.onOpenChange,title:d.automation?"编辑自动化":"新建自动化",size:"lg",footer:n(f,{children:[e("div",{className:"flex-1 max-sm:hidden"}),e(b,{onClick:()=>d.onOpenChange(!1),children:"取消"}),e(b,{type:"submit",form:D,variant:"primary",disabled:C,children:C?"正在保存…":d.automation?"保存":"创建"})]}),children:n(_,{id:D,onSubmit:G,children:[e(x,{label:"名称",children:(c)=>e(z,{id:c,autoFocus:!p,required:!0,value:w,onChange:(s)=>H(s.target.value),placeholder:"例如:每日提交总结"})}),e(x,{label:"提示词",hint:"没人盯着运行,写清楚要做什么、结果怎么汇报。",children:(c)=>e(O,{id:c,required:!0,value:q,onChange:(s)=>J(s.target.value),rows:5,placeholder:"总结昨天到现在的 git 提交,按模块分组,列出需要我关注的改动。"})}),n("div",{className:"grid gap-x-3 gap-y-4 sm:grid-cols-2",children:[e(x,{label:"时间",children:(c)=>e(u,{id:c,value:B?M:I,onValueChange:(s)=>{if(U(s===M),s!==M)T(s)},groups:[{options:ia.map((s)=>({value:s.cron,label:s.label}))},{options:[{value:M,label:"自定义(cron)"}]}]})}),e(x,{label:"在哪里运行",children:(c)=>e(u,{id:c,value:A,onValueChange:V,groups:[{options:[{value:K,label:"聊天",description:"不绑定目录",icon:e(Mn,{})}]},...d.projects.length?[{label:"项目",options:d.projects.map((s)=>({value:s.id,label:s.name,icon:e(Ue,{})}))}]:[]]})})]}),B&&e(x,{label:"cron 表达式",hint:`分 时 日 月 周,例如 30 8 * * 1-5 是工作日 8:30。${d.timezone?`按 ${d.timezone} 时间。`:""}`,children:(c)=>e(z,{id:c,required:!0,value:I,onChange:(s)=>T(s.target.value),spellCheck:!1,className:"font-mono"})}),d.models.length>0&&e(x,{label:"模型",children:(c)=>e(u,{id:c,value:k||"default",onValueChange:(s)=>N(s==="default"?"":s),groups:[{options:[{value:"default",label:"默认模型"},...d.models.map((s)=>({value:s,label:s}))]}]})}),e(F,{children:W})]})})}export{de as AutomationsPage};
@@ -0,0 +1 @@
1
+ import{_i}from"./chunk-frnh4zqf.js";export{_i as default};
@@ -0,0 +1 @@
1
+ import{g,o,i,r,f,e,n,y,bt,Q}from"./chunk-ngt1j8py.js";import{Or,$r,Br}from"./chunk-jke2ev6m.js";var ee={global:"全局",project:"项目",custom:"自定义",builtin:"内置"};function F({skill:s,issue:N,connection:S}){let{Button:E,CopyButton:d,style:v,useTheme:w}=y();w();let[p,L]=r(),[P,x]=r(),[D,z]=r(0);return o(()=>{let c=!0;x(void 0),L(void 0);let m=new URLSearchParams;if(s.projectID)m.set("projectID",s.projectID);if(s.location)m.set("location",s.location);let I=m.toString()?`?${m.toString()}`:"";return Promise.all([S.request(`/api/skills/${encodeURIComponent(s.name)}/content${I}`),S.request(`/api/skills/${encodeURIComponent(s.name)}/files${I}`)]).then(([b,O])=>{if(c)L({text:b.text,files:O.files})}).catch((b)=>{if(c)x(b instanceof Error?b.message:"读取失败")}),()=>{c=!1}},[S,s.name,s.projectID,s.location,D]),n("div",{className:"min-w-0 space-y-5 text-sm text-ink",children:[e("p",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere] text-dim",children:s.description||"暂无描述"}),n("div",{children:[n("p",{className:"break-all text-xs text-dim",children:[ee[s.scope],s.projectName?` · ${s.projectName}`:""]}),n("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[e("code",{className:v("markdown.inlineCode","min-w-0 flex-1 break-all text-xs"),children:s.location}),e(d,{text:s.location,label:"复制完整路径",className:"size-10"})]})]}),n("ul",{className:"space-y-1 break-words text-xs text-dim",children:[e("li",{children:"启用状态按名称生效,影响所有同名技能的新会话可用性。"}),s.disableModelInvocation&&e("li",{children:"仅手动:可由用户调用,不向模型自动提供。"}),s.platforms&&n("li",{children:["平台限制:",s.platforms.join("、")]}),s.disabled&&e("li",{children:"已禁用:不会提供给新会话。"}),N?.overriddenBy&&n("li",{className:"break-all",children:["被覆盖:同名技能优先使用 ",N.overriddenBy]})]}),s.commands?.length?n("div",{children:[e("h3",{className:"font-medium",children:"bin 命令"}),e("p",{className:"mt-1 text-xs text-dim",children:"技能目录中的可执行命令。"}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs",children:s.commands.map((c)=>e("li",{className:"break-all",children:c},c))})]}):null,P?n("div",{role:"alert",className:"space-y-2",children:[n("p",{className:"break-words text-danger",children:["读取失败:",P]}),e(E,{className:"h-10",onClick:()=>z(D+1),children:"重试"})]}):!p?e("p",{role:"status",className:"text-dim",children:"正在读取文件…"}):n(f,{children:[n("section",{children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e("h3",{className:"font-medium",children:"SKILL.md 原文"}),e(d,{text:p.text,label:"复制 SKILL.md 原文",className:"size-10"})]}),n("p",{className:"mb-2 text-xs text-faint",children:[p.text.length.toLocaleString()," 字符 · 约 ",Math.ceil(p.text.length/4).toLocaleString()," ","tokens(估算)"]}),e("pre",{className:v("surface.subtle",v("chat.toolOutput"),"rounded-lg bg-raised p-3 text-xs leading-5 break-all"),children:p.text})]}),n("section",{children:[n("h3",{className:"font-medium",children:["目录文件 · ",p.files.length,p.files.length===200?"(最多显示 200 个)":""]}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs text-dim",children:p.files.map((c)=>e("li",{className:"break-all",children:c},c))})]})]})]})}var A="all",G="non-project",te="size-4 cursor-pointer rounded border-line text-accent accent-accent focus-visible:outline-2 focus-visible:outline-accent";function me({connection:s}){let{Button:N,Select:S,Dialog:E,style:d,useTheme:v}=y();v();let[w,p]=r([]),[L,P]=r([]),[x,D]=r(A),[z,c]=r([]),[m,I]=r(),[b,O]=r(""),[k,B]=r(),[h,T]=r(!0),[K,R]=r(),[W,H]=r(),u=i(0),j=i(!1),C=g(async(t=!1)=>{let l=++u.current;j.current=!0,T(!0);try{if(t)await s.request("/api/skills/rescan",{method:"POST"});let[a,U,q]=await Promise.all([s.request("/api/skills?all=true"),s.request("/api/skills/settings"),s.request("/api/projects")]);if(l!==u.current)return;p(a.skills),P(q),c(a.issues),I(U),H(new Date),R(void 0)}catch(a){if(l===u.current)R(a instanceof Error?a.message:"读取失败")}finally{if(l===u.current)j.current=!1,T(!1)}},[s]);o(()=>(C(),()=>{u.current++}),[C]);async function V(t){if(j.current)return;j.current=!0;let l=++u.current;T(!0);try{let a=await s.request("/api/skills/settings",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(l!==u.current)return;I(a),await C()}catch(a){if(l!==u.current)return;R(a instanceof Error?a.message:"保存设置失败"),j.current=!1,T(!1)}}let X=b.trim().toLocaleLowerCase(),J=x===A?w:w.filter((t)=>{if(t.scope!=="project")return!0;return x!==G&&t.projectID===x}),M=J.filter((t)=>`${t.name} ${t.description??""}`.toLocaleLowerCase().includes(X)),_=(t)=>z.find((l)=>l.kind==="overridden"&&(l.path==="<built-in>"?t.scope==="builtin":l.path.replace(/\\/g,"/")===`${t.location.replace(/\\/g,"/")}/SKILL.md`));return n("div",{className:"min-w-0 space-y-6",children:[n("section",{className:"min-w-0",children:[n("div",{className:"mb-2.5 flex flex-wrap items-end justify-between gap-3 px-0.5",children:[n("div",{className:"min-w-0 flex-1 basis-48",children:[e("h2",{className:d("settings.groupTitle"),children:"技能"}),e("p",{"aria-live":"polite",className:d("settings.groupDesc"),children:W&&`找到 ${J.length} 个 · ${W.toLocaleTimeString("zh-CN",{hour12:!1})}`})]}),n("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e(S,{value:x,disabled:h,onValueChange:(t)=>{B(void 0),D(t)},groups:[{options:[{value:A,label:"全部来源"},{value:G,label:"非项目技能"}]},...Or(L)],className:"w-44"}),n(N,{variant:"ghost",disabled:h,onClick:()=>C(!0),className:"h-9 px-2.5 text-xs",children:[e(Q,{className:`size-3.5 ${h?"animate-spin":""}`}),e("span",{className:"ml-1",children:"重新扫描"})]})]})]}),K&&n("div",{role:"alert",className:"mb-3 flex flex-wrap items-center gap-2 rounded-xl border border-line p-3",children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法更新技能:",K]}),e(N,{disabled:h,onClick:()=>C(),children:"重试"})]}),e($r,{label:"搜索技能",placeholder:"搜索技能",value:b,onChange:O}),e("div",{className:d("settings.groupBox"),children:h&&!w.length?e(Br,{}):M.length===0?e("p",{className:"p-4 text-sm text-dim",children:"没有找到匹配的技能"}):e("ul",{className:"divide-y divide-line",children:M.map((t)=>{let l=_(t),a=t.disabled;return n("li",{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5 transition-colors hover:bg-raised/40 ${a?"opacity-55":""}`,children:[n("button",{type:"button",className:"group flex min-h-12 min-w-0 flex-1 cursor-pointer items-center gap-3 py-1 text-left focus-visible:outline-2 focus-visible:outline-accent","aria-label":`查看技能 ${t.name}`,onClick:()=>B(t),children:[n("span",{className:"min-w-0 flex-1",children:[n("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e("span",{className:"truncate text-sm font-medium text-ink",title:t.name,children:t.name}),l&&n("span",{className:"flex shrink-0 items-center gap-1 text-xs text-warning",children:[e(bt,{className:"size-3.5"}),"被覆盖"]})]}),t.description&&e("span",{className:"mt-0.5 block truncate text-xs text-dim",title:t.description,children:t.description})]}),e("span",{className:d("control.badge","shrink-0 text-[11px] text-dim"),children:t.scope==="project"?"项目":t.scope==="builtin"?"built-in":"全局"})]}),e("span",{className:"relative flex size-10 shrink-0 items-center justify-center",children:e("input",{type:"checkbox","aria-label":`启用技能 ${t.name}`,className:te,disabled:h,checked:!a,onChange:(U)=>{if(!m)return;let q=m.disabled??[],Y=U.target.checked?q.filter((Z)=>Z!==t.name):[...q,t.name];V({...m,disabled:Y})}})})]},`${t.scope}:${t.projectID??""}:${t.name}`)})})})]}),e(E,{open:Boolean(k),onOpenChange:(t)=>{if(!t)B(void 0)},title:k?.name??"",size:"lg",footer:e("div",{className:"flex w-full justify-end",children:e(N,{variant:"primary",onClick:()=>B(void 0),children:"关闭"})}),children:k&&e(F,{skill:k,issue:_(k),connection:s})})]})}export{me as SkillsSection};