@bkm016/basalt 0.1.6 → 0.1.8

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 (250) hide show
  1. package/README.md +3 -3
  2. package/{chunk-n981vx1t.js → chunk-0d51ggzj.js} +6 -6
  3. package/chunk-12trygzx.js +25 -0
  4. package/{chunk-s6dejhfj.js → chunk-26cz8et8.js} +1 -1
  5. package/{chunk-zxkq9m8e.js → chunk-2ek3wq4b.js} +2 -2
  6. package/chunk-2gcp3xdc.js +2 -0
  7. package/{chunk-x4874m8e.js → chunk-2ks2tnac.js} +2 -2
  8. package/{chunk-0javrjcm.js → chunk-2nrkqq45.js} +22 -22
  9. package/chunk-320174qe.js +2 -0
  10. package/{chunk-ey15ye2h.js → chunk-3hg7yn1t.js} +1 -1
  11. package/{chunk-benrzwea.js → chunk-3j2kkgsc.js} +1 -1
  12. package/{chunk-8x21n7y9.js → chunk-47vf66t6.js} +1 -1
  13. package/chunk-4n49ptbz.js +3 -0
  14. package/{chunk-7hr6zw2m.js → chunk-5gxj9560.js} +1 -1
  15. package/{chunk-g0t9c3gv.js → chunk-6vnjg5x9.js} +1 -1
  16. package/{chunk-dnx91jrd.js → chunk-7kjr9gdx.js} +2 -2
  17. package/{chunk-y8dkfpmj.js → chunk-7p6e2f5s.js} +3 -3
  18. package/{chunk-053vb71h.js → chunk-86xhmz7k.js} +1 -1
  19. package/{chunk-ebpyvs1d.js → chunk-91r5nvth.js} +2 -2
  20. package/{chunk-c7rcw9fb.js → chunk-adys4qq4.js} +4 -4
  21. package/{chunk-npez1492.js → chunk-ckjw3b61.js} +2 -2
  22. package/{chunk-f156y565.js → chunk-d37gemt2.js} +3 -3
  23. package/{chunk-j7yvh0ae.js → chunk-dcwdmpw2.js} +1 -1
  24. package/chunk-dvb5nd2x.js +2 -0
  25. package/{chunk-063vbmtp.js → chunk-e6c2mzxc.js} +2 -2
  26. package/{chunk-s7skpgm2.js → chunk-ef9yhnk3.js} +1 -1
  27. package/{chunk-ecf896fz.js → chunk-fpxc6qjr.js} +2 -2
  28. package/chunk-frt9k18g.js +480 -0
  29. package/{chunk-bdy4jksd.js → chunk-fzcmzbsq.js} +1 -1
  30. package/{chunk-q9dd6fhj.js → chunk-g3ed130w.js} +3 -3
  31. package/{chunk-d48bfd2e.js → chunk-h1kb8b49.js} +2 -2
  32. package/{chunk-arcqjt91.js → chunk-hd3x1w46.js} +1 -1
  33. package/{chunk-dpz4hwqb.js → chunk-j781n7ca.js} +2 -2
  34. package/{chunk-z02sj1je.js → chunk-jp5afrwm.js} +2 -2
  35. package/{chunk-r8vvcp6c.js → chunk-jyv9cae6.js} +1 -1
  36. package/{chunk-whj87h4r.js → chunk-k3q5jqjj.js} +3 -3
  37. package/{chunk-75434aay.js → chunk-k3rmjrf1.js} +1 -1
  38. package/{chunk-peja51xv.js → chunk-kgkrccr1.js} +2 -2
  39. package/{chunk-pg5nkf1y.js → chunk-kpvaqb7c.js} +2 -2
  40. package/{chunk-hksqjts3.js → chunk-ky55taar.js} +332 -289
  41. package/{chunk-10p3mb40.js → chunk-mr807v9n.js} +1 -1
  42. package/chunk-n015c8nx.js +2 -0
  43. package/chunk-ndt6rjt9.js +2 -0
  44. package/{chunk-gv7wqkey.js → chunk-nmtk9xra.js} +2 -2
  45. package/{chunk-d6p2hgxh.js → chunk-pehyqj8k.js} +1 -1
  46. package/{chunk-ca982n62.js → chunk-pkpj7s2k.js} +1 -1
  47. package/{chunk-fx7f4m3c.js → chunk-pn413hjw.js} +1 -1
  48. package/{chunk-6ptv4g5e.js → chunk-ppxv5q7y.js} +3 -3
  49. package/{chunk-8wj32837.js → chunk-qmdpgbg3.js} +1 -1
  50. package/{chunk-8wv5t0w6.js → chunk-rnt1ckk9.js} +6 -6
  51. package/{chunk-prgm07j4.js → chunk-t40fag3z.js} +2 -2
  52. package/{chunk-w67dvqtb.js → chunk-t66jqz12.js} +2 -2
  53. package/{chunk-39vwrg8n.js → chunk-v2srrqcv.js} +2 -2
  54. package/{chunk-n85qs7cs.js → chunk-x496kg3v.js} +1 -1
  55. package/{chunk-6kdgk70p.js → chunk-xjw78yey.js} +4 -4
  56. package/chunk-xy2bxwq8.js +2 -0
  57. package/{chunk-y69ewdn2.js → chunk-ypqjfv3a.js} +2 -2
  58. package/{chunk-f544p9rh.js → chunk-yyy2yp6f.js} +10 -10
  59. package/{chunk-8gw5bvh3.js → chunk-yzevjkms.js} +5 -5
  60. package/chunk-z3ch1wg6.js +16 -0
  61. package/chunk-zdyd8hbn.js +2 -0
  62. package/compiled.js +6 -6
  63. package/package.json +1 -1
  64. package/ui-test-worker.js +19 -19
  65. package/web/{chunk-rf9dt6bg.js → chunk-0j9a7811.js} +6 -6
  66. package/web/chunk-0jfda4jw.js +2 -0
  67. package/web/{chunk-z1geewdf.js → chunk-0zwc2rvh.js} +2 -2
  68. package/web/{chunk-ht1dzftc.js → chunk-1gx0zpmp.js} +7 -7
  69. package/web/{chunk-0gg00f86.js → chunk-1s8zg6fb.js} +51 -51
  70. package/web/chunk-2axwda8c.js +89 -0
  71. package/web/chunk-2p3fkhy8.js +1 -0
  72. package/web/{chunk-xvcfp1zh.js → chunk-33w36n91.js} +2 -2
  73. package/web/{chunk-5v44qv67.js → chunk-3q0v8w45.js} +81 -81
  74. package/web/chunk-3sz5qcwj.js +1 -0
  75. package/web/chunk-433c80pc.js +1 -0
  76. package/web/chunk-48cnmhvd.js +106 -0
  77. package/web/{chunk-da7m1kva.js → chunk-4anjs6yp.js} +2 -2
  78. package/web/chunk-5r37rwq1.js +4 -0
  79. package/web/{chunk-g81h1e6n.js → chunk-6e38yf3a.js} +23 -23
  80. package/web/{chunk-zp3qrrkb.js → chunk-7a4xk6j9.js} +72 -72
  81. package/web/chunk-7f1t7z72.js +2 -0
  82. package/web/chunk-7qq1ypvj.js +1 -0
  83. package/web/{chunk-h6k1x096.js → chunk-7tkgbbf9.js} +2 -2
  84. package/web/chunk-7x35g67d.js +78 -0
  85. package/web/{chunk-n1jpg57t.js → chunk-823b7866.js} +15 -15
  86. package/web/chunk-85gdsmt4.js +1 -0
  87. package/web/{chunk-gyp6v7jd.js → chunk-8773nwdc.js} +2 -2
  88. package/web/{chunk-cktmyc13.js → chunk-8dp7h6w8.js} +24 -24
  89. package/web/{chunk-czq1yz51.js → chunk-8nv7q5ac.js} +9 -9
  90. package/web/chunk-8pzg8qw4.js +1 -0
  91. package/web/chunk-8wg44w91.js +2 -0
  92. package/web/chunk-9p5dfvav.js +1 -0
  93. package/web/chunk-9q9w9pay.js +1 -0
  94. package/web/chunk-a3teqvz2.js +39 -0
  95. package/web/chunk-bd8ftfxn.js +3 -0
  96. package/web/chunk-c03bt2pz.js +1 -0
  97. package/web/chunk-c1ha2xg6.js +8 -0
  98. package/web/chunk-cez1k71m.js +1 -0
  99. package/web/chunk-cgng31df.js +1 -0
  100. package/web/chunk-cn0tmwjs.js +2 -0
  101. package/web/{chunk-jve1zc80.js → chunk-cn1xpg3q.js} +2 -2
  102. package/web/chunk-cvd4f51j.js +1 -0
  103. package/web/chunk-cybvxssy.js +1 -0
  104. package/web/{chunk-a7gtb4kg.js → chunk-cyjnert7.js} +19 -19
  105. package/web/{chunk-twdy2f67.js → chunk-d0m0h0eb.js} +1 -1
  106. package/web/{chunk-hy4m34qp.js → chunk-dgwkqcz6.js} +37 -37
  107. package/web/{chunk-kyawkpv2.js → chunk-dtg5yhhs.js} +1 -1
  108. package/web/chunk-dynajx8x.js +2 -0
  109. package/web/{chunk-t851gdjh.js → chunk-et8q775x.js} +4 -4
  110. package/web/chunk-f3vv7n52.js +1 -0
  111. package/web/{chunk-3de552rg.js → chunk-f93pe4kb.js} +15 -15
  112. package/web/{chunk-5nda24gv.js → chunk-fe31sv6t.js} +1 -1
  113. package/web/chunk-fpa81dv7.js +62 -0
  114. package/web/{chunk-nyn9tghz.js → chunk-fx4mackk.js} +9 -9
  115. package/web/chunk-g17n6asp.js +1 -0
  116. package/web/chunk-g9dzaw9e.js +30 -0
  117. package/web/chunk-gcwhx3av.js +1139 -0
  118. package/web/chunk-gf8vm6b5.js +1 -0
  119. package/web/chunk-gnmeyy4h.js +1 -0
  120. package/web/chunk-h5cfg3vv.js +2 -0
  121. package/web/{chunk-d6tbw8br.js → chunk-hbkasy6c.js} +46 -46
  122. package/web/chunk-hn7mhsbg.js +1 -0
  123. package/web/{chunk-12xxh71x.js → chunk-hstbgb83.js} +26 -26
  124. package/web/chunk-jjjtv2r1.js +2 -0
  125. package/web/chunk-jzte2phh.js +2 -0
  126. package/web/chunk-k8h8zx6r.js +24 -0
  127. package/web/chunk-m3ajw575.js +1 -0
  128. package/web/chunk-m5y2d4zv.js +1 -0
  129. package/web/chunk-mbwwj216.js +1 -0
  130. package/web/chunk-mf6xng5b.js +2 -0
  131. package/web/chunk-nky3bqfg.js +1 -0
  132. package/web/chunk-np33kmn4.js +1 -0
  133. package/web/chunk-nvk8mazs.js +1 -0
  134. package/web/chunk-nyw5ewgv.js +1 -0
  135. package/web/{chunk-dwajwrpk.js → chunk-p0cjvjdx.js} +1 -1
  136. package/web/chunk-p56dcqpr.js +1 -0
  137. package/web/chunk-pdn4r8x4.js +1 -0
  138. package/web/chunk-q1xxs319.js +41 -0
  139. package/web/chunk-qpt34d8d.js +1 -0
  140. package/web/{chunk-96v2avmw.js → chunk-qq2v8h6d.js} +7 -7
  141. package/web/chunk-qskt3tqa.js +1 -0
  142. package/web/chunk-qt3n897m.js +4 -0
  143. package/web/chunk-r1rt48h9.js +1 -0
  144. package/web/{chunk-ck8rr0sr.js → chunk-r4ffr96e.js} +1 -1
  145. package/web/chunk-r7tgd2fm.js +7 -0
  146. package/web/{chunk-x5s7zr5f.js → chunk-rbdvc8x7.js} +7 -7
  147. package/web/{chunk-v4yqrx5y.js → chunk-rkjkynm3.js} +33 -33
  148. package/web/chunk-rznszqmy.js +1 -0
  149. package/web/chunk-s1pefd34.js +1 -0
  150. package/web/chunk-s38s9ff9.js +370 -0
  151. package/web/{chunk-vw1pbv1x.js → chunk-s7e93552.js} +8 -8
  152. package/web/chunk-sc29azev.js +1 -0
  153. package/web/{chunk-9c1yt2ex.js → chunk-sda7cyrt.js} +52 -52
  154. package/web/chunk-svh2gkx8.js +2 -0
  155. package/web/chunk-t4jc4nac.js +1 -0
  156. package/web/chunk-t7g366a5.js +24 -0
  157. package/web/chunk-tj1fn8v2.js +1 -0
  158. package/web/{chunk-sy7e4dmq.js → chunk-tkp72r9b.js} +1 -1
  159. package/web/{chunk-xc2sq3t5.js → chunk-v14s4vgc.js} +1 -1
  160. package/web/chunk-v94v68xg.js +36 -0
  161. package/web/{chunk-0whceqes.js → chunk-vvvd3grf.js} +2 -2
  162. package/web/chunk-w37n09px.js +21 -0
  163. package/web/chunk-wcphswcx.js +2 -0
  164. package/web/{chunk-fxs4nb93.js → chunk-wj3ymejj.js} +38 -38
  165. package/web/chunk-wwcnvyjh.css +1 -0
  166. package/web/{chunk-s2920f21.js → chunk-xabcx3ry.js} +6 -6
  167. package/web/chunk-xb9m0092.js +1 -0
  168. package/web/chunk-xfd3b01q.js +1 -0
  169. package/web/{chunk-03dmzvaq.js → chunk-xqyazzm7.js} +17 -17
  170. package/web/{chunk-prvh9syp.js → chunk-xsz1dfm2.js} +23 -23
  171. package/web/chunk-z0zrp8n8.js +1 -0
  172. package/web/index.html +1 -1
  173. package/worker.js +1 -1
  174. package/chunk-8saewt61.js +0 -3
  175. package/chunk-a0c989ky.js +0 -2
  176. package/chunk-a5apjjcn.js +0 -16
  177. package/chunk-a81p46j7.js +0 -2
  178. package/chunk-agsfy9w7.js +0 -2
  179. package/chunk-d20p02ny.js +0 -2
  180. package/chunk-ejsneb6f.js +0 -2
  181. package/chunk-fmq3zwzk.js +0 -2
  182. package/chunk-rfb85nj7.js +0 -2
  183. package/chunk-rfdt992v.js +0 -25
  184. package/chunk-tgfbtehh.js +0 -480
  185. package/web/chunk-0fgaepwm.js +0 -3
  186. package/web/chunk-0pecj6d7.js +0 -1
  187. package/web/chunk-0wt1dgny.js +0 -1
  188. package/web/chunk-1ves7sq5.js +0 -1
  189. package/web/chunk-1yj79b48.js +0 -1
  190. package/web/chunk-296hgy6k.js +0 -370
  191. package/web/chunk-2bmq1whf.js +0 -1
  192. package/web/chunk-2wqxhqr9.js +0 -1
  193. package/web/chunk-30zfw7zg.js +0 -1
  194. package/web/chunk-39ng8zwx.css +0 -1
  195. package/web/chunk-3nbzj48p.js +0 -36
  196. package/web/chunk-3zebd9fq.js +0 -7
  197. package/web/chunk-4r1n98zx.js +0 -2
  198. package/web/chunk-59678wmg.js +0 -1
  199. package/web/chunk-5wdk97mk.js +0 -4
  200. package/web/chunk-64rafq66.js +0 -78
  201. package/web/chunk-6kkw9ptc.js +0 -1
  202. package/web/chunk-718mr5gc.js +0 -2
  203. package/web/chunk-7hs57qdr.js +0 -1
  204. package/web/chunk-7kp237t3.js +0 -106
  205. package/web/chunk-86p42kym.js +0 -1
  206. package/web/chunk-8n79cqyd.js +0 -1
  207. package/web/chunk-9an6wcnr.js +0 -1
  208. package/web/chunk-9w5tf22s.js +0 -1
  209. package/web/chunk-b985y17w.js +0 -2
  210. package/web/chunk-bz2v64xe.js +0 -1
  211. package/web/chunk-c3nn0vvc.js +0 -1
  212. package/web/chunk-cb2rxtq9.js +0 -2
  213. package/web/chunk-cm92fyr3.js +0 -2
  214. package/web/chunk-cwtn2kdm.js +0 -1
  215. package/web/chunk-d4z2rgpx.js +0 -1
  216. package/web/chunk-dpkyygej.js +0 -1
  217. package/web/chunk-et5ess72.js +0 -1
  218. package/web/chunk-ez8b6neq.js +0 -1
  219. package/web/chunk-f5txt81n.js +0 -2
  220. package/web/chunk-fd1kqwe3.js +0 -1
  221. package/web/chunk-fp48zz2e.js +0 -2
  222. package/web/chunk-fx0n2g22.js +0 -89
  223. package/web/chunk-g6k9z8zt.js +0 -1
  224. package/web/chunk-gsh80797.js +0 -41
  225. package/web/chunk-hs5x78fb.js +0 -1
  226. package/web/chunk-hyd5hzpa.js +0 -1
  227. package/web/chunk-hyt1nkaw.js +0 -1
  228. package/web/chunk-j6a4z530.js +0 -1139
  229. package/web/chunk-kegv14sg.js +0 -2
  230. package/web/chunk-kw9emsqw.js +0 -1
  231. package/web/chunk-m2prjwk3.js +0 -4
  232. package/web/chunk-m9bzz9m0.js +0 -19
  233. package/web/chunk-mqsyzzgt.js +0 -30
  234. package/web/chunk-nywdeb4m.js +0 -2
  235. package/web/chunk-pxkhm40r.js +0 -2
  236. package/web/chunk-q9ekgjh6.js +0 -62
  237. package/web/chunk-r3mj50zs.js +0 -1
  238. package/web/chunk-sc0ghp25.js +0 -24
  239. package/web/chunk-t74r2n8h.js +0 -1
  240. package/web/chunk-t9mvsgt9.js +0 -1
  241. package/web/chunk-vf4vkcf9.js +0 -24
  242. package/web/chunk-vnt34mkb.js +0 -1
  243. package/web/chunk-vtxw9rmr.js +0 -1
  244. package/web/chunk-x19v2sxv.js +0 -1
  245. package/web/chunk-y21zy3eh.js +0 -1
  246. package/web/chunk-ya3ghn3n.js +0 -2
  247. package/web/chunk-yd74yxzt.js +0 -8
  248. package/web/chunk-z4ha8181.js +0 -1
  249. package/web/chunk-z8rarqe6.js +0 -1
  250. package/web/chunk-zsxw5fj7.js +0 -39
@@ -1,106 +0,0 @@
1
- import{yn}from"./chunk-nywdeb4m.js";import{G}from"./chunk-ya3ghn3n.js";import{e,a,D,b,v,C,S,E,T,A,R,L,l,kr,p,ji,U,M}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";var k={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ce=D.gitGraph,J=e(()=>U({...Ce,...b().gitGraph}),"getConfig"),m=new yn(()=>{let t=J(),{mainBranchName:r,mainBranchOrder:o}=t;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 ji({length:7})}e(ne,"getID");function pe(t,r){let o=Object.create(null);return t.reduce((c,i)=>{let h=r(i);if(!o[h])o[h]=!0,c.push(i);return c},[])}e(pe,"uniqBy");var ve=e(function(t){m.records.direction=t},"setDirection"),Ee=e(function(t){a.debug("options str",t),t=t?.trim(),t=t||"{}";try{m.records.options=JSON.parse(t)}catch(r){a.error("error while parsing gitGraph options",r.message)}},"setOptions"),Te=e(function(){return m.records.options},"getOptions"),Le=e(function(t){let{msg:r,id:o,type:c,tags:i}=t;a.info("commit",r,o,c,i),a.debug("Entering commit:",r,o,c,i);let h=J();o=v.sanitizeText(o,h),r=v.sanitizeText(r,h),i=i?.map((s)=>v.sanitizeText(s,h));let n={id:o?o:m.records.seq+"-"+ne(),message:r,seq:m.records.seq++,type:c??k.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=e(function(t){let{name:r,order:o}=t;if(r=v.sanitizeText(r,J()),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=e((t)=>{let{branch:r,id:o,type:c,tags:i}=t,h=J();if(r=v.sanitizeText(r,h),o)o=v.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 x=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,x],branch:m.records.currBranch,type:k.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=e(function(t){let{id:r,targetId:o,tags:c,parent:i}=t;a.debug("Entering cherryPick:",r,o,c);let h=J();if(r=v.sanitizeText(r,h),o=v.sanitizeText(o,h),c=c?.map((g)=>v.sanitizeText(g,h)),i=v.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===k.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 x={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:k.CHERRY_PICK,tags:c?c.filter(Boolean):[`cherry-pick:${n.id}${n.type===k.MERGE?`|parent:${i}`:""}`]};m.records.head=x,m.records.commits.set(x.id,x),m.records.branches.set(m.records.currBranch,x.id),a.debug(m.records.branches),a.debug("in cherryPick")}},"cherryPick"),ye=e(function(t){if(t=v.sanitizeText(t,J()),!m.records.branches.has(t)){let r=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}else{m.records.currBranch=t;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(t,r,o){let c=t.indexOf(r);if(c===-1)t.push(o);else t.splice(c,1,o)}e(he,"upsert");function me(t){let r=t.reduce((i,h)=>{if(i.seq>h.seq)return i;return h},t[0]),o="";t.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(t,r,i),r.parents[1])t.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(t,r,i)}t=pe(t,(i)=>i.id),me(t)}e(me,"prettyPrintCommitHistory");var Oe=e(function(){a.debug(m.records.commits);let t=xe()[0];me([t])},"prettyPrint"),Ie=e(function(){m.reset(),C()},"clear"),_e=e(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=e(function(){return m.records.branches},"getBranches"),De=e(function(){return m.records.commits},"getCommits"),xe=e(function(){let t=[...m.records.commits.values()];return t.forEach(function(r){a.debug(r.id)}),t.sort((r,o)=>r.seq-o.seq),t},"getCommitsArray"),We=e(function(){return m.records.currBranch},"getCurrentBranch"),qe=e(function(){return m.records.direction},"getDirection"),Ae=e(function(){return m.records.head},"getHead"),ue={commitType:k,getConfig:J,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:R,getDiagramTitle:L},He=e((t,r)=>{if(G(t,r),t.dir)r.setDirection(t.dir);for(let o of t.statements)Se(o,r)},"populate"),Se=e((t,r)=>{let c={Commit:e((i)=>r.commit(Ne(i)),"Commit"),Branch:e((i)=>r.branch(Fe(i)),"Branch"),Merge:e((i)=>r.merge(ze(i)),"Merge"),Checkout:e((i)=>r.checkout(Ye(i)),"Checkout"),CherryPicking:e((i)=>r.cherryPick(je(i)),"CherryPicking")}[t.$type];if(c)c(t);else a.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ne=e((t)=>({id:t.id,msg:t.message??"",type:t.type!==void 0?k[t.type]:k.NORMAL,tags:t.tags??void 0}),"parseCommit"),Fe=e((t)=>({name:t.name,order:t.order??0}),"parseBranch"),ze=e((t)=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?k[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Ye=e((t)=>t.branch,"parseCheckout"),je=e((t)=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Ke={parse:e(async(t)=>{let r=await X("gitGraph",t);a.debug(r),He(r,ue)},"parse")},j=10,K=40,N=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=e((t,r,o=!1)=>{if(o&&t>0)return(t-1)%(r-1)+1;return t%r},"calcColorIndex"),W=new Map,q=new Map,oe=30,te=new Map,se=[],Y=0,w="LR",Ve=e(()=>{W.clear(),q.clear(),te.clear(),Y=0,se=[],w="LR"},"clear"),be=e((t)=>{let r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t==="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).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=e((t)=>{let r,o,c;if(w==="BT")o=e((i,h)=>i<=h,"comparisonFunc"),c=1/0;else o=e((i,h)=>i>=h,"comparisonFunc"),c=0;return t.forEach((i)=>{let h=w==="TB"||w=="BT"?q.get(i)?.y:q.get(i)?.x;if(h!==void 0&&o(h,c))r=i,c=h}),r},"findClosestParent"),Ze=e((t)=>{let r="",o=1/0;return t.forEach((c)=>{let i=q.get(c).y;if(i<=o)r=c,o=i}),r||void 0},"findClosestParentBT"),Xe=e((t,r,o)=>{let c=o,i=o,h=[];t.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)}),t.forEach((n)=>{let s=r.get(n);if(s?.parents.length){let g=Ze(s.parents);if(c=q.get(g).y-K,c<=i)i=c;let y=W.get(s.branch).pos,x=c-j;q.set(s.id,{x:y,y:x})}})},"setParallelBTPos"),Je=e((t)=>{let r=we(t.parents.filter((c)=>c!==null));if(!r)throw Error(`Closest parent not found for commit ${t.id}`);let o=q.get(r)?.y;if(o===void 0)throw Error(`Closest parent position not found for commit ${t.id}`);return o},"findClosestParentPos"),Qe=e((t)=>Je(t)+K,"calculateCommitPosition"),et=e((t,r)=>{let o=W.get(t.branch);if(!o)throw Error(`Branch not found for commit ${t.id}`);let c=o.pos,i=r+j;return q.set(t.id,{x:c,y:i}),{x:c,y:i}},"setCommitPosition"),tt=e((t,r,o)=>{let c=W.get(t.branch);if(!c)throw Error(`Branch not found for commit ${t.id}`);let i=r+o,h=c.pos;q.set(t.id,{x:h,y:i})},"setRootPosition"),rt=e((t,r,o,c,i,h)=>{let{theme:n}=l(),s=ce.has(n??""),g=ge.has(n??""),y=Ue.has(n??"");if(h===k.HIGHLIGHT)t.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`),t.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===k.CHERRY_PICK)t.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",s?7:10).attr("class",`commit ${r.id} ${c}`),t.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}`),t.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}`),t.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}`),t.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 x=t.append("circle");if(x.attr("cx",o.x),x.attr("cy",o.y),x.attr("r",s?7:10),x.attr("class",`commit ${r.id} commit${Z(i,V,g)}`),h===k.MERGE){let f=t.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===k.REVERSE){let f=t.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=e((t,r,o,c,i)=>{if(r.type!==k.CHERRY_PICK&&(r.customId&&r.type===k.MERGE||r.type!==k.MERGE)&&i.showCommitLabel){let h=t.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),w==="TB"||w==="BT")n.attr("x",o.x-(g.width+4*N+5)).attr("y",o.y-12),s.attr("x",o.x-(g.width+4*N)).attr("y",o.y+g.height-12);else s.attr("x",o.posWithOffset-g.width/2);if(i.rotateCommitLabel)if(w==="TB"||w==="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,x=10+g.width/25*8.5;h.attr("transform","translate("+y+", "+x+") rotate(-45, "+c+", "+o.y+")")}}}},"drawCommitLabel"),ot=e((t,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=t.insert("polygon"),x=t.append("circle"),f=t.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:x,rect:y,yOffset:i}),i+=20}for(let{tag:g,hole:y,rect:x,yOffset:f}of s){let d=n/2,B=o.y-19.2-f;if(x.attr("class","tag-label-bkg").attr("points",`
2
- ${c-h/2-N/2},${B+z}
3
- ${c-h/2-N/2},${B-z}
4
- ${o.posWithOffset-h/2-N},${B-d-z}
5
- ${o.posWithOffset+h/2+N},${B-d-z}
6
- ${o.posWithOffset+h/2+N},${B+d+z}
7
- ${o.posWithOffset-h/2-N},${B+d+z}`),y.attr("cy",B).attr("cx",c-h/2+N/2).attr("r",1.5).attr("class","tag-hole"),w==="TB"||w==="BT"){let u=c+f;x.attr("class","tag-label-bkg").attr("points",`
8
- ${o.x},${u+2}
9
- ${o.x},${u-2}
10
- ${o.x+j},${u-d-2}
11
- ${o.x+j+h+4},${u-d-2}
12
- ${o.x+j+h+4},${u+d+2}
13
- ${o.x+j},${u+d+2}`).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),y.attr("cx",o.x+N/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),g.attr("x",o.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+o.x+","+c+")")}}}},"drawCommitTags"),st=e((t)=>{switch(t.customType??t.type){case k.NORMAL:return"commit-normal";case k.REVERSE:return"commit-reverse";case k.HIGHLIGHT:return"commit-highlight";case k.MERGE:return"commit-merge";case k.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),nt=e((t,r,o,c)=>{let i={x:0,y:0};if(t.parents.length>0){let h=we(t.parents);if(h){let n=c.get(h)??i;if(r==="TB")return n.y+K;else if(r==="BT")return(c.get(t.id)??i).y-K;else return n.x+K}}else if(r==="TB")return oe;else if(r==="BT")return(c.get(t.id)??i).y-K;else return 0;return 0},"calculatePosition"),ct=e((t,r,o)=>{let c=w==="BT"&&o?r:r+j,i=W.get(t.branch)?.pos,h=w==="TB"||w==="BT"?W.get(t.branch)?.pos:c;if(h===void 0||i===void 0)throw Error(`Position were undefined for commit ${t.id}`);let n=ce.has(l().theme??""),s=w==="TB"||w==="BT"?c:i+(n?le/2+1:-2);return{x:h,y:s,posWithOffset:c}},"getCommitPosition"),$e=e((t,r,o,c)=>{let i=t.append("g").attr("class","commit-bullets"),h=t.append("g").attr("class","commit-labels"),n=w==="TB"||w==="BT"?oe:0,s=[...r.keys()],g=c.parallelCommits??!1,y=e((f,d)=>{let B=r.get(f)?.seq,u=r.get(d)?.seq;return B!==void 0&&u!==void 0?B-u:0},"sortKeys"),x=s.sort(y);if(w==="BT"){if(g)Xe(x,r,n);x=x.reverse()}x.forEach((f)=>{let d=r.get(f);if(!d)throw Error(`Commit not found for key ${f}`);if(g)n=nt(d,w,n,q);let B=ct(d,n,g);if(o){let u=st(d),P=d.customType??d.type,O=W.get(d.branch)?.index??0;rt(i,d,B,u,O,P),at(h,d,B,n,c),ot(h,d,B,n)}if(w==="TB"||w==="BT")q.set(d.id,{x:B.x,y:B.posWithOffset});else q.set(d.id,{x:B.posWithOffset,y:B.y});if(n=w==="BT"&&g?n+K:n+K+j,n>Y)Y=n})},"drawCommits"),it=e((t,r,o,c,i)=>{let n=(w==="TB"||w==="BT"?o.x<c.x:o.y<c.y)?r.branch:t.branch,s=e((y)=>y.branch===n,"isOnBranchToGetCurve"),g=e((y)=>y.seq>t.seq&&y.seq<r.seq,"isBetweenCommits");return[...i.values()].some((y)=>g(y)&&s(y))},"shouldRerouteArrow"),re=e((t,r,o=0)=>{let c=t+Math.abs(t-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(t-r);return re(t,r-h/5,o+1)},"findLane"),dt=e((t,r,o,c)=>{let{theme:i}=l(),h=ge.has(i??""),n=q.get(r.id),s=q.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="",x="",f=0,d=0,B=W.get(o.branch)?.index;if(o.type===k.MERGE&&r.id!==o.parents[0])B=W.get(r.branch)?.index;let u;if(g){y="A 10 10, 0, 0, 0,",x="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(w==="TB")if(n.x<s.x)u=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${x} ${O} ${n.y+d} L ${O} ${s.y-f} ${y} ${O+d} ${s.y} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${y} ${O} ${n.y+d} L ${O} ${s.y-f} ${x} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(w==="BT")if(n.x<s.x)u=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${y} ${O} ${n.y-d} L ${O} ${s.y+f} ${x} ${O+d} ${s.y} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${x} ${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)u=`M ${n.x} ${n.y} L ${n.x} ${P-f} ${y} ${n.x+d} ${P} L ${s.x-f} ${P} ${x} ${s.x} ${P+d} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${n.x} ${P+f} ${x} ${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,",x="A 20 20, 0, 0, 1,",f=20,d=20,w==="TB"){if(n.x<s.x)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${x} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${x} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else u=`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)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else if(w==="BT"){if(n.x<s.x)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${x} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else u=`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,",x="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${y} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${x} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x===s.x)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else{if(n.y<s.y)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${x} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;else u=`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===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${x} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y===s.y)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}if(u===void 0)throw Error("Line definition not found");t.append("path").attr("d",u).attr("class","arrow arrow"+Z(B,V,h))},"drawArrow"),ht=e((t,r)=>{let o=t.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=e((t,r,o,c)=>{let{look:i,theme:h,themeVariables:n}=l(),{dropShadow:s,THEME_COLOR_LIMIT:g}=n,y=ce.has(h??""),x=ge.has(h??""),f=t.append("g");r.forEach((d,B)=>{let u=Z(B,y?g:V,x),P=W.get(d.name)?.pos;if(P===void 0)throw Error(`Position not found for branch ${d.name}`);let O=w==="TB"||w==="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"+u),w==="TB")I.attr("y1",oe),I.attr("x1",P),I.attr("y2",Y),I.attr("x2",P);else if(w==="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),H=f.insert("rect"),F=f.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);F.node().appendChild(ee);let _=ee.getBBox(),fe=y?0:4,ae=y?16:0,Q=y?le:0;if(i==="neo")H.attr("data-look","neo");if(H.attr("class","branchLabelBkg label"+u).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)+")"),w==="TB"){if(H.attr("x",P-_.width/2-10).attr("y",0),F.attr("transform","translate("+(P-_.width/2-5)+", 0)"),y)H.attr("transform",`translate(${-ae/2-3}, ${-Q-10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(-Q*2+7)+")")}else if(w==="BT"){if(H.attr("x",P-_.width/2-10).attr("y",Y),F.attr("transform","translate("+(P-_.width/2-5)+", "+Y+")"),y)H.attr("transform",`translate(${-ae/2-3}, ${Q+10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(Y+Q*2+4)+")")}else H.attr("transform","translate(-19, "+(O-12-Q/2)+")")})},"drawBranches"),mt=e(function(t,r,o,c,i){return W.set(t,{pos:r,index:o}),r+=50+(i?40:0)+(w==="TB"||w==="BT"?c.width/2:0),r},"setBranchPosition"),gt=e(function(t,r,o,c){Ve(),a.debug("in gitgraph renderer",t+`
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();w=i.getDirection();let g=p(`[id="${r}"]`),{look:y,theme:x,themeVariables:f}=l(),{useGradient:d,gradientStart:B,gradientStop:u,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",B).attr("stop-opacity",1),I.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}if(y==="neo"&&ce.has(x??""))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),H=g.append("g"),de=H.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(),H.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=e((t)=>{let{svgId:r}=t,o="";if(t.useGradient&&r)for(let c=0;c<t.THEME_COLOR_LIMIT;c++)o+=`
15
- .label${c} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}
16
- `;return o},"genGitGraphGradient"),bt=e((t)=>{let r=b(),{theme:o,themeVariables:c}=r,{borderColorArray:i}=c,h=ke.has(o);if(pt.has(o)){let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
17
- .branch-label${s} { fill: ${t.nodeBorder};}
18
- .commit${s} { stroke: ${t.nodeBorder}; }
19
- .commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
20
- .arrow${s} { stroke: ${t.nodeBorder}; }
21
- .commit-bullets { fill: ${t.nodeBorder}; }
22
- .commit-cherry-pick${s} { stroke: ${t.nodeBorder}; }
23
- ${ut(t)}`;else{let g=s%Be;n+=`
24
- .branch-label${s} { fill: ${t["gitBranchLabel"+g]}; }
25
- .commit${s} { stroke: ${t["git"+g]}; fill: ${t["git"+g]}; }
26
- .commit-highlight${s} { stroke: ${t["gitInv"+g]}; fill: ${t["gitInv"+g]}; }
27
- .arrow${s} { stroke: ${t["git"+g]}; }
28
- `}return n}else if(!$t.has(o)){let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)n+=`
29
- .branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.noteFontWeight}`:""} }
30
- .commit${s} { stroke: ${t.nodeBorder}; }
31
- .commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
32
- .label${s} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${h?`font-weight:${t.noteFontWeight}`:""}}
33
- .arrow${s} { stroke: ${t.nodeBorder}; }
34
- .commit-bullets { fill: ${t.nodeBorder}; }
35
- .commit-cherry-pick${s} { stroke: ${t.nodeBorder}; }
36
- `;return n}else{let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
37
- .branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.noteFontWeight}`:""} }
38
- .commit${s} { stroke: ${t.nodeBorder}; }
39
- .commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }
40
- .label${s} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${h?`font-weight:${t.noteFontWeight}`:""} }
41
- .arrow${s} { stroke: ${t.nodeBorder}; }
42
- .commit-bullets { fill: ${t.nodeBorder}; }
43
- `;else{let g=s%i.length;n+=`
44
- .branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.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)?t.mainBkg:i[g]}; stroke: ${i[g]}; stroke-width: ${t.strokeWidth}; }
48
- .arrow${s} { stroke: ${i[g]}; }
49
- `}return n}},"genColor"),wt=e((t)=>`${Array.from({length:t.THEME_COLOR_LIMIT},(r,o)=>o).map((r)=>{let o=r%Be;return`
50
- .branch-label${r} { fill: ${t["gitBranchLabel"+o]}; }
51
- .commit${r} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }
52
- .commit-highlight${r} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }
53
- .label${r} { fill: ${t["git"+o]}; }
54
- .arrow${r} { stroke: ${t["git"+o]}; }
55
- `}).join(`
56
- `)}`,"normalTheme"),Bt=e((t)=>{let r=b(),{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(t):wt(t)}
67
-
68
- .branch {
69
- stroke-width: ${t.strokeWidth};
70
- stroke: ${t.commitLineColor??t.lineColor};
71
- stroke-dasharray: ${c?"4 2":"2"};
72
- }
73
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${c?t.nodeBorder:t.commitLabelColor}; ${c?`font-weight:${t.noteFontWeight};`:""}}
74
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${c?"transparent":t.commitLabelBackground}; opacity: ${c?"":0.5}; }
75
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
76
- .tag-label-bkg { fill: ${c?t.mainBkg:t.tagLabelBackground}; stroke: ${c?t.nodeBorder:t.tagLabelBorder}; ${c?`filter:${t.dropShadow}`:""} }
77
- .tag-hole { fill: ${t.textColor}; }
78
-
79
- .commit-merge {
80
- stroke: ${c?t.mainBkg:t.primaryColor};
81
- fill: ${c?t.mainBkg:t.primaryColor};
82
- }
83
- .commit-reverse {
84
- stroke: ${c?t.mainBkg:t.primaryColor};
85
- fill: ${c?t.mainBkg:t.primaryColor};
86
- stroke-width: ${c?t.strokeWidth:3};
87
- }
88
- .commit-highlight-outer {
89
- }
90
- .commit-highlight-inner {
91
- stroke: ${c?t.mainBkg:t.primaryColor};
92
- fill: ${c?t.mainBkg:t.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)?t.strokeWidth:8};
98
- stroke-linecap: round;
99
- fill: none
100
- }
101
- .gitTitleText {
102
- text-anchor: middle;
103
- font-size: 18px;
104
- fill: ${t.textColor};
105
- }
106
- `},"getStyles"),kt=Bt,Ot={parser:Ke,db:ue,renderer:ft,styles:kt};export{Ot as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-5v44qv67.js";import"./chunk-xvcfp1zh.js";import"./chunk-b985y17w.js";import{eo}from"./chunk-5wdk97mk.js";export{eo as render};
@@ -1 +0,0 @@
1
- import{Ei}from"./chunk-cktmyc13.js";export{Ei as createEventModelingServices};
@@ -1 +0,0 @@
1
- import{e,a}from"./chunk-5v44qv67.js";import{K,Dt,Mt}from"./chunk-fx0n2g22.js";import{G}from"./chunk-ya3ghn3n.js";import{ar,kt}from"./chunk-cktmyc13.js";var o=ar().Railroad.parser.LangiumParser,n=e((r)=>{switch(r.$type){case"RailroadTerminalExpr":return{type:"terminal",value:r.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:r.name};case"RailroadSpecialExpr":return{type:"special",text:r.text};case"RailroadSequenceExpr":{let t=r.elements.map(n);return t.length===1?t[0]:{type:"sequence",elements:t}}case"RailroadChoiceExpr":{let t=r.alternatives.map(n);return t.length===1?t[0]:{type:"choice",alternatives:t}}case"RailroadOptionalExpr":return{type:"optional",element:n(r.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:n(r.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:n(r.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${r.$type}`)}},"transformExpression"),l=e((r)=>({name:r.name,definition:n(r.definition)}),"transformRule"),s=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(l(t)))},"populateDb"),m={parse:e((r)=>{K.clear(),a.debug("[Railroad Parser] Starting Langium parse");let t=o.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let i=t.value;a.debug("[Railroad Parser] Parsed rules:",i.rules.length),s(i),a.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:K}},R={parser:m,db:K,renderer:Mt,styles:Dt};export{R as diagram};
@@ -1 +0,0 @@
1
- import{Jn}from"./chunk-gyp6v7jd.js";export{Jn as default};
@@ -1,2 +0,0 @@
1
- import{e,a,b,l,M,P,Tt,Et,yo,yt,tn,vo,Yn,Pe,bo,Wi,At,Gi,nn,Xn}from"./chunk-5v44qv67.js";import{te}from"./chunk-xvcfp1zh.js";import{x}from"./chunk-j6a4z530.js";function la(t,{edgePathsClass:r="edges edgePaths"}={}){let n=t.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),u=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:u,rootGroups:n}}e(la,"createLayoutElementGroups");async function D(t,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await P(t,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}e(D,"measureGroupLabel");async function ca(t,r,n){let i=await Et(t,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}e(ca,"insertMeasuredNode");function S(t,r,n){let i=t,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}e(S,"resolveNodeDir");async function k(t,r,n={}){let i=new te({multigraph:!0,compound:!0}),s=[...r.edges],o=l(),u=la(t),{edgeLabels:d,nodes:c}=u,g=new Map,h=new Map(r.nodes.map((f)=>[f.id,f])),C=r.direction,w=t.node()!=null;await Promise.all(r.nodes.map(async(f)=>{if(f.isGroup){if(w){let p=n.unwrapGroupLabels&&f.labelType!=="markdown";await D(c,f,p?Number.POSITIVE_INFINITY:void 0)}i.setNode(f.id,{...f})}else{if(w){let p=await ca(c,f,{config:o,dir:S(f,h,C)});g.set(f.id,p)}i.setNode(f.id,{...f})}}));for(let f of s){if(w&&Wi(f))await At(d,f);if(i.setEdge(f.start,f.end,{...f},f.id),!r.edges.some((E)=>E.id===f.id))r.edges.push(f)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await (x("d4z2rgpx"),import("./chunk-d4z2rgpx.js"));f(t,r)}return{graph:i,groups:u,nodeElements:g}}e(k,"createGraphWithElements");var W=new Map,m=new Map,R=new Map,U=e(()=>{m.clear(),R.clear(),W.clear()},"clear"),v=e((t,r)=>{let n=m.get(r)||[];return a.trace("In isDescendant",r," ",t," = ",n.includes(t)),n.includes(t)},"isDescendant"),Z=e((t,r)=>{let n=m.get(r)||[];if(a.info("Descendants of ",r," is ",n),a.info("Edge is ",t),t.v===r||t.w===r)return!1;if(!n)return a.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(t.v)||v(t.v,r)||v(t.w,r)||n.includes(t.w)},"edgeInCluster"),T=e((t,r,n,i)=>{a.debug("Copying children of ",t,"root",i,"data",r.node(t),i);let s=r.children(t)||[];if(t!==i)s.push(t);a.debug("Copying (nodes) clusterId",t,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)T(o,r,n,i);else{let u=r.node(o);if(a.info("cp ",o," to ",i," with parent ",t),n.setNode(o,u),i!==r.parent(o))a.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(t!==i&&o!==t)a.debug("Setting parent",o,t),n.setParent(o,t);else a.info("In copy ",t,"root",i,"data",r.node(t),i),a.debug("Not Setting parent for node=",o,"cluster!==rootId",t!==i,"node!==clusterId",o!==t);let d=r.edges(o);a.debug("Copying Edges",d),d.forEach((c)=>{a.info("Edge",c);let g=r.edge(c.v,c.w,c.name);a.info("Edge data",g,i);try{if(Z(c,i))a.info("Copying as ",c.v,c.w,g,c.name),n.setEdge(c.v,c.w,g,c.name),a.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else a.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",i," clusterId:",t)}catch(h){a.error(h)}})}a.debug("Removing node",o),r.removeNode(o)})},"copy"),B=e((t,r)=>{let n=r.children(t),i=[...n];for(let s of n)R.set(s,t),i=[...i,...B(s,r)];return i},"extractDescendants"),I=e((t,r,n)=>{let i=t.edges().filter((c)=>c.v===r||c.w===r),s=t.edges().filter((c)=>c.v===n||c.w===n),o=i.map((c)=>({v:c.v===r?n:c.v,w:c.w===r?r:c.w})),u=s.map((c)=>({v:c.v,w:c.w}));return o.filter((c)=>u.some((g)=>c.v===g.v&&c.w===g.w))},"findCommonEdges"),Fn=e((t,r,n)=>{let i=r.children(t);if(a.trace("Searching children of id ",t,i),i.length<1)return t;let s;for(let o of i){let u=Fn(o,r,n),d=I(r,n,u);if(u)if(d.length>0)s=u;else return u}return s},"findNonClusterChild"),L=e((t)=>{if(!W.has(t))return t;if(!W.get(t).externalConnections)return t;if(W.has(t))return W.get(t).id;return t},"getAnchorId"),to=e((t,r)=>{if(!t||r>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");t.nodes().forEach(function(n){if(t.children(n).length>0)a.debug("Cluster identified",n," Replacement id in edges: ",Fn(n,t,n)),m.set(n,B(n,t)),W.set(n,{id:Fn(n,t,n),clusterData:t.node(n)})}),t.nodes().forEach(function(n){let i=t.children(n),s=t.edges();if(i.length>0)a.debug("Cluster identified",n,m),s.forEach((o)=>{let u=v(o.v,n),d=v(o.w,n);if(u^d)a.debug("Edge: ",o," leaves cluster ",n),a.debug("Descendants of XXX ",n,": ",m.get(n)),W.get(n).externalConnections=!0});else a.debug("Not a cluster ",n,m)});for(let n of W.keys()){let i=W.get(n).id,s=t.parent(i);if(s!==n&&W.has(s)&&!W.get(s).externalConnections)W.get(n).id=s;let o=t.edges().some((u)=>u.v===n);if(i&&W.get(n)?.externalConnections&&o&&_(t,i,n)){let u=ee(t,n,t.parent(i));if(u)W.get(n).id=u}}t.edges().forEach(function(n){let i=t.edge(n);a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let{v:s,w:o}=n;if(a.debug("Fix XXX",W,"ids:",n.v,n.w,"Translating: ",W.get(n.v)," --- ",W.get(n.w)),W.get(n.v)||W.get(n.w)){if(a.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=L(n.v),o=L(n.w),t.removeEdge(n.v,n.w,n.name),s!==n.v){let u=t.parent(s);W.get(u).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let u=t.parent(o);W.get(u).externalConnections=!0,i.toCluster=n.w}a.debug("Fix Replacing with XXX",s,o,n.name),t.setEdge(s,o,i,n.name)}}),A(t,0),a.trace(W)},"adjustClustersAndEdges"),A=e((t,r)=>{if(r>10){a.error("Bailing out");return}let n=t.nodes(),i=!1;for(let s of n){let o=t.children(s);i=i||o.length>0}if(!i){a.debug("Done, no node has children",t.nodes());return}a.debug("Nodes = ",n,r);for(let s of n)if(a.debug("Extracting node",s,W,W.has(s)&&!W.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",r),!W.has(s))a.debug("Not a cluster",s,r);else if(!W.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){a.debug("Cluster without external connections, without a parent and with children",s,r);let u=t.graph().rankdir==="TB"?"LR":"TB";if(W.get(s)?.clusterData?.dir)u=W.get(s).clusterData.dir,a.debug("Fixing dir",W.get(s).clusterData.dir,u);let d=new te({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});T(s,t,d,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:W.get(s).clusterData,label:W.get(s).label,graph:d})}else a.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!W.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),r),a.debug(W);n=t.nodes(),a.debug("New list of nodes",n);for(let s of n){let o=t.node(s);if(a.debug(" Now next level",s,o),o?.clusterNode)A(o.graph,r+1)}},"extractor"),X=e((t,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=t.children(i),o=X(t,s);n=[...n,...o]}),n},"sorter"),ua=e((t)=>X(t,t.children()),"sortNodesByHierarchy"),_=e((t,r,n)=>{let i=t.parent(r);while(i&&i!==n){let s=W.get(i);if(s&&!s.externalConnections)return!0;i=t.parent(i)}return!1},"isNodeInExtractableCluster"),ee=e((t,r,n)=>{let i=t.children(r)??[];for(let s of i){if(s===n||v(s,n))continue;let o=Fn(s,t,r);if(!o)continue;if(!_(t,o,r))return o}return null},"findSafeAnchorNode");function cr({prepareLayout:t,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let u=r??O;return e(async function(c,g,h,C){let w=g.select("g");(h?.insertMarkers??Xn)(w,c.markers,c.type,c.diagramId),G();let f={element:w,helpers:h,options:C};f.preparedLayout=await t?.(c,f);let p=await u(c,f),E=await n(c,f),N={...f,measure:p};if(i)await i(c,N,E);else await F(c,N,o);await s?.(c,N,E)},"render")}e(cr,"createCommonLayoutRenderer");function G(){yo(),bo(),vo(),U()}e(G,"clearLayoutRenderState");async function O(t,{element:r},n){return await k(r,t,n)}e(O,"defaultMeasureLayout");async function F(t,r,n={}){let{measure:i}=r,{groups:s}=i;for(let u of n.getNodes?.(t,r)??t.nodes){if(n.skipNode?.(u,r))continue;await j(s,u,r,n)}let o=z(t.nodes);for(let u of t.edges){if(J(u,n))continue;await V(s,u,o,t,n,r)}}e(F,"paintLayoutData");async function j(t,r,n,i){if(r.clusterNode)yt(r);else if(H(r,n,i))await tn(t.clusters,r);else yt(r)}e(j,"paintLayoutNode");function H(t,r,n){return t.isGroup===!0&&(n.isCluster?.(t,r)??!0)}e(H,"shouldPaintAsCluster");function z(t){let r=new Map;for(let n of t)if(n?.id)r.set(n.id,n);return r}e(z,"buildNodeLookup");function J(t,r){return t.isLayoutOnly||Boolean(r.skipEdge?.(t))}e(J,"shouldSkipPaintEdge");async function V(t,r,n,i,s,o){let u=nn(t.edgePaths,{...r},s.clusterDb??new Map,i.type,y(r.start,r,n,o,s),y(r.end,r,n,o,s),i.diagramId,Y(r,s),i.layoutAlgorithm);if(Wi(r)){if(!Yn.has(r.id))await At(t.edgeLabels,r);q(r,u)}}e(V,"paintLayoutEdge");function y(t,r,n,i,s){return s.getEdgeNode?.(t,r,i)??(t?n.get(t)??{}:{})}e(y,"getRenderedNode");function Y(t,r){return typeof r.skipIntersect==="function"?r.skipIntersect(t):r.skipIntersect??!1}e(Y,"shouldSkipIntersect");function q(t,r){let n=r?.updatedPath??r?.originalPath,i=b(),{subGraphTitleTotalMargin:s}=Tt({flowchart:i.flowchart??{}});if(t.label){let o=Yn.get(t.id),{x:u,y:d}=Gi(t,r);o.attr("transform",`translate(${u}, ${d+s/2})`)}for(let[o,u]of[["startLeft",t.startLabelLeft],["startRight",t.startLabelRight],["endLeft",t.endLabelLeft],["endRight",t.endLabelRight]])if(u){let{x:d,y:c}=K(t,o,n);Pe.get(t.id)[o].attr("transform",`translate(${d}, ${c})`)}}e(q,"positionRenderedEdgeLabel");var ne={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function K(t,r,n){let i=t.terminalLabelCenters?.[r];if(i)return{...i};if(!n)return{x:t.x,y:t.y};let s=r.startsWith("start")?t.arrowTypeStart:t.arrowTypeEnd;return M.calcTerminalLabelPosition(s?10:0,ne[r],n)}e(K,"terminalLabelTranslate");
2
- export{la,ca,W,Fn,to,ua,cr};
@@ -1 +0,0 @@
1
- import{e,a}from"./chunk-5v44qv67.js";import{K,Dt,Mt}from"./chunk-fx0n2g22.js";import{G}from"./chunk-ya3ghn3n.js";import{or,kt}from"./chunk-cktmyc13.js";var l=or().RailroadAbnf.parser.LangiumParser,s=e((r)=>{let t=r.alternatives.map(p);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformAlternation"),p=e((r)=>{let t=r.elements.map(f);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformConcatenation"),u=e((r)=>{if(r.includes("*")){let[n,o]=r.split("*"),i=n?parseInt(n,10):0,m=o?parseInt(o,10):1/0;return{min:i,max:m}}let t=parseInt(r,10);return{min:t,max:t}},"parseRepeat"),f=e((r)=>{let t=c(r.primary);if(!r.repeat)return t;let{min:n,max:o}=u(r.repeat);if(n===0&&o===1)return{type:"optional",element:t};return{type:"repetition",element:t,min:n,max:o}},"transformElement"),c=e((r)=>{switch(r.$type){case"AbnfStringLiteral":return{type:"terminal",value:r.value};case"AbnfNumVal":return{type:"terminal",value:r.value};case"AbnfRuleName":return{type:"nonterminal",name:r.name};case"AbnfGroup":return s(r.element);case"AbnfOptionalGroup":return{type:"optional",element:s(r.element)};default:throw Error(`Unsupported ABNF primary node: ${r.$type}`)}},"transformPrimary"),d=e((r)=>({name:r.name,definition:s(r.definition)}),"transformRule"),v=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(d(t)))},"populateDb"),g={parse:e((r)=>{K.clear(),a.debug("[ABNF Parser] Starting Langium parse");let t=l.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let n=t.value;a.debug("[ABNF Parser] Parsed rules:",n.rules.length),v(n),a.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:K}},E={parser:g,db:K,renderer:Mt,styles:Dt};export{E as diagram};
@@ -1 +0,0 @@
1
- import{Lt}from"./chunk-0whceqes.js";export{Lt as default};
@@ -1,2 +0,0 @@
1
- import{r,y,t,n,_,s,Z,ae,er}from"./chunk-j6a4z530.js";var u=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],c=s("code-xml",u);function zr(e){let i=_();i.useTheme();let[m,d]=r("preview"),o=e.streaming&&!e.rendered,l=!e.streaming&&!e.rendered&&Boolean(e.error),a=m==="code"||o;return n(i.Panel,{"aria-label":e.title,"data-render-pending":e.pending&&!l?"true":void 0,className:"group/graph relative my-4 font-sans not-italic first:mt-0 last:mb-0",children:[t("div",{role:"toolbar","aria-label":`${e.title}操作`,className:o?"absolute top-2 right-2 z-10 flex items-center":i.style("surface.toolbarFloating","absolute top-2 right-2 z-10 opacity-0 transition-opacity duration-150 group-hover/graph:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-70"),children:o?n("span",{className:i.style("control.badge","gap-1.5 rounded-full px-2 py-0.5 text-[11px]"),children:[t(ae,{className:"size-3 animate-spin"}),"生成",e.title]}):n(y,{children:[t("button",{type:"button","aria-label":a?"查看图表":"查看代码",title:a?"查看图表":"查看代码",onClick:()=>d(a?"preview":"code"),className:"flex size-6 items-center justify-center rounded-md text-dim hover:bg-raised hover:text-ink [&_svg]:size-3.5",children:a?t(er,{}):t(c,{})}),t(i.CopyButton,{text:e.code,size:"icon-sm",label:"复制代码"})]})}),a&&t(i.Code,{code:e.code,lang:e.codeLang,className:"px-4 py-3"}),l&&!a&&n("div",{role:"alert",className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[t(Z,{className:"size-5 text-warning"}),t("p",{className:"max-w-full text-xs break-words text-dim",children:e.error}),t("button",{type:"button",onClick:()=>d("code"),className:"text-xs text-accent-strong underline underline-offset-2",children:"查看代码"})]}),t("div",{hidden:a||l,children:e.children})]})}
2
- export{zr};
@@ -1,2 +0,0 @@
1
- import{e,zn,p,Hn}from"./chunk-5v44qv67.js";import{Se}from"./chunk-j6a4z530.js";var o=Se(Hn(),1);var on=e((s,t)=>{let r=s.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name)r.attr("name",t.name);if(t.rx)r.attr("rx",t.rx);if(t.ry)r.attr("ry",t.ry);if(t.attrs!==void 0)for(let a in t.attrs)r.attr(a,t.attrs[a]);if(t.class)r.attr("class",t.class);return r},"drawRect"),Fr=e((s,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};on(s,r).lower()},"drawBackgroundRect"),Ki=e((s,t)=>{let r=t.text.replace(zn," "),a=s.append("text");if(a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class)a.attr("class",t.class);let i=a.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),a},"drawText"),ia=e((s,t,r,a)=>{let i=s.append("image");i.attr("x",t),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),oa=e((s,t,r,a)=>{let i=s.append("use");i.attr("x",t),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),Ke=e(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),sa=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),$t=e(()=>{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,Fr,Ki,ia,oa,Ke,sa,$t};
@@ -1 +0,0 @@
1
- import{_i}from"./chunk-cktmyc13.js";export{_i as createGitGraphServices};
@@ -1 +0,0 @@
1
- import{e}from"./chunk-5v44qv67.js";var c=1;function i(){if(typeof globalThis>"u")return;return globalThis}e(i,"getCaptureGlobal");function p(){return Boolean(i()?.mermaidCaptureSizes)}e(p,"shouldCaptureSizes");function u(){if(typeof location>"u")return"browser-dev";return`${location.pathname}${location.search}`}e(u,"capturedFromLocation");function d(n,r){let o=i();if(!o)return;let t=r.node(),s=((t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t)?.id??"(unknown)";o.mermaidCapturedSizes??=[];let a={svgId:s,sizes:n};o.mermaidCapturedSizes.push(a),o.mermaidLastCapturedSizes=a}e(d,"emitCapturedSizes");function m(n,r){let o=[];for(let t of r.nodes){if(t.isGroup)continue;o.push({id:t.id,width:t.width??0,height:t.height??0})}if(o.length===0)return;d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:o},n)}e(m,"captureNodeSizes");export{m as captureNodeSizes};
@@ -1 +0,0 @@
1
- import{Ci}from"./chunk-cktmyc13.js";export{Ci as createPieServices};
@@ -1 +0,0 @@
1
- import{h,o,i,r,y,t,n,_,s,Z,vt,rt,Wt,be,pe,ee,de,xt,lt,re,an,Q}from"./chunk-j6a4z530.js";var je=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ge=s("key-round",je);function xe(e){let d=[],g="",b,N=!1;for(let u=0;u<e.length;u++){let c=e[u];if(b)if(c===b)b=void 0;else if(c==="\\"&&b==='"'&&u+1<e.length)g+=e[++u];else g+=c;else if(c==='"'||c==="'")b=c,N=!0;else if(c==="\\"&&u+1<e.length)g+=e[++u],N=!0;else if(/\s/.test(c)){if(N||g)d.push(g);g="",N=!1}else g+=c,N=!0}if(N||g)d.push(g);return d}function le(e){return e.map((d)=>d===""||/[\s"'\\]/.test(d)?`"${d.replace(/(["\\])/g,"\\$1")}"`:d).join(" ")}var ve="size-4 cursor-pointer rounded border-line text-accent accent-accent focus-visible:outline-2 focus-visible:outline-accent",Te={connected:{label:"已连接",dot:"bg-success"},idle:{label:"待连接",dot:"bg-faint"},disabled:{label:"已停用",dot:"bg-faint"},failed:{label:"连接失败",dot:"bg-danger"},needs_auth:{label:"需要认证",dot:"bg-warning"}};function Y(e){return e.type==="local"?le(e.command):e.url}function he({info:e,tools:d=!1}){let g=Te[e.status.status];return n("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs text-dim",children:[t("span",{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full ${g.dot}`}),t("span",{className:d?void 0:"hidden @md/panel:inline",children:g.label}),d&&e.status.status==="connected"&&n("span",{className:"text-faint",children:["· ",e.toolCount," 个工具"]})]})}function $e(e){if(typeof e!=="object"||e===null||!("type"in e))return"any";let d=e.type;if(typeof d==="string")return d;if(Array.isArray(d))return d.filter((g)=>typeof g==="string").join(" | ")||"any";return"any"}function ye(e){let{Button:d,CopyButton:g,Dialog:b,StatusChip:N,confirm:u,style:c,useTheme:k}=_();k();let{info:a,connection:I}=e,[m,q]=r(),[G,K]=r(),[S,j]=r(!1),W=a.status.status==="connected",z=a.status.status==="needs_auth",V=a.status.status==="failed",A=a.config.type==="remote"&&Boolean(a.config.oauth);o(()=>{function p(x){if(x&&x!==a.name)return;let J=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/connect${J}`,{method:"POST"}).then((ne)=>e.onChanged(ne)).catch(()=>{})}function f(x){if(x.data?.type==="mcp-oauth-success")p(x.data.name)}function D(x){if(x.key==="basalt-mcp-oauth-event"&&x.newValue)try{let J=JSON.parse(x.newValue);p(J.name)}catch(J){}}window.addEventListener("message",f),window.addEventListener("storage",D);let R;if("BroadcastChannel"in window)R=new BroadcastChannel("basalt-mcp-oauth"),R.onmessage=(x)=>{if(x.data?.type==="mcp-oauth-success")p(x.data.name)};return()=>{window.removeEventListener("message",f),window.removeEventListener("storage",D),R?.close()}},[I,a.name,a.projectID,e]),o(()=>{if(a.status.status!=="connected")return;let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/tools${p}`).then((f)=>{if(Array.isArray(f))q(f),K(void 0)}).catch((f)=>{K(f instanceof Error?f.message:"获取工具失败")})},[I,a.name,a.projectID,a.status.status]);async function O(p){j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",D=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/${p}${f}`,{method:"POST"});e.onChanged(D)}catch{}finally{j(!1)}}async function U(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=a.status.status==="needs_auth"?a.status.authorizationUrl:void 0;if(!f)f=(await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/authorize${p}`,{method:"POST"})).authorizationUrl;if(f)window.open(f,"_blank","width=600,height=700")}catch(p){K(p instanceof Error?p.message:"获取授权链接失败")}finally{j(!1)}}async function te(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/clear${p}`,{method:"POST"});e.onChanged(f)}finally{j(!1)}}async function E(){if(!await u({title:`删除 ${a.name}?`,description:"删除后将断开连接并不再向会话提供其工具。",action:"删除",danger:!0}))return;j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";await I.request(`/api/mcp/${encodeURIComponent(a.name)}${f}`,{method:"DELETE"}),e.onChanged(),e.onClose()}finally{j(!1)}}let T=a.config,l=Y(T),C="error"in a.status?a.status.error:void 0,M=m?.length??a.toolCount??0;return t(b,{open:!0,className:"bg-panel shadow-float",onOpenChange:(p)=>{if(!p&&!S)e.onClose()},title:n("div",{className:"flex flex-wrap items-center gap-3",children:[t("div",{className:"flex size-8 items-center justify-center rounded-[10px] border border-accent/20 bg-accent-soft text-accent",children:T.type==="local"?t(lt,{className:"size-4"}):t(be,{className:"size-4"})}),t("span",{className:"font-serif text-lg font-semibold tracking-tight text-ink",children:a.name}),W?t(N,{tone:"success",pulse:!0,children:"已连接"}):z?t(N,{tone:"warning",pulse:!0,children:"需要授权"}):V?t(N,{tone:"danger",children:"连接失败"}):a.status.status==="disabled"?t(N,{tone:"neutral",children:"已停用"}):t(N,{tone:"neutral",children:"未连接"})]}),description:n("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5 text-xs",children:[n("span",{className:"flex min-w-0 max-w-full items-center gap-1 rounded-lg border border-line bg-raised/60 py-0.5 pr-1 pl-2.5 font-mono text-[11.5px] text-ink",children:[t("span",{className:"min-w-0 truncate",title:l,children:l}),t(g,{text:l,label:"复制地址",size:"icon-xs",className:"shrink-0 text-dim hover:text-ink"})]}),t("span",{className:"rounded-lg border border-line px-2 py-1 text-[11px] leading-none text-dim",children:T.type==="local"?"本地命令":"远程 HTTP"}),A&&n("span",{className:c("control.badgeAccent","gap-1 rounded-lg border border-accent/25 px-2 py-1"),children:[t(xt,{className:"size-3"}),"OAuth 2.0"]})]}),size:"lg",footer:n("div",{className:"flex w-full items-center justify-between gap-2 max-sm:flex-col",children:[n("div",{className:"flex items-center gap-1 max-sm:w-full",children:[A&&t(d,{type:"button",variant:"ghost",onClick:te,disabled:S,title:"清除已保存的 OAuth 凭据",children:"清除凭据"}),t(d,{type:"button",variant:"danger-ghost",size:"icon-sm","aria-label":"删除服务器",onClick:E,disabled:S,title:"删除服务器",children:t(re,{className:"size-4"})})]}),n("div",{className:"flex items-center gap-2 max-sm:w-full max-sm:justify-end",children:[t(d,{type:"button",variant:"ghost",onClick:e.onEdit,disabled:S,children:"编辑配置"}),!z&&t(d,{type:"button",variant:"secondary",onClick:()=>O(W?"disconnect":"connect"),disabled:S,children:S?"处理中...":W?"断开连接":"立即连接"}),t(d,{type:"button",variant:"primary",onClick:e.onClose,children:"完成"})]})]}),children:n("div",{className:"space-y-6 pt-1",children:[z&&t("div",{className:"relative overflow-hidden rounded-2xl border border-warning/30 bg-[radial-gradient(120%_140%_at_0%_0%,color-mix(in_oklch,var(--color-warning)_16%,transparent),transparent_65%)] p-5",children:n("div",{className:"flex items-start gap-4 max-sm:flex-col",children:[t("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-xl border border-warning/30 bg-panel text-warning shadow-[0_0_28px_-4px_color-mix(in_oklch,var(--color-warning)_55%,transparent)]",children:t(ge,{className:"size-5"})}),n("div",{className:"min-w-0 flex-1 space-y-1.5",children:[t("h4",{className:"text-sm font-semibold text-ink",children:"授权后即可使用此服务器"}),t("p",{className:"text-[13px] leading-relaxed text-dim",children:"该端点要求 OAuth 2.0 身份许可。在浏览器中完成授权后,令牌会自动保存并载入全部工具。"}),C&&t("p",{className:"line-clamp-2 break-words font-mono text-[11.5px] text-faint",title:C,children:C})]}),n(d,{type:"button",variant:"primary",onClick:U,disabled:S,className:"shrink-0",children:[t(Wt,{className:"mr-1.5 size-3.5"}),S?"正在拉起授权...":"前往授权"]})]})}),V&&n("div",{className:c("callout.base",c("callout.danger"),"gap-3 rounded-2xl p-4"),children:[t(vt,{className:"mt-0.5 size-4 shrink-0 text-danger"}),n("div",{className:"min-w-0 space-y-1",children:[t("h4",{className:"text-sm font-medium text-ink",children:"连接失败"}),t("p",{className:"font-mono text-[11.5px] leading-relaxed break-words text-dim",children:C})]})]}),n("section",{className:"space-y-3",children:[n("div",{className:"flex items-baseline justify-between gap-3 px-0.5",children:[n("h4",{className:"flex items-center gap-2 text-[13px] font-medium text-ink",children:["可用工具",t("span",{className:"rounded-full bg-raised px-1.5 py-0.5 font-mono text-[11px] leading-none text-dim",children:M})]}),t("span",{className:"text-[11.5px] text-faint",children:"对所有会话可用"})]}),G?t("div",{className:c("callout.base",c("callout.danger"),"text-xs leading-relaxed break-words"),children:G}):!W?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:z?"等待授权":"尚未连接"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:z?"授权完成后会自动连接并列出工具。":"连接服务器后,这里会列出它提供的全部工具。"})]}):!m?t("div",{role:"status","aria-label":"正在获取工具列表",className:"grid gap-2",children:[0,1,2].map((p)=>n("div",{className:"animate-pulse space-y-2.5 rounded-xl border border-line p-3.5",children:[t("div",{className:"h-3.5 w-32 rounded bg-raised"}),t("div",{className:"h-3 w-4/5 rounded bg-raised/70"})]},p))}):m.length===0?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:"没有可用工具"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:"已连接成功,但该服务器没有声明任何工具。"})]}):t("ul",{className:"grid gap-2",children:m.map((p)=>{let f=p.inputSchema?.properties??{},D=p.inputSchema?.required??[],R=Object.entries(f);return n("li",{className:c("surface.subtle","border-line bg-raised/30 p-3.5 transition-colors hover:border-line-strong hover:bg-raised/60"),children:[t("span",{className:"font-mono text-[13px] font-medium break-all text-accent",children:p.name}),p.description&&t("p",{className:"mt-1.5 text-[13px] leading-relaxed break-words text-dim",children:p.description}),R.length>0&&t("div",{className:"mt-3 flex flex-wrap gap-1.5",children:R.map(([x,J])=>n("span",{title:D.includes(x)?"必填参数":"可选参数",className:"inline-flex items-center gap-1 rounded-md border border-line bg-panel px-1.5 py-1 font-mono text-[11px] leading-none",children:[t("span",{className:"text-ink",children:x}),D.includes(x)&&t("span",{className:"text-warning",children:"*"}),t("span",{className:"text-faint",children:$e(J)})]},x))})]},p.name)})})]})]})})}var De=/^[A-Za-z0-9_-]{1,64}$/;function H(e){return t("span",{className:"truncate text-xs text-faint",children:e.children})}function Ne(e){let{pairs:d,onChange:g,InputComponent:b}=e,N=(u,c)=>g(d.map((k,a)=>a===u?{...k,...c}:k));return n("div",{className:"space-y-2",children:[n("div",{className:"flex min-h-7 items-center gap-2",children:[t("span",{className:"shrink-0 text-[13px] font-medium text-dim",children:e.label}),t(H,{children:e.tip}),n("button",{type:"button",className:"ml-auto inline-flex h-7 shrink-0 cursor-pointer items-center gap-1 rounded-lg px-2 text-xs font-medium text-dim transition-colors hover:bg-raised hover:text-ink",onClick:()=>g([...d,{key:"",value:"",saved:!1}]),children:[t(pe,{className:"size-3.5"}),"添加"]})]}),d.map((u,c)=>n("div",{className:"flex min-w-0 items-center gap-1.5",children:[t(b,{"aria-label":`${e.keyLabel} ${c+1}`,placeholder:e.keyLabel,value:u.key,readOnly:u.saved,onChange:(k)=>N(c,{key:k.target.value}),className:"min-w-0 flex-[2] font-mono text-xs"}),t(b,{"aria-label":`${e.keyLabel} ${u.key||c+1} 的值`,type:"password",autoComplete:"off",placeholder:u.saved?"已保存,留空保持不变":"值",value:u.value,onChange:(k)=>N(c,{value:k.target.value}),className:"min-w-0 flex-[3] font-mono text-xs"}),t("button",{type:"button","aria-label":`删除 ${u.key||"该项"}`,className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-faint transition-colors hover:bg-danger/10 hover:text-danger",onClick:()=>g(d.filter((k,a)=>a!==c)),children:t(Q,{className:"size-4"})})]},c))]})}function Ce(e){return Object.keys(e??{}).map((d)=>({key:d,value:"",saved:!0}))}function we(e){let{Button:d,Segmented:g,Dialog:b,Form:N,Field:u,Input:c,Switch:k,style:a,useTheme:I}=_();I();let{existing:m}=e,[q,G]=r(m?.config.type??"local"),[K,S]=r(m?.name??""),[j,W]=r(m?.config.type==="local"?le(m.config.command):""),[z,V]=r(m?.config.type==="remote"?m.config.url:""),[A,O]=r(Ce(m?.config.type==="local"?m.config.environment:void 0)),[U,te]=r(Ce(m?.config.type==="remote"?m.config.headers:void 0)),E=m?.config.type==="remote"?m.config.oauth:void 0,[T,l]=r(Boolean(E)),[C,M]=r(typeof E==="object"&&E.clientId?E.clientId:""),[p,f]=r(""),[D,R]=r(typeof E==="object"&&E.scope?E.scope:""),[x,J]=r(m?.config.defer??"default"),[ne,ke]=r(m?.config.timeout!==void 0?String(m.config.timeout):""),[oe,Ie]=r(m?.config.defer!==void 0||m?.config.timeout!==void 0),[me,X]=r(),[ie,ue]=r(!1);async function Se(v){v.preventDefault(),X(void 0);let w=K.trim();if(!m&&!De.test(w)){X("名称只能包含英文字母、数字、下划线与中划线,长度 1-64");return}if(!m&&e.taken.includes(w)){X("同名服务器已存在");return}let ae=ne.trim()?Number.parseInt(ne.trim(),10):void 0;if(ae!==void 0&&(!Number.isFinite(ae)||ae<=0)){X("超时时间须为大于 0 的毫秒数");return}let ce;if(q==="local"){let L=xe(j.trim());if(!L.length){X("请输入启动命令");return}let F={};for(let B of A){let P=B.key.trim();if(!P)continue;if(!B.saved||B.value)F[P]=B.value}ce={type:"local",command:L,environment:Object.keys(F).length?F:void 0,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:ae}}else{let L=z.trim();try{let P=new URL(L);if(P.protocol!=="http:"&&P.protocol!=="https:")throw Error("bad protocol")}catch{X("请输入合法的 HTTP 或 HTTPS 地址");return}let F={};for(let P of U){let se=P.key.trim();if(!se)continue;if(!P.saved||P.value)F[se]=P.value}let B;if(T){let P=C.trim(),se=p.trim(),fe=D.trim();if(P||se||fe)B={clientId:P||void 0,clientSecret:se||void 0,scope:fe||void 0};else B=!0}else B=!1;ce={type:"remote",url:L,headers:Object.keys(F).length?F:void 0,oauth:B,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:ae}}ue(!0);try{let L=m?.name??w,F=m?m.projectID:e.projectID,B=F?`?projectID=${encodeURIComponent(F)}`:"";await e.connection.request(`/api/mcp/${encodeURIComponent(L)}${B}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(ce)}),e.onSaved()}catch(L){X(L instanceof Error?L.message:"保存失败")}finally{ue(!1)}}return t(b,{open:!0,onOpenChange:(v)=>{if(!v&&!ie)e.onClose()},title:m?`编辑 ${m.name}`:"添加 MCP 服务器",size:"lg",footer:n("div",{className:"flex w-full justify-end gap-2.5",children:[t(d,{type:"button",variant:"ghost",onClick:e.onClose,disabled:ie,className:"min-w-20",children:"取消"}),t(d,{type:"submit",form:"mcp-server-form",variant:"primary",disabled:ie,className:"min-w-24",children:ie?"保存中...":"保存"})]}),children:n(N,{id:"mcp-server-form",onSubmit:Se,children:[t(g,{value:q,onChange:(v)=>G(v),className:"w-full [&>button]:flex-1",options:[{value:"local",label:"本地(标准输入输出)"},{value:"remote",label:"远程(HTTP / SSE)"}]}),!m&&t(u,{label:"名称",aside:t(H,{children:"唯一标识,如 postgres"}),children:(v)=>t(c,{id:v,value:K,onChange:(w)=>S(w.target.value),placeholder:"postgres",className:"font-mono text-xs"})}),q==="local"?n(y,{children:[t(u,{label:"启动命令",aside:t(H,{children:"完整命令及参数"}),children:(v)=>t(c,{id:v,value:j,onChange:(w)=>W(w.target.value),placeholder:"npx -y @modelcontextprotocol/server-postgres ...",className:"font-mono text-xs"})}),t(Ne,{label:"环境变量",tip:"启动进程时注入",keyLabel:"变量名",pairs:A,onChange:O,InputComponent:c})]}):n(y,{children:[t(u,{label:"服务地址",aside:t(H,{children:"HTTP / HTTPS 端点"}),children:(v)=>t(c,{id:v,value:z,onChange:(w)=>V(w.target.value),placeholder:"https://example.com/mcp",className:"font-mono text-xs"})}),t(Ne,{label:"请求头",tip:"随每次请求发送",keyLabel:"头字段",pairs:U,onChange:te,InputComponent:c}),n("div",{className:"flex items-center justify-between gap-4",children:[n("div",{className:"min-w-0",children:[t("span",{className:"block text-[13px] font-medium text-dim",children:"OAuth 2.0 认证"}),t("span",{className:"block truncate text-xs text-faint",children:"自动发现授权端点,使用 PKCE 并刷新令牌"})]}),t(k,{checked:T,onCheckedChange:l,label:"启用 OAuth 2.0"})]}),T&&n(y,{children:[t(u,{label:"Client ID",aside:t(H,{children:"留空自动动态注册(DCR)"}),children:(v)=>t(c,{id:v,value:C,onChange:(w)=>M(w.target.value),placeholder:"留空自动动态注册",className:"font-mono text-xs"})}),t(u,{label:"Client Secret",aside:t(H,{children:"留空保持不变"}),children:(v)=>t(c,{id:v,type:"password",autoComplete:"off",value:p,onChange:(w)=>f(w.target.value),placeholder:"••••••••",className:"font-mono text-xs"})}),t(u,{label:"Scope",aside:t(H,{children:"选填授权范围"}),children:(v)=>t(c,{id:v,value:D,onChange:(w)=>R(w.target.value),placeholder:"repo read:org",className:"font-mono text-xs"})})]})]}),n("div",{className:"space-y-3 border-t border-line/60 pt-3",children:[n("button",{type:"button","aria-expanded":oe,className:"flex w-full cursor-pointer items-center gap-1.5 text-[13px] font-medium text-dim transition-colors hover:text-ink",onClick:()=>Ie(!oe),children:[t(rt,{className:`size-3.5 transition-transform ${oe?"rotate-90":""}`}),"高级设置",t("span",{className:"truncate text-xs font-normal text-faint",children:"加载时机、超时"})]}),oe&&n("div",{className:"grid grid-cols-2 gap-3 max-sm:grid-cols-1",children:[t(u,{label:"加载时机",aside:t(H,{children:"延迟 = 按需加载"}),children:()=>t(g,{value:x,onChange:(v)=>J(v),className:"w-full [&>button]:flex-1",options:[{value:"default",label:"默认"},{value:"defer",label:"延迟"},{value:"always",label:"常驻"}]})}),t(u,{label:"超时(毫秒)",aside:t(H,{children:"留空用默认"}),children:(v)=>t(c,{id:v,value:ne,onChange:(w)=>ke(w.target.value),placeholder:"默认",className:"font-mono text-xs"})})]})]}),me&&n("div",{role:"alert",className:a("callout.base",a("callout.danger"),"px-3 py-2.5 text-xs"),children:[t(Z,{className:"mt-0.5 size-3.5 shrink-0"}),t("span",{className:"min-w-0 break-words",children:me})]})]})})}function tt({connection:e}){let{Button:d,Input:g,style:b,useTheme:N}=_();N();let[u,c]=r(""),[k,a]=r(),[I,m]=r(),[q,G]=r(!1),[K,S]=r(),[j,W]=r(!1),z=i(!1),[V,A]=r(),O=i(0),U=h(async()=>{let l=++O.current;G(!0);try{let C=await e.request("/api/mcp");if(l!==O.current)return;a(C),m(void 0)}catch(C){if(l===O.current)m(C instanceof Error?C.message:"读取失败")}finally{if(l===O.current)G(!1)}},[e]);o(()=>(U(),()=>{O.current++}),[U]);async function te(l,C){if(z.current)return;z.current=!0,W(!0);let M=O.current;try{let p=l.projectID?`?projectID=${encodeURIComponent(l.projectID)}`:"",f=await e.request(`/api/mcp/${encodeURIComponent(l.name)}${p}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...l.config,enabled:C})});if(M===O.current)a((D)=>D?.map((R)=>R.name===f.name&&R.projectID===f.projectID?f:R))}finally{z.current=!1,W(!1)}}let E=k?.filter((l)=>`${l.name} ${Y(l.config)}`.toLowerCase().includes(u.trim().toLowerCase())),T=k?.find((l)=>l.name===K);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:[t("h2",{className:b("settings.groupTitle"),children:"MCP 服务器"}),t("p",{className:b("settings.groupDesc"),children:"外部工具与数据源管理"})]}),n("div",{className:"flex gap-2",children:[t(d,{variant:"ghost",disabled:q,onClick:U,className:"h-9 px-2.5 text-xs",children:t(ee,{className:`size-3.5 ${q?"animate-spin":""}`})}),n(d,{variant:"secondary",onClick:()=>A({}),className:"h-9 px-2.5 text-xs",children:[t(pe,{className:"size-3.5 mr-1"}),"添加服务器"]})]})]}),I&&n("div",{role:"alert",className:b("callout.base",b("callout.danger"),"mb-3 flex-wrap items-center justify-between"),children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法读取 MCP 服务器:",I]}),t(d,{disabled:q,onClick:U,children:"重试"})]}),n("div",{className:"relative mb-3 min-w-0",children:[t(de,{"aria-hidden":!0,className:"pointer-events-none absolute top-3 left-3 size-4 text-faint"}),t(g,{type:"search","aria-label":"搜索 MCP 服务器",placeholder:"搜索服务器",value:u,onChange:(l)=>c(l.target.value),className:"h-10 min-w-0 pl-9"})]}),t("div",{className:b("settings.groupBox"),children:!k?t("div",{role:"status","aria-label":"正在加载",className:"divide-y divide-line",children:[0,1,2].map((l)=>n("div",{className:"h-16 space-y-2 px-4 py-3",children:[t("div",{className:"h-3 w-24 animate-pulse rounded bg-raised"}),t("div",{className:"h-3 w-2/3 animate-pulse rounded bg-raised"})]},l))}):E?.length===0?t("p",{className:"p-4 text-sm text-dim",children:"没有匹配的 MCP 服务器"}):t("ul",{className:"divide-y divide-line",children:E?.map((l)=>{let C=l.config.enabled===!1,M=l.scope==="file";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 ${C?"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":`查看 ${l.name}`,disabled:M,title:M?"来自项目的 .mcp.json,只读":void 0,onClick:()=>S(l.name),children:[t("span",{"aria-hidden":!0,className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-raised text-dim",children:l.config.type==="local"?t(lt,{className:"size-4"}):t(be,{className:"size-4"})}),n("span",{className:"min-w-0 flex-1",children:[t("span",{className:"block truncate text-sm font-medium text-ink",title:l.name,children:l.name}),t("span",{className:"mt-0.5 block truncate font-mono text-xs text-dim",title:Y(l.config),children:Y(l.config)})]}),t("span",{className:b("control.badge","shrink-0 text-[11px] text-dim"),children:l.scope==="project"?"项目":l.scope==="file"?".mcp.json":"全局"}),t(he,{info:l})]}),t("span",{className:"relative flex size-10 shrink-0 items-center justify-center",children:!M&&t("input",{type:"checkbox","aria-label":`启用服务器 ${l.name}`,className:ve,disabled:j||q,checked:!C,onChange:(p)=>te(l,p.target.checked)})})]},l.name)})})})]}),T&&!V&&t(ye,{connection:e,info:T,onClose:()=>S(void 0),onEdit:()=>A({info:T}),onChanged:(l)=>l?a((C)=>C?.map((M)=>M.name===l.name?l:M)):U()},`${T.projectID}:${T.name}`),V&&t(we,{connection:e,existing:V.info,taken:(k??[]).map((l)=>l.name),onClose:()=>A(void 0),onSaved:()=>{A(void 0),U()}})]})}export{tt as McpSection};
@@ -1 +0,0 @@
1
- import{Si}from"./chunk-cktmyc13.js";export{Si as createTreeViewServices};
@@ -1,2 +0,0 @@
1
- import{e,p}from"./chunk-5v44qv67.js";var he=e((o,t)=>{let n;if(t==="sandbox")n=p("#i"+o);return(t==="sandbox"?p(n.nodes()[0].contentDocument.body):p("body")).select(`[id="${o}"]`)},"getDiagramElement");
2
- export{he};
@@ -1 +0,0 @@
1
- import{Ti}from"./chunk-cktmyc13.js";export{Ti as createArchitectureServices};
@@ -1,2 +0,0 @@
1
- import{e,a,B,V}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";var i={parse:e(async(r)=>{let t=await X("info",r);a.debug(t)},"parse")},s={version:"12.2.0"},p=e(()=>s.version,"getVersion"),g={getVersion:p},m=e((r,t,n)=>{a.debug(`rendering info diagram
2
- `+r);let o=V(t);B(o,100,400,!0),o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),v={draw:m},y={parser:i,db:g,renderer:v};export{y as diagram};
@@ -1,89 +0,0 @@
1
- import{e,a,ke,b,O,B,C,l,V}from"./chunk-5v44qv67.js";var M="",D="",E="",W=[],N=new Map,S=e((t)=>O(t,l()),"sanitizeText"),R=e((t)=>{switch(t.type){case"terminal":return{...t,value:S(t.value)};case"nonterminal":return{...t,name:S(t.name)};case"sequence":return{...t,elements:t.elements.map(R)};case"choice":return{...t,alternatives:t.alternatives.map(R)};case"optional":return{...t,element:R(t.element)};case"repetition":return{...t,element:R(t.element),separator:t.separator?R(t.separator):void 0};case"special":return{...t,text:S(t.text)}}},"sanitizeAstNode"),G=e(()=>{M="",D="",E="",W.length=0,N.clear(),C(),a.debug("[Railroad] Database cleared")},"clear"),L=e((t)=>{M=S(t),a.debug("[Railroad] Title set:",t)},"setTitle"),I=e(()=>M,"getTitle"),U=e((t)=>{let n={...t,name:S(t.name),definition:R(t.definition),comment:t.comment?S(t.comment):void 0};if(a.debug("[Railroad] Adding rule:",n.name),N.has(n.name))a.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`);W.push(n),N.set(n.name,n)},"addRule"),j=e(()=>W,"getRules"),J=e((t)=>N.get(t),"getRule"),Q=e((t)=>{D=S(t).replace(/^\s+/g,""),a.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Z=e(()=>D,"getAccTitle"),ee=e((t)=>{E=S(t).replace(/\n\s+/g,`
2
- `),a.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),te=e(()=>E,"getAccDescription"),re=L,ie=I,K={clear:G,setTitle:L,getTitle:I,addRule:U,getRules:j,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:ee,getAccDescription:te,setDiagramTitle:re,getDiagramTitle:ie},T={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),X=e((t)=>{if(!t)return!1;return Object.keys(t).every((n)=>n==="railroad"||oe.has(n))},"isRailroadStyleOptions"),le=e((t)=>{if(!t)return{};if("railroad"in t&&t.railroad)return t.railroad;return X(t)?t:{}},"extractRailroadOverrides"),se=e((t)=>{if(!t||X(t))return{};let{railroad:n,svgId:s,theme:i,look:r,...o}=t;return o},"extractThemeOverrides"),u=e((t,n)=>{if(typeof t!=="string")return n;let s=t.trim();return ne.test(s)?s:n},"sanitizeColorValue"),H=e((t,n)=>{if(typeof t!=="string")return n;let s=t.trim();return ae.test(s)?s:n},"sanitizeFontFamilyValue"),y=e((t,n)=>{let s=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(s)&&s>=0?s:n},"sanitizeNumberValue"),de=e((t)=>{let n=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(n)&&n>0?n:void 0},"parseThemeFontSize"),ce=e((t)=>{let n=H(t.fontFamily,T.fontFamily),s=de(t.fontSize)??T.fontSize;return{...T,fontFamily:n,fontSize:s,terminalFill:u(t.secondBkg??t.secondaryColor,T.terminalFill),terminalStroke:u(t.secondaryBorderColor??t.lineColor,T.terminalStroke),terminalTextColor:u(t.secondaryTextColor??t.textColor,T.terminalTextColor),nonTerminalFill:u(t.mainBkg??t.background,T.nonTerminalFill),nonTerminalStroke:u(t.primaryBorderColor??t.lineColor,T.nonTerminalStroke),nonTerminalTextColor:u(t.primaryTextColor??t.textColor,T.nonTerminalTextColor),lineColor:u(t.lineColor,T.lineColor),markerFill:u(t.lineColor,T.markerFill),commentFill:u(t.labelBackground??t.tertiaryColor,T.commentFill),commentStroke:u(t.tertiaryBorderColor??t.lineColor,T.commentStroke),commentTextColor:u(t.tertiaryTextColor??t.textColor,T.commentTextColor),specialFill:u(t.tertiaryColor??t.secondaryColor,T.specialFill),specialStroke:u(t.tertiaryBorderColor??t.secondaryBorderColor,T.specialStroke),ruleNameColor:u(t.titleColor??t.textColor,T.ruleNameColor)}},"buildThemeDefaults"),_=e((t)=>{let n=b(),s={...ke(),...n.themeVariables??{},...se(t)},i=ce(s),r={...n.railroad??{},...le(t)};return{compactMode:r.compactMode??i.compactMode,padding:y(r.padding,i.padding),verticalSeparation:y(r.verticalSeparation,i.verticalSeparation),horizontalSeparation:y(r.horizontalSeparation,i.horizontalSeparation),arcRadius:y(r.arcRadius,i.arcRadius),fontSize:y(r.fontSize,i.fontSize),fontFamily:H(r.fontFamily,i.fontFamily),terminalFill:u(r.terminalFill,i.terminalFill),terminalStroke:u(r.terminalStroke,i.terminalStroke),terminalTextColor:u(r.terminalTextColor,i.terminalTextColor),nonTerminalFill:u(r.nonTerminalFill,i.nonTerminalFill),nonTerminalStroke:u(r.nonTerminalStroke,i.nonTerminalStroke),nonTerminalTextColor:u(r.nonTerminalTextColor,i.nonTerminalTextColor),lineColor:u(r.lineColor,i.lineColor),strokeWidth:y(r.strokeWidth,i.strokeWidth),markerFill:u(r.markerFill,i.markerFill),commentFill:u(r.commentFill,i.commentFill),commentStroke:u(r.commentStroke,i.commentStroke),commentTextColor:u(r.commentTextColor,i.commentTextColor),specialFill:u(r.specialFill,i.specialFill),specialStroke:u(r.specialStroke,i.specialStroke),ruleNameColor:u(r.ruleNameColor,i.ruleNameColor),showMarkers:r.showMarkers??i.showMarkers,markerRadius:y(r.markerRadius,i.markerRadius)}},"buildRailroadStyleOptions"),Dt=e((t)=>{let{fontFamily:n,fontSize:s,terminalFill:i,terminalStroke:r,terminalTextColor:o,nonTerminalFill:g,nonTerminalStroke:m,nonTerminalTextColor:d,lineColor:f,strokeWidth:p,markerFill:h,commentFill:k,commentStroke:c,commentTextColor:x,specialFill:z,specialStroke:F,ruleNameColor:v}=_(t);return`
3
- .railroad-diagram {
4
- font-family: ${n};
5
- font-size: ${s}px;
6
- }
7
-
8
- .railroad-terminal rect {
9
- fill: ${i};
10
- stroke: ${r};
11
- stroke-width: ${p}px;
12
- }
13
-
14
- .railroad-terminal text {
15
- fill: ${o};
16
- font-family: ${n};
17
- font-size: ${s}px;
18
- text-anchor: middle;
19
- dominant-baseline: middle;
20
- }
21
-
22
- .railroad-nonterminal rect {
23
- fill: ${g};
24
- stroke: ${m};
25
- stroke-width: ${p}px;
26
- }
27
-
28
- .railroad-nonterminal text {
29
- fill: ${d};
30
- font-family: ${n};
31
- font-size: ${s}px;
32
- text-anchor: middle;
33
- dominant-baseline: middle;
34
- }
35
-
36
- .railroad-line {
37
- stroke: ${f};
38
- stroke-width: ${p}px;
39
- fill: none;
40
- }
41
-
42
- .railroad-start circle,
43
- .railroad-end circle {
44
- fill: ${h};
45
- }
46
-
47
- .railroad-comment ellipse {
48
- fill: ${k};
49
- stroke: ${c};
50
- stroke-width: ${p}px;
51
- }
52
-
53
- .railroad-comment text {
54
- fill: ${x};
55
- font-style: italic;
56
- font-family: ${n};
57
- font-size: ${s}px;
58
- text-anchor: middle;
59
- dominant-baseline: middle;
60
- }
61
-
62
- .railroad-special rect {
63
- fill: ${z};
64
- stroke: ${F};
65
- stroke-width: ${p}px;
66
- stroke-dasharray: 5,3;
67
- }
68
-
69
- .railroad-special text {
70
- fill: ${d};
71
- font-family: ${n};
72
- font-size: ${s}px;
73
- text-anchor: middle;
74
- dominant-baseline: middle;
75
- }
76
-
77
- .railroad-rule-name {
78
- font-weight: bold;
79
- fill: ${v};
80
- font-family: ${n};
81
- font-size: ${s}px;
82
- }
83
-
84
- .railroad-group {
85
- /* Grouping container, no specific styles */
86
- }
87
- `},"getStyles"),w=class{constructor(){this.d=""}static{e(this,"PathBuilder")}moveTo(t,n){return this.d+=`M ${t} ${n} `,this}lineTo(t,n){return this.d+=`L ${t} ${n} `,this}horizontalTo(t){return this.d+=`H ${t} `,this}verticalTo(t){return this.d+=`V ${t} `,this}arcTo(t,n,s,i,r,o,g){return this.d+=`A ${t} ${n} ${s} ${i?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},me=class{constructor(t,n=_()){this.textCache=new Map,this.svg=t,this.config=n}static{e(this,"RailroadRenderer")}measureText(t){if(this.textCache.has(t))return this.textCache.get(t);let n=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(t),s=n.node().getBBox(),i={width:s.width,height:s.height};return n.remove(),this.textCache.set(t,i),i}renderTerminal(t,n){let s=this.measureText(n),i=s.width+this.config.padding*2,r=s.height+this.config.padding*2,o=t.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",i/2).attr("y",r/2).text(n),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderNonTerminal(t,n){let s=this.measureText(n),i=s.width+this.config.padding*2,r=s.height+this.config.padding*2,o=t.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r),o.append("text").attr("x",i/2).attr("y",r/2).text(n),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderSequence(t,n){let s=n.map((d)=>this.renderExpression(t,d)),i=0,r=0,o=0;for(let d of s)i+=d.dimensions.width,r=Math.max(r,d.dimensions.up),o=Math.max(o,d.dimensions.down);i+=(s.length-1)*this.config.horizontalSeparation;let g=t.append("g").attr("class","railroad-sequence"),m=0;for(let d=0;d<s.length;d++){let f=s[d],p=r-f.dimensions.up;if(g.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`),d<s.length-1){let k=m+f.dimensions.width,c=k+this.config.horizontalSeparation,x=r;g.append("path").attr("class","railroad-line").attr("d",new w().moveTo(k,x).lineTo(c,x).build())}m+=f.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:i,height:r+o,up:r,down:o}}}renderChoice(t,n){let s=n.map((h)=>this.renderExpression(t,h)),i=0,r=0;for(let h of s)i=Math.max(i,h.dimensions.width),r+=h.dimensions.height;r+=(s.length-1)*this.config.verticalSeparation;let o=this.config.arcRadius,g=o*4,m=i+g,d=t.append("g").attr("class","railroad-choice"),f=0,p=r/2;for(let h of s){let k=f,c=k+h.dimensions.up,x=o*2+(i-h.dimensions.width)/2;d.node().appendChild(h.element).setAttribute("transform",`translate(${x}, ${k})`);let F=new w,v=c>p;if(c===p)F.moveTo(0,p).lineTo(x,c);else F.moveTo(0,p).arcTo(o,o,0,!1,v,o,p+(v?o:-o)).lineTo(o,c-(v?o:-o)).arcTo(o,o,0,!1,!v,o*2,c).lineTo(x,c);d.append("path").attr("class","railroad-line").attr("d",F.build());let A=new w,Y=x+h.dimensions.width,q=m-o*2;if(c===p)A.moveTo(Y,c).lineTo(m,p);else A.moveTo(Y,c).lineTo(q,c).arcTo(o,o,0,!1,!v,m-o,c+(v?-o:o)).lineTo(m-o,p+(v?o:-o)).arcTo(o,o,0,!1,v,m,p);d.append("path").attr("class","railroad-line").attr("d",A.build()),f+=h.dimensions.height+this.config.verticalSeparation}return{element:d.node(),dimensions:{width:m,height:r,up:p,down:r-p}}}renderOptional(t,n){let s=this.renderExpression(t,n),i=this.config.arcRadius,r=i*2,o=s.dimensions.width+i*4,g=s.dimensions.height+r,m=t.append("g").attr("class","railroad-optional"),d=i*2,f=r;m.node().appendChild(s.element).setAttribute("transform",`translate(${d}, ${f})`);let h=f+s.dimensions.up,k=new w().moveTo(0,h).lineTo(i*2,h);m.append("path").attr("class","railroad-line").attr("d",k.build());let c=new w().moveTo(d+s.dimensions.width,h).lineTo(o,h);m.append("path").attr("class","railroad-line").attr("d",c.build());let x=new w().moveTo(0,h).arcTo(i,i,0,!1,!1,i,h-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,h-i).arcTo(i,i,0,!1,!1,o,h);return m.append("path").attr("class","railroad-line").attr("d",x.build()),{element:m.node(),dimensions:{width:o,height:g,up:h,down:g-h}}}renderRepetition(t,n,s){let i=this.renderExpression(t,n),r=this.config.arcRadius,o=r*2,g=i.dimensions.width+r*4,m=s===0,d=i.dimensions.height+o+(m?o:0),f=t.append("g").attr("class","railroad-repetition"),p=r*2,h=m?o:0;f.node().appendChild(i.element).setAttribute("transform",`translate(${p}, ${h})`);let c=h+i.dimensions.up;f.append("path").attr("class","railroad-line").attr("d",new w().moveTo(0,c).lineTo(r*2,c).build()),f.append("path").attr("class","railroad-line").attr("d",new w().moveTo(p+i.dimensions.width,c).lineTo(g,c).build());let x=h+i.dimensions.height+r,z=new w().moveTo(p+i.dimensions.width,c).arcTo(r,r,0,!1,!0,p+i.dimensions.width+r,c+r).lineTo(p+i.dimensions.width+r,x).arcTo(r,r,0,!1,!0,p+i.dimensions.width,x+r).lineTo(r*2,x+r).arcTo(r,r,0,!1,!0,r,x).lineTo(r,c+r).arcTo(r,r,0,!1,!0,r*2,c);if(f.append("path").attr("class","railroad-line").attr("d",z.build()),m){let F=new w().moveTo(0,c).arcTo(r,r,0,!1,!1,r,c-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,c-r).arcTo(r,r,0,!1,!1,g,c);f.append("path").attr("class","railroad-line").attr("d",F.build())}return{element:f.node(),dimensions:{width:g,height:d,up:c,down:d-c}}}renderSpecial(t,n){let s=this.measureText("? "+n+" ?"),i=s.width+this.config.padding*2,r=s.height+this.config.padding*2,o=t.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r),o.append("text").attr("x",i/2).attr("y",r/2).text("? "+n+" ?"),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderExpression(t,n){switch(n.type){case"terminal":return this.renderTerminal(t,n.value);case"nonterminal":return this.renderNonTerminal(t,n.name);case"sequence":return this.renderSequence(t,n.elements);case"choice":return this.renderChoice(t,n.alternatives);case"optional":return this.renderOptional(t,n.element);case"repetition":return this.renderRepetition(t,n.element,n.min);case"special":return this.renderSpecial(t,n.text);default:throw Error(`Unknown node type: ${n.type}`)}}renderRule(t,n){let s=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${n})`),i=t.name+" =",r=this.measureText(i).width+20,o=r+20,g=s.append("g"),m=this.renderExpression(g,t.definition),d=Math.max(20,m.dimensions.up),f=d-m.dimensions.up;return g.attr("transform",`translate(${o}, ${f})`),s.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",d).text(i),s.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",d).attr("r",this.config.markerRadius),s.append("g").attr("class","railroad-end").append("circle").attr("cx",o+m.dimensions.width+10).attr("cy",d).attr("r",this.config.markerRadius),s.append("path").attr("class","railroad-line").attr("d",new w().moveTo(r+this.config.markerRadius,d).lineTo(o,d).build()),s.append("path").attr("class","railroad-line").attr("d",new w().moveTo(o+m.dimensions.width,d).lineTo(o+m.dimensions.width+10-this.config.markerRadius,d).build()),{height:Math.max(40,f+m.dimensions.height+this.config.padding*2),width:o+m.dimensions.width+10+this.config.markerRadius}}renderDiagram(t){let n=this.config.padding,s=0;for(let i of t){let r=this.renderRule(i,n);n+=r.height+this.config.verticalSeparation,s=Math.max(s,r.width)}return{width:s+this.config.padding*2,height:n+this.config.padding}}},P=e((t,n,s)=>{B(t,n.height,n.width,s),t.attr("viewBox",`0 0 ${n.width} ${n.height}`)},"configureRailroadSvgSize"),he=e((t,n,s)=>{a.debug(`[Railroad] Rendering diagram
88
- `+t);try{let i=V(n);i.attr("class","railroad-diagram");let o=b().railroad?.useMaxWidth??!0,g=K.getRules();if(a.debug(`[Railroad] Rendering ${g.length} rules`),g.length===0){a.warn("[Railroad] No rules to render"),P(i,{height:100,width:200},o);return}let d=new me(i,_()).renderDiagram(g);P(i,d,o),a.debug("[Railroad] Render complete")}catch(i){throw a.error("[Railroad] Render error:",i),i}},"draw"),Mt={draw:he};
89
- export{K,Dt,Mt};
@@ -1 +0,0 @@
1
- import{e,a}from"./chunk-5v44qv67.js";import{K,Dt,Mt}from"./chunk-fx0n2g22.js";import{G}from"./chunk-ya3ghn3n.js";import{sr,kt}from"./chunk-cktmyc13.js";var i=sr().RailroadPeg.parser.LangiumParser,s=e((r)=>{let t=r.alternatives.map(l);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformOrderedChoice"),l=e((r)=>{let t=r.elements.map(m);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformSequence"),m=e((r)=>{let t=p(r.suffix);if(!r.operator)return t;return{type:"special",text:r.operator==="&"?`&${o(t)}`:`!${o(t)}`}},"transformPrefix"),o=e((r)=>{switch(r.type){case"terminal":return`"${r.value}"`;case"nonterminal":return r.name;case"special":return r.text;default:return"(...)"}},"nodeToLabel"),p=e((r)=>{let t=u(r.primary);if(!r.operator)return t;switch(r.operator){case"?":return{type:"optional",element:t};case"*":return{type:"repetition",element:t,min:0,max:1/0};case"+":return{type:"repetition",element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${r.operator}`)}},"transformSuffix"),u=e((r)=>{switch(r.$type){case"PegLiteral":return{type:"terminal",value:r.value};case"PegIdentifier":return{type:"nonterminal",name:r.name};case"PegGroup":return s(r.element);case"PegAny":return{type:"special",text:r.dot};default:throw Error(`Unsupported PEG primary node: ${r.$type}`)}},"transformPrimary"),c=e((r)=>({name:r.name,definition:s(r.definition)}),"transformRule"),f=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(c(t)))},"populateDb"),d={parse:e((r)=>{K.clear(),a.debug("[PEG Parser] Starting Langium parse");let t=i.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let n=t.value;a.debug("[PEG Parser] Parsed rules:",n.rules.length),f(n),a.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:K}},w={parser:d,db:K,renderer:Mt,styles:Dt};export{w as diagram};
@@ -1,41 +0,0 @@
1
- import{G}from"./chunk-ya3ghn3n.js";import{e,a,ke,D,b,B,C,S,E,T,A,R,L,V,U}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},M=32,k={axes:[],curves:[],options:h},x=structuredClone(k),H=D.radar,j=e(()=>U({...H,...b().radar}),"getConfig"),O=e(()=>x.axes,"getAxes"),K=e(()=>x.curves,"getCurves"),N=e(()=>x.options,"getOptions"),Y=e((n)=>{x.axes=n.map((t)=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=e((n)=>{x.curves=n.map((t)=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=e((n)=>{if(n[0].axis==null)return n.map((r)=>r.value);let t=O();if(t.length===0)throw Error("Axes must be populated before curves for reference entries");return t.map((r)=>{let s=n.find((o)=>o.axis?.$refText===r.name);if(s===void 0)throw Error("Missing entry for axis "+r.label);return s.value})},"computeCurveEntries"),J=e((n)=>{let t=n.reduce((r,s)=>(r[s.name]=s,r),{});if(x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule},x.options.ticks>M)a.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${M}). Using ${M} instead.`),x.options.ticks=M},"setOptions"),Q=e(()=>{C(),x=structuredClone(k)},"clear"),y={getAxes:O,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:j,clear:Q,setAccTitle:S,getAccTitle:E,setDiagramTitle:R,getDiagramTitle:L,getAccDescription:A,setAccDescription:T},tt=e((n)=>{G(n,y);let{axes:t,curves:r,options:s}=n;y.setAxes(t),y.setCurves(r),y.setOptions(s)},"populate"),et={parse:e(async(n)=>{let t=await X("radar",n);a.debug(t),tt(t)},"parse")},at=e((n,t,r,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=V(t),p=rt(m,l),g=i.max??Math.max(...d.map((w)=>Math.max(...w.entries))),v=i.min,f=Math.min(l.width,l.height)/2;nt(p,c,f,i.ticks,i.graticule),st(p,c,f,l),I(p,c,d,v,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),rt=e((n,t)=>{let r=t.width+t.marginLeft+t.marginRight,s=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return B(n,s,r,t.useMaxWidth??!0),n.attr("viewBox",`0 0 ${r} ${s}`).attr("overflow","visible"),n.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),nt=e((n,t,r,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=r*(c+1)/s;n.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let d=0;d<s;d++){let i=r*(d+1)/s,l=t.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),v=i*Math.sin(p);return`${g},${v}`}).join(" ");n.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),st=e((n,t,r,s)=>{let o=t.length;for(let c=0;c<o;c++){let d=t[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);n.append("line").attr("x1",0).attr("y1",0).attr("x2",r*s.axisScaleFactor*l).attr("y2",r*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;n.append("text").text(d).attr("x",r*s.axisLabelFactor*l+g*l).attr("y",r*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function I(n,t,r,s,o,c,d){let i=t.length,l=Math.min(d.width,d.height)/2;r.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,v)=>{let f=2*Math.PI*v/i-Math.PI/2,w=_(g,s,o,l),z=w*Math.cos(f),W=w*Math.sin(f);return{x:z,y:W}});if(c==="circle")n.append("path").attr("d",F(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")n.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}e(I,"drawCurves");function _(n,t,r,s){let o=Math.min(Math.max(n,t),r);return s*(o-t)/(r-t)}e(_,"relativeRadius");function F(n,t){let r=n.length,s=`M${n[0].x},${n[0].y}`;for(let o=0;o<r;o++){let c=n[(o-1+r)%r],d=n[o],i=n[(o+1)%r],l=n[(o+2)%r],u={x:d.x+(i.x-c.x)*t,y:d.y+(i.y-c.y)*t},m={x:i.x-(l.x-d.x)*t,y:i.y-(l.y-d.y)*t};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}e(F,"closedRoundCurve");function P(n,t,r,s){if(!r)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;t.forEach((i,l)=>{let u=n.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}e(P,"drawLegend");var ot={draw:at},it=e((n,t)=>{let r="";for(let s=0;s<n.THEME_COLOR_LIMIT;s++){let o=n[`cScale${s}`];r+=`
2
- .radarCurve-${s} {
3
- color: ${o};
4
- fill: ${o};
5
- fill-opacity: ${t.curveOpacity};
6
- stroke: ${o};
7
- stroke-width: ${t.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${s} {
10
- fill: ${o};
11
- fill-opacity: ${t.curveOpacity};
12
- stroke: ${o};
13
- }
14
- `}return r},"genIndexStyles"),lt=e((n)=>{let t=ke(),r=b(),s=U(t,r.themeVariables),o=U(s.radar,n);return{themeVariables:s,radarOptions:o}},"buildRadarStyleOptions"),ct=e(({radar:n}={})=>{let{themeVariables:t,radarOptions:r}=lt(n);return`
15
- .radarTitle {
16
- font-size: ${t.fontSize};
17
- color: ${t.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${r.axisColor};
23
- stroke-width: ${r.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- font-size: ${r.axisLabelFontSize}px;
27
- color: ${r.axisColor};
28
- }
29
- .radarGraticule {
30
- fill: ${r.graticuleColor};
31
- fill-opacity: ${r.graticuleOpacity};
32
- stroke: ${r.graticuleColor};
33
- stroke-width: ${r.graticuleStrokeWidth};
34
- }
35
- .radarLegendText {
36
- text-anchor: start;
37
- font-size: ${r.legendFontSize}px;
38
- dominant-baseline: hanging;
39
- }
40
- ${it(t,r)}
41
- `},"styles"),vt={parser:et,db:y,renderer:ot,styles:ct};export{vt as diagram};
@@ -1 +0,0 @@
1
- import{ko}from"./chunk-j6a4z530.js";export{ko as QuestionDock};
@@ -1 +0,0 @@
1
- import{wi}from"./chunk-cktmyc13.js";export{wi as createInfoServices};
@@ -1 +0,0 @@
1
- import"./chunk-5v44qv67.js";import"./chunk-cm92fyr3.js";import{Co}from"./chunk-d6tbw8br.js";import"./chunk-dwajwrpk.js";import"./chunk-pxkhm40r.js";import"./chunk-f5txt81n.js";import"./chunk-718mr5gc.js";export{Co as diagram};