@bkm016/basalt 0.1.5 → 0.1.6

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 (199) hide show
  1. package/README.md +9 -7
  2. package/{chunk-gw05p4g3.js → chunk-053vb71h.js} +1 -1
  3. package/{chunk-3c330qna.js → chunk-063vbmtp.js} +2 -2
  4. package/{chunk-bgkegf0k.js → chunk-0javrjcm.js} +4 -4
  5. package/{chunk-pjr91g6k.js → chunk-10p3mb40.js} +1 -1
  6. package/{chunk-mkp28k1x.js → chunk-39vwrg8n.js} +2 -2
  7. package/{chunk-8xb636vr.js → chunk-6kdgk70p.js} +2 -2
  8. package/{chunk-9z7sdh5e.js → chunk-6ptv4g5e.js} +1 -1
  9. package/{chunk-zzwjt7fp.js → chunk-75434aay.js} +1 -1
  10. package/{chunk-ar3dbfp9.js → chunk-7hr6zw2m.js} +1 -1
  11. package/{chunk-h1rypb99.js → chunk-8gw5bvh3.js} +4 -4
  12. package/{chunk-a4b75ekk.js → chunk-8saewt61.js} +2 -2
  13. package/{chunk-sqaam5ak.js → chunk-8wj32837.js} +1 -1
  14. package/{chunk-539ekagy.js → chunk-8wv5t0w6.js} +5 -5
  15. package/{chunk-aw65h276.js → chunk-8x21n7y9.js} +1 -1
  16. package/{chunk-0n99m9m4.js → chunk-a0c989ky.js} +1 -1
  17. package/{chunk-srjgvdvs.js → chunk-a5apjjcn.js} +6 -6
  18. package/chunk-a81p46j7.js +2 -0
  19. package/chunk-agsfy9w7.js +2 -0
  20. package/{chunk-2qcpq99g.js → chunk-arcqjt91.js} +1 -1
  21. package/{chunk-rxj6tct8.js → chunk-bdy4jksd.js} +1 -1
  22. package/{chunk-zrkh5dw7.js → chunk-benrzwea.js} +1 -1
  23. package/chunk-bpw6q7g0.js +3 -0
  24. package/{chunk-36cqq0ga.js → chunk-c7rcw9fb.js} +5 -5
  25. package/{chunk-x89em726.js → chunk-ca982n62.js} +1 -1
  26. package/chunk-d20p02ny.js +2 -0
  27. package/{chunk-5v4g21rw.js → chunk-d6p2hgxh.js} +1 -1
  28. package/{chunk-t7sc0wwc.js → chunk-dnx91jrd.js} +2 -2
  29. package/{chunk-mat08ab1.js → chunk-dpz4hwqb.js} +2 -2
  30. package/{chunk-zn0g0859.js → chunk-ebpyvs1d.js} +2 -2
  31. package/{chunk-00gwse5r.js → chunk-ecf896fz.js} +1 -1
  32. package/{chunk-0stvywr8.js → chunk-ejsneb6f.js} +1 -1
  33. package/{chunk-7as47pcw.js → chunk-ey15ye2h.js} +1 -1
  34. package/{chunk-v4k3qmdm.js → chunk-f156y565.js} +1 -1
  35. package/{chunk-7tgqhveh.js → chunk-f544p9rh.js} +1 -1
  36. package/chunk-fmq3zwzk.js +2 -0
  37. package/{chunk-ebzkckyw.js → chunk-fx7f4m3c.js} +1 -1
  38. package/{chunk-3k7ejpkc.js → chunk-g0t9c3gv.js} +1 -1
  39. package/{chunk-7w0mefgk.js → chunk-gv7wqkey.js} +2 -2
  40. package/{chunk-2nkfxhef.js → chunk-hksqjts3.js} +252 -236
  41. package/{chunk-1xa7d5mh.js → chunk-j7yvh0ae.js} +1 -1
  42. package/{chunk-0j0qggej.js → chunk-n85qs7cs.js} +1 -1
  43. package/{chunk-7qq99360.js → chunk-n981vx1t.js} +4 -4
  44. package/{chunk-0fwdxd45.js → chunk-peja51xv.js} +1 -1
  45. package/{chunk-6dsq0fns.js → chunk-pg5nkf1y.js} +1 -1
  46. package/{chunk-jyrwk08p.js → chunk-prgm07j4.js} +1 -1
  47. package/{chunk-jvwg4rn1.js → chunk-q9dd6fhj.js} +4 -4
  48. package/{chunk-nxkmd29x.js → chunk-r8vvcp6c.js} +1 -1
  49. package/{chunk-stj493dn.js → chunk-r9aatvwm.js} +2 -2
  50. package/chunk-rfb85nj7.js +2 -0
  51. package/{chunk-980drajf.js → chunk-rfdt992v.js} +12 -12
  52. package/{chunk-e63c1186.js → chunk-s6dejhfj.js} +1 -1
  53. package/{chunk-wfyrfvfn.js → chunk-s7skpgm2.js} +1 -1
  54. package/{chunk-dddsrff6.js → chunk-tgfbtehh.js} +123 -121
  55. package/{chunk-r0jc8e7t.js → chunk-w67dvqtb.js} +2 -2
  56. package/{chunk-b9fqretv.js → chunk-whj87h4r.js} +2 -2
  57. package/{chunk-vt1anydc.js → chunk-y8dkfpmj.js} +3 -3
  58. package/{chunk-nx3jnbv8.js → chunk-z02sj1je.js} +2 -2
  59. package/{chunk-hq5ke1yp.js → chunk-zxkq9m8e.js} +1 -1
  60. package/compiled.js +3 -3
  61. package/package.json +1 -1
  62. package/ui-test-worker.js +27 -27
  63. package/web/{chunk-56krfj3b.js → chunk-03dmzvaq.js} +1 -1
  64. package/web/{chunk-affear07.js → chunk-0fgaepwm.js} +1 -1
  65. package/web/{chunk-vhzys0rr.js → chunk-0gg00f86.js} +1 -1
  66. package/web/chunk-0pecj6d7.js +1 -0
  67. package/web/chunk-0wt1dgny.js +1 -0
  68. package/web/{chunk-gxqaa4sv.js → chunk-12xxh71x.js} +5 -5
  69. package/web/chunk-1ves7sq5.js +1 -0
  70. package/web/chunk-1yj79b48.js +1 -0
  71. package/web/{chunk-x7sb3bwf.js → chunk-296hgy6k.js} +22 -22
  72. package/web/{chunk-jcdw85mv.js → chunk-2bmq1whf.js} +1 -1
  73. package/web/{chunk-1s2hp6h1.js → chunk-2wqxhqr9.js} +1 -1
  74. package/web/{chunk-y7jq61nv.js → chunk-30b33r2w.js} +2 -2
  75. package/web/{chunk-g8kkc6vz.js → chunk-30zfw7zg.js} +1 -1
  76. package/web/chunk-39ng8zwx.css +1 -0
  77. package/web/{chunk-0qr891eq.js → chunk-3de552rg.js} +1 -1
  78. package/web/{chunk-3hkgdw6f.js → chunk-3nbzj48p.js} +3 -3
  79. package/web/{chunk-12z7d0hp.js → chunk-3zebd9fq.js} +1 -1
  80. package/web/chunk-4r1n98zx.js +2 -0
  81. package/web/chunk-59678wmg.js +1 -0
  82. package/web/{chunk-pyg1mr80.js → chunk-5v44qv67.js} +20 -20
  83. package/web/chunk-5wdk97mk.js +4 -0
  84. package/web/{chunk-fnnrrzqa.js → chunk-64rafq66.js} +1 -1
  85. package/web/{chunk-qrdh9j62.js → chunk-6kkw9ptc.js} +1 -1
  86. package/web/{chunk-01hcjafh.js → chunk-718mr5gc.js} +1 -1
  87. package/web/chunk-7hs57qdr.js +1 -0
  88. package/web/{chunk-aqt7kc3s.js → chunk-7kp237t3.js} +1 -1
  89. package/web/chunk-86p42kym.js +1 -0
  90. package/web/chunk-8n79cqyd.js +1 -0
  91. package/web/{chunk-paywgcf7.js → chunk-96v2avmw.js} +2 -2
  92. package/web/{chunk-4a4j030b.js → chunk-9an6wcnr.js} +1 -1
  93. package/web/{chunk-dzg1pv80.js → chunk-9c1yt2ex.js} +3 -3
  94. package/web/{chunk-d60dpf69.js → chunk-a7gtb4kg.js} +1 -1
  95. package/web/chunk-b985y17w.js +2 -0
  96. package/web/{chunk-j34q5jn6.js → chunk-bz2v64xe.js} +1 -1
  97. package/web/{chunk-g9sqbafw.js → chunk-cb2rxtq9.js} +1 -1
  98. package/web/{chunk-g5jxwkdh.js → chunk-ck8rr0sr.js} +1 -1
  99. package/web/{chunk-zc1mk10n.js → chunk-cktmyc13.js} +2 -2
  100. package/web/{chunk-tcp77cp2.js → chunk-cm92fyr3.js} +1 -1
  101. package/web/chunk-cwtn2kdm.js +1 -0
  102. package/web/{chunk-ka7c5rhx.js → chunk-czq1yz51.js} +6 -6
  103. package/web/{chunk-qq5gh5zr.js → chunk-d4z2rgpx.js} +1 -1
  104. package/web/{chunk-0k9aec1s.js → chunk-d6tbw8br.js} +3 -3
  105. package/web/chunk-dpkyygej.js +1 -0
  106. package/web/{chunk-m8knte9z.js → chunk-dwajwrpk.js} +1 -1
  107. package/web/{chunk-7e47b1sn.js → chunk-et5ess72.js} +1 -1
  108. package/web/chunk-ez8b6neq.js +1 -0
  109. package/web/{chunk-9xgspn75.js → chunk-f5txt81n.js} +2 -2
  110. package/web/chunk-fd1kqwe3.js +1 -0
  111. package/web/chunk-fmthkpff.js +1 -0
  112. package/web/{chunk-h2ag4kvz.js → chunk-fp48zz2e.js} +1 -1
  113. package/web/{chunk-1pasbxwh.js → chunk-fx0n2g22.js} +1 -1
  114. package/web/{chunk-bnb9xhgw.js → chunk-fxs4nb93.js} +6 -6
  115. package/web/{chunk-sd22cnjy.js → chunk-g6k9z8zt.js} +1 -1
  116. package/web/{chunk-5shygfgb.js → chunk-g81h1e6n.js} +2 -2
  117. package/web/{chunk-zz397b0v.js → chunk-gsh80797.js} +1 -1
  118. package/web/chunk-hs5x78fb.js +1 -0
  119. package/web/{chunk-abhad4zj.js → chunk-ht1dzftc.js} +4 -4
  120. package/web/{chunk-zqht0jzx.js → chunk-hy4m34qp.js} +1 -1
  121. package/web/chunk-hyd5hzpa.js +1 -0
  122. package/web/chunk-hyt1nkaw.js +1 -0
  123. package/web/chunk-j6a4z530.js +1139 -0
  124. package/web/{chunk-h6gh63xj.js → chunk-jve1zc80.js} +1 -1
  125. package/web/{chunk-vttgyb5v.js → chunk-kegv14sg.js} +1 -1
  126. package/web/chunk-kw9emsqw.js +1 -0
  127. package/web/{chunk-kza0t0gj.js → chunk-kyawkpv2.js} +1 -1
  128. package/web/{chunk-xsrvw7dt.js → chunk-m2prjwk3.js} +1 -1
  129. package/web/{chunk-s24qs1bn.js → chunk-m9bzz9m0.js} +6 -6
  130. package/web/{chunk-c53xmf48.js → chunk-mqsyzzgt.js} +1 -1
  131. package/web/{chunk-26bwh1sb.js → chunk-n1jpg57t.js} +6 -6
  132. package/web/{chunk-yvgs6bm3.js → chunk-nyn9tghz.js} +1 -1
  133. package/web/{chunk-ybw6vgf6.js → chunk-nywdeb4m.js} +1 -1
  134. package/web/{chunk-1cfh0e2e.js → chunk-prvh9syp.js} +7 -7
  135. package/web/chunk-pxkhm40r.js +2 -0
  136. package/web/{chunk-d6ddkh6e.js → chunk-q9ekgjh6.js} +1 -1
  137. package/web/chunk-r3mj50zs.js +1 -0
  138. package/web/{chunk-2nht58dc.js → chunk-rf9dt6bg.js} +1 -1
  139. package/web/{chunk-4m3zdd41.js → chunk-s2920f21.js} +1 -1
  140. package/web/{chunk-crzseqbx.js → chunk-sc0ghp25.js} +1 -1
  141. package/web/{chunk-7a3c137d.js → chunk-sy7e4dmq.js} +1 -1
  142. package/web/{chunk-65nwc4cf.js → chunk-t74r2n8h.js} +1 -1
  143. package/web/{chunk-gcv91974.js → chunk-t851gdjh.js} +1 -1
  144. package/web/{chunk-mpfgr049.js → chunk-t9mvsgt9.js} +1 -1
  145. package/web/{chunk-mnzramhc.js → chunk-twdy2f67.js} +1 -1
  146. package/web/{chunk-advfpyb9.js → chunk-v4yqrx5y.js} +4 -4
  147. package/web/{chunk-z4aj066q.js → chunk-vf4vkcf9.js} +1 -1
  148. package/web/{chunk-6enn8p66.js → chunk-vtxw9rmr.js} +1 -1
  149. package/web/{chunk-k67v6dyg.js → chunk-vw1pbv1x.js} +2 -2
  150. package/web/chunk-x19v2sxv.js +1 -0
  151. package/web/{chunk-892nf39p.js → chunk-x5s7zr5f.js} +7 -7
  152. package/web/{chunk-f9k3xrwb.js → chunk-xc2sq3t5.js} +1 -1
  153. package/web/chunk-xvcfp1zh.js +2 -0
  154. package/web/chunk-y21zy3eh.js +1 -0
  155. package/web/{chunk-14bad871.js → chunk-ya3ghn3n.js} +1 -1
  156. package/web/chunk-yd74yxzt.js +8 -0
  157. package/web/{chunk-0p1nmj5n.js → chunk-z1geewdf.js} +1 -1
  158. package/web/chunk-z4ha8181.js +1 -0
  159. package/web/chunk-z8rarqe6.js +1 -0
  160. package/web/{chunk-xk1t58c4.js → chunk-zp3qrrkb.js} +4 -4
  161. package/web/{chunk-7znyd1mj.js → chunk-zsxw5fj7.js} +1 -1
  162. package/web/index.html +1 -1
  163. package/worker.js +1 -1
  164. package/chunk-2nb3d92s.js +0 -2
  165. package/chunk-2pa1z37c.js +0 -2
  166. package/chunk-4g5f43ea.js +0 -3
  167. package/chunk-eegztdzb.js +0 -2
  168. package/chunk-wd3z74av.js +0 -2
  169. package/chunk-yna8bwqc.js +0 -2
  170. package/web/chunk-0ytga215.js +0 -1
  171. package/web/chunk-1amzv4ha.js +0 -1
  172. package/web/chunk-2y0rc1fe.js +0 -1
  173. package/web/chunk-4w298aqs.js +0 -1
  174. package/web/chunk-6stt9d18.js +0 -1
  175. package/web/chunk-7pypx5h8.js +0 -2
  176. package/web/chunk-9dy7z3ej.js +0 -2
  177. package/web/chunk-9mq2cdtq.js +0 -1
  178. package/web/chunk-b5hah4mf.js +0 -1
  179. package/web/chunk-b8tfetd8.js +0 -1
  180. package/web/chunk-ckgpy4r4.js +0 -1
  181. package/web/chunk-dbnrfxt1.js +0 -8
  182. package/web/chunk-ddxf8e84.js +0 -1
  183. package/web/chunk-e8h45nyr.js +0 -1
  184. package/web/chunk-ej9vb61c.js +0 -1
  185. package/web/chunk-fjag6yg8.js +0 -2
  186. package/web/chunk-gxsb5tx3.js +0 -1
  187. package/web/chunk-jg6fmz2d.js +0 -1
  188. package/web/chunk-mz1dabxh.js +0 -1
  189. package/web/chunk-p53n0hwr.js +0 -1
  190. package/web/chunk-pfcnr9tw.js +0 -1
  191. package/web/chunk-q7xkscc5.js +0 -1
  192. package/web/chunk-qmbgb79a.js +0 -1139
  193. package/web/chunk-sfq6cw45.js +0 -2
  194. package/web/chunk-svqj4az8.js +0 -1
  195. package/web/chunk-t7jwyvvr.js +0 -1
  196. package/web/chunk-tf18d2dk.css +0 -1
  197. package/web/chunk-v0g4cqc1.js +0 -4
  198. package/web/chunk-vqfz99ff.js +0 -1
  199. package/web/chunk-zazs8p6c.js +0 -1
@@ -1,9 +1,9 @@
1
- import{e,a,Re,v,C,S,E,T,A,R,L,l,p,Ui,M,ue,oe,se,ht,ye,ve}from"./chunk-pyg1mr80.js";import{$t}from"./chunk-tcp77cp2.js";import{ge}from"./chunk-9xgspn75.js";import{le}from"./chunk-01hcjafh.js";var Bt=function(){var t=e(function(Q,h,g,n){for(g=g||{},n=Q.length;n--;g[Q[n]]=h);return g},"o"),s=[1,2],c=[1,3],r=[1,4],u=[2,4],f=[1,9],m=[1,11],b=[1,16],o=[1,17],D=[1,18],x=[1,19],G=[1,33],Y=[1,20],j=[1,21],O=[1,22],y=[1,23],V=[1,24],F=[1,26],z=[1,27],W=[1,28],K=[1,29],N=[1,30],st=[1,31],St=[1,32],gt=[1,35],yt=[1,36],mt=[1,37],bt=[1,38],rt=[1,34],k=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],kt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Mt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],Lt={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:e(function(h,g,n,_,w,i,it){var d=i.length-1;switch(w){case 3:return _.setRootDoc(i[d]),i[d];break;case 4:this.$=[];break;case 5:if(i[d]!="nl")i[d-1].push(i[d]),this.$=i[d-1];break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:let Et=i[d-1];Et.description=_.trimColon(i[d]),this.$=Et;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:let _t=_.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:_t};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var X=i[d],J=i[d-2].trim();if(i[d].match(":")){var lt=i[d].split(":");X=lt[0],J=[J,lt[1]]}this.$={stmt:"state",id:X,type:"default",description:J};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:_.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),_.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),_.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:_.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:_.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:_.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:_.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:c,6:r},{1:[3]},{3:5,4:s,5:c,6:r},{3:6,4:s,5:c,6:r},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:St,51:gt,52:yt,53:mt,54:bt,57:rt},t(k,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:b,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:St,51:gt,52:yt,53:mt,54:bt,57:rt},t(k,[2,7]),t(k,[2,8]),t(k,[2,9]),t(k,[2,10]),t(k,[2,11]),t(k,[2,12],{14:[1,40],15:[1,41]}),t(k,[2,16]),{18:[1,42]},t(k,[2,18],{20:[1,43]}),{23:[1,44]},t(k,[2,22]),t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(k,[2,28]),{34:[1,49]},{36:[1,50]},t(k,[2,31]),{13:51,24:G,57:rt},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(kt,[2,44],{58:[1,56]}),t(kt,[2,45],{58:[1,57]}),t(k,[2,38]),t(k,[2,39]),t(k,[2,40]),t(k,[2,41]),t(k,[2,6]),t(k,[2,13]),{13:58,24:G,57:rt},t(k,[2,17]),t(Mt,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(k,[2,29]),t(k,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(k,[2,14],{14:[1,71]}),{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,21:[1,72],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:St,51:gt,52:yt,53:mt,54:bt,57:rt},t(k,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(k,[2,34]),t(k,[2,35]),t(k,[2,36]),t(k,[2,37]),t(kt,[2,46]),t(kt,[2,47]),t(k,[2,15]),t(k,[2,19]),t(Mt,u,{7:78}),t(k,[2,26]),t(k,[2,27]),{5:[1,79]},{5:[1,80]},{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,21:[1,81],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:St,51:gt,52:yt,53:mt,54:bt,57:rt},t(k,[2,32]),t(k,[2,33]),t(k,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:e(function(h,g){if(g.recoverable)this.trace(h);else{var n=Error(h);throw n.hash=g,n}},"parseError"),parse:e(function(h){var g=this,n=[0],_=[],w=[null],i=[],it=this.table,d="",X=0,J=0,lt=0,Et=2,_t=1,me=i.slice.call(arguments,1),I=Object.create(this.lexer),tt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))tt.yy[wt]=this.yy[wt];if(I.setInput(h,tt.yy),tt.yy.lexer=I,tt.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var It=I.yylloc;i.push(It);var be=I.options&&I.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(H){n.length=n.length-2*H,w.length=w.length-H,i.length=i.length-H}e(ke,"popStack");function Wt(){var H=_.pop()||I.lex()||_t;if(typeof H!=="number"){if(H instanceof Array)_=H,H=_.pop();H=g.symbols_[H]||H}return H}e(Wt,"lex");var P,Nt,et,U,ts,Ot,at={},vt,q,jt,Dt;while(!0){if(et=n[n.length-1],this.defaultActions[et])U=this.defaultActions[et];else{if(P===null||typeof P>"u")P=Wt();U=it[et]&&it[et][P]}if(typeof U>"u"||!U.length||!U[0]){var Rt="";Dt=[];for(vt in it[et])if(this.terminals_[vt]&&vt>Et)Dt.push("'"+this.terminals_[vt]+"'");if(I.showPosition)Rt="Parse error on line "+(X+1)+`:
1
+ import{e,a,Re,v,C,S,E,T,A,R,L,l,p,Ui,M,ue,oe,se,gt,ge,ye}from"./chunk-5v44qv67.js";import{$t}from"./chunk-cm92fyr3.js";import{he}from"./chunk-f5txt81n.js";import{le}from"./chunk-718mr5gc.js";var Bt=function(){var t=e(function(Q,h,g,n){for(g=g||{},n=Q.length;n--;g[Q[n]]=h);return g},"o"),s=[1,2],c=[1,3],r=[1,4],u=[2,4],f=[1,9],m=[1,11],b=[1,16],o=[1,17],D=[1,18],x=[1,19],G=[1,33],Y=[1,20],j=[1,21],O=[1,22],y=[1,23],V=[1,24],F=[1,26],z=[1,27],W=[1,28],K=[1,29],N=[1,30],st=[1,31],pt=[1,32],St=[1,35],yt=[1,36],mt=[1,37],bt=[1,38],rt=[1,34],k=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],kt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Mt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],Lt={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:e(function(h,g,n,_,w,i,it){var d=i.length-1;switch(w){case 3:return _.setRootDoc(i[d]),i[d];break;case 4:this.$=[];break;case 5:if(i[d]!="nl")i[d-1].push(i[d]),this.$=i[d-1];break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:let Et=i[d-1];Et.description=_.trimColon(i[d]),this.$=Et;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:let _t=_.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:_t};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var X=i[d],J=i[d-2].trim();if(i[d].match(":")){var lt=i[d].split(":");X=lt[0],J=[J,lt[1]]}this.$={stmt:"state",id:X,type:"default",description:J};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:_.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),_.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),_.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:_.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:_.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:_.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:_.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:c,6:r},{1:[3]},{3:5,4:s,5:c,6:r},{3:6,4:s,5:c,6:r},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},t(k,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:b,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},t(k,[2,7]),t(k,[2,8]),t(k,[2,9]),t(k,[2,10]),t(k,[2,11]),t(k,[2,12],{14:[1,40],15:[1,41]}),t(k,[2,16]),{18:[1,42]},t(k,[2,18],{20:[1,43]}),{23:[1,44]},t(k,[2,22]),t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(k,[2,28]),{34:[1,49]},{36:[1,50]},t(k,[2,31]),{13:51,24:G,57:rt},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(kt,[2,44],{58:[1,56]}),t(kt,[2,45],{58:[1,57]}),t(k,[2,38]),t(k,[2,39]),t(k,[2,40]),t(k,[2,41]),t(k,[2,6]),t(k,[2,13]),{13:58,24:G,57:rt},t(k,[2,17]),t(Mt,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(k,[2,29]),t(k,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(k,[2,14],{14:[1,71]}),{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,21:[1,72],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},t(k,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(k,[2,34]),t(k,[2,35]),t(k,[2,36]),t(k,[2,37]),t(kt,[2,46]),t(kt,[2,47]),t(k,[2,15]),t(k,[2,19]),t(Mt,u,{7:78}),t(k,[2,26]),t(k,[2,27]),{5:[1,79]},{5:[1,80]},{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:D,21:[1,81],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},t(k,[2,32]),t(k,[2,33]),t(k,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:e(function(h,g){if(g.recoverable)this.trace(h);else{var n=Error(h);throw n.hash=g,n}},"parseError"),parse:e(function(h){var g=this,n=[0],_=[],w=[null],i=[],it=this.table,d="",X=0,J=0,lt=0,Et=2,_t=1,be=i.slice.call(arguments,1),I=Object.create(this.lexer),tt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))tt.yy[wt]=this.yy[wt];if(I.setInput(h,tt.yy),tt.yy.lexer=I,tt.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var It=I.yylloc;i.push(It);var ke=I.options&&I.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Te(H){n.length=n.length-2*H,w.length=w.length-H,i.length=i.length-H}e(Te,"popStack");function Wt(){var H=_.pop()||I.lex()||_t;if(typeof H!=="number"){if(H instanceof Array)_=H,H=_.pop();H=g.symbols_[H]||H}return H}e(Wt,"lex");var P,Nt,et,U,ts,Ot,at={},vt,q,jt,Dt;while(!0){if(et=n[n.length-1],this.defaultActions[et])U=this.defaultActions[et];else{if(P===null||typeof P>"u")P=Wt();U=it[et]&&it[et][P]}if(typeof U>"u"||!U.length||!U[0]){var Rt="";Dt=[];for(vt in it[et])if(this.terminals_[vt]&&vt>Et)Dt.push("'"+this.terminals_[vt]+"'");if(I.showPosition)Rt="Parse error on line "+(X+1)+`:
2
2
  `+I.showPosition()+`
3
- Expecting `+Dt.join(", ")+", got '"+(this.terminals_[P]||P)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(P==_t?"end of input":"'"+(this.terminals_[P]||P)+"'");this.parseError(Rt,{text:I.match,token:this.terminals_[P]||P,line:I.yylineno,loc:It,expected:Dt})}if(U[0]instanceof Array&&U.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+P);switch(U[0]){case 1:if(n.push(P),w.push(I.yytext),i.push(I.yylloc),n.push(U[1]),P=null,!Nt){if(J=I.yyleng,d=I.yytext,X=I.yylineno,It=I.yylloc,lt>0)lt--}else P=Nt,Nt=null;break;case 2:if(q=this.productions_[U[1]][1],at.$=w[w.length-q],at._$={first_line:i[i.length-(q||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(q||1)].first_column,last_column:i[i.length-1].last_column},be)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[d,J,X,tt.yy,U[1],w,i].concat(me)),typeof Ot<"u")return Ot;if(q)n=n.slice(0,-1*q*2),w=w.slice(0,-1*q),i=i.slice(0,-1*q);n.push(this.productions_[U[1]][0]),w.push(at.$),i.push(at._$),jt=it[n[n.length-2]][n[n.length-1]],n.push(jt);break;case 3:return!0}}return!0},"parse")},Se=function(){var Q={EOF:1,parseError:e(function(g,n){if(this.yy.parser)this.yy.parser.parseError(g,n);else throw Error(g)},"parseError"),setInput:e(function(h,g){if(this.yy=g||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var g=h.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:e(function(h){var g=h.length,n=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var _=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1)this.yylineno-=n.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===_.length?this.yylloc.first_column:0)+_[_.length-n.length].length-n[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+Dt.join(", ")+", got '"+(this.terminals_[P]||P)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(P==_t?"end of input":"'"+(this.terminals_[P]||P)+"'");this.parseError(Rt,{text:I.match,token:this.terminals_[P]||P,line:I.yylineno,loc:It,expected:Dt})}if(U[0]instanceof Array&&U.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+P);switch(U[0]){case 1:if(n.push(P),w.push(I.yytext),i.push(I.yylloc),n.push(U[1]),P=null,!Nt){if(J=I.yyleng,d=I.yytext,X=I.yylineno,It=I.yylloc,lt>0)lt--}else P=Nt,Nt=null;break;case 2:if(q=this.productions_[U[1]][1],at.$=w[w.length-q],at._$={first_line:i[i.length-(q||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(q||1)].first_column,last_column:i[i.length-1].last_column},ke)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[d,J,X,tt.yy,U[1],w,i].concat(be)),typeof Ot<"u")return Ot;if(q)n=n.slice(0,-1*q*2),w=w.slice(0,-1*q),i=i.slice(0,-1*q);n.push(this.productions_[U[1]][0]),w.push(at.$),i.push(at._$),jt=it[n[n.length-2]][n[n.length-1]],n.push(jt);break;case 3:return!0}}return!0},"parse")},me=function(){var Q={EOF:1,parseError:e(function(g,n){if(this.yy.parser)this.yy.parser.parseError(g,n);else throw Error(g)},"parseError"),setInput:e(function(h,g){if(this.yy=g||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var g=h.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:e(function(h){var g=h.length,n=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var _=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1)this.yylineno-=n.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===_.length?this.yylloc.first_column:0)+_[_.length-n.length].length-n[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(h){this.unput(this.match.slice(h))},"less"),pastInput:e(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var h=this.pastInput(),g=Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
5
  `+g+"^"},"showPosition"),test_match:e(function(h,g){var n,_,w;if(this.options.backtrack_lexer){if(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)w.yylloc.range=this.yylloc.range.slice(0)}if(_=h[0].match(/(?:\r\n?|\n).*/g),_)this.yylineno+=_.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],n=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(n)return n;else if(this._backtrack){for(var i in w)this[i]=w[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,g,n,_;if(!this._more)this.yytext="",this.match="";var w=this._currentRules();for(var i=0;i<w.length;i++)if(n=this._input.match(this.rules[w[i]]),n&&(!g||n[0].length>g[0].length)){if(g=n,_=i,this.options.backtrack_lexer)if(h=this.test_match(n,w[i]),h!==!1)return h;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(h=this.test_match(g,w[_]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:e(function(g){this.conditionStack.push(g)},"begin"),popState:e(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:e(function(g){this.begin(g)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(g,n,_,w){function i(){let d=n.yytext.indexOf("%%");if(d===0)return!1;if(d>0){let X=n.yytext.slice(0,d),J=n.yytext.slice(d);if(J)g.lexer.unput(J);n.yytext=X}return!0}e(i,"processId");var it=w;switch(_){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!i())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!i())return;return this.popState(),"ID";break;case 66:if(!i())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;break;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!i())return;return 24;case 74:return n.yytext=n.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return Q}();Lt.lexer=Se;function Tt(){this.yy={}}return e(Tt,"Parser"),Tt.prototype=Lt,Lt.Parser=Tt,new Tt}();Bt.parser=Bt;var Te=Bt,Ee="TB",qt="TB",Ut="dir",ot="state",nt="root",Gt="relation",_e="classDef",De="style",Ce="applyClass",ft="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",re="markdown",ie="normal",Ft="rect",Pt="rectWithTitle",Ae="stateStart",xe="stateEnd",Yt="divider",Ht="roundedWithTitle",Le="note",we="noteGroup",pt="statediagram",Ie="state",Ne=`${pt}-${Ie}`,ae="transition",Oe="note",$e="note-edge",Fe=`${ae} ${$e}`,Pe=`${pt}-${Oe}`,Be="cluster",Ge=`${pt}-${Be}`,Ye="cluster-alt",Ve=`${pt}-${Ye}`,ne="parent",ce="note",Me="state",Vt="----",We=`${Vt}${ce}`,zt=`${Vt}${ne}`,At=new Map,Z=0,he=0,ct=new Map,je=e((t,s,c,r)=>{if(t===Yt&&c?.id!==void 0&&ct.has(c.id)){let m=ct.get(c.id);return ct.set(s,m),m}let u=he++,f=r?void 0:u;return ct.set(s,f),f},"colorSlotFor");function xt(t="",s=0,c="",r=Vt){let u=c!==null&&c.length>0?`${r}${c}`:"";return`${Me}-${t}${u}-${s}`}e(xt,"stateDomId");var Ue=e((t,s,c,r,u,f,m,b)=>{a.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:ut(t,o,c,r,u,f,m,b);break;case ft:ut(t,o,c,r,u,f,m,b);break;case Gt:{ut(t,o.state1,c,r,u,f,m,b),ut(t,o.state2,c,r,u,f,m,b);let D=m==="neo",x={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:D?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:v.sanitizeText(o.description??"",l()),arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,classes:ae,look:m};u.push(x),Z++}break}})},"setupDoc"),Kt=e((t,s=qt)=>{let c=s;if(t.doc){for(let r of t.doc)if(r.stmt==="dir")c=r.value}return c},"getDir");function dt(t,s,c){if(!s.id||s.id==="</join></fork>"||s.id==="</choice>")return;if(s.cssClasses){if(!Array.isArray(s.cssCompiledStyles))s.cssCompiledStyles=[];s.cssClasses.split(" ").forEach((u)=>{let f=c.get(u);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=t.find((u)=>u.id===s.id);if(r)Object.assign(r,s);else t.push(s)}e(dt,"insertOrUpdateNode");function de(t){return t?.classes?.join(" ")??""}e(de,"getClassesFromDbInfo");function fe(t){return t?.styles??[]}e(fe,"getStylesFromDbInfo");var ut=e((t,s,c,r,u,f,m,b)=>{let o=s.id,D=c.get(o),x=de(D),G=fe(D),Y=l(),j=x.trim()!==""||G.length>0;if(a.info("dataFetcher parsedItem",s,D,G),o!=="root"){let O=Ft;if(s.start===!0)O=Ae;else if(s.start===!1)O=xe;if(s.type!==ft)O=s.type;if(!At.get(o))At.set(o,{id:o,shape:O,description:v.sanitizeText(o,Y),cssClasses:`${x} ${Ne}`,cssStyles:G});let y=At.get(o);if(s.description){if(Array.isArray(y.description))y.shape=Pt,y.description.push(s.description);else if(y.description?.length&&y.description.length>0)if(y.shape=Pt,y.description===o)y.description=[s.description];else y.description=[y.description,s.description];else y.shape=Ft,y.description=s.description;y.description=v.sanitizeTextOrArray(y.description,Y)}if(y.description?.length===1&&y.shape===Pt)if(y.type==="group")y.shape=Ht;else y.shape=Ft;if(!y.type&&s.doc)a.info("Setting cluster for XCX",o,Kt(s)),y.type="group",y.isGroup=!0,y.dir=Kt(s),y.shape=s.type===Qt?Yt:Ht,y.colorIndex=je(y.shape,o,t,j),y.cssClasses=`${y.cssClasses} ${Ge} ${f?Ve:""}`;let V={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:o,dir:y.dir,domId:xt(o,Z),type:y.type,isGroup:y.type==="group",colorIndex:y.colorIndex,padding:8,rx:10,ry:10,look:m,labelType:"markdown"};if(V.shape===Yt)V.label="";if(t&&t.id!=="root")a.trace("Setting node ",o," to be child of its parent ",t.id),V.parentId=t.id;if(V.centerLabel=!0,s.note){let F={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Pe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,ce),type:"node",isGroup:!1,padding:Y.flowchart?.padding,look:m,position:s.note.position},z=o+zt,W={labelStyle:"",shape:we,label:s.note.text,cssClasses:y.cssClasses,cssStyles:[],id:o+zt,domId:xt(o,Z,ne),type:"group",isGroup:!0,padding:16,look:m,position:s.note.position};Z++,W.id=z,F.parentId=z,dt(r,W,b),dt(r,F,b),dt(r,V,b);let K=o,N=F.id;if(s.note.position==="left of")K=F.id,N=o;u.push({id:K+"-"+N,start:K,end:N,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:Fe,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,look:m})}else dt(r,V,b)}if(s.doc)a.trace("Adding nodes children "),Ue(s,s.doc,c,r,u,!f,m,b)},"dataFetcher"),He=e(()=>{At.clear(),Z=0,he=0,ct.clear()},"reset"),pe=e((t,s=qt)=>{if(!t.doc)return s;let c=s;for(let r of t.doc)if(r.stmt==="dir")c=r.value;return c},"getDir"),ze=e(function(t,s){return s.db.getClasses()},"getClasses"),Ke=e(async function(t,s,c,r){a.info("REF0:"),a.info("Drawing state diagram (v2)",s);let{securityLevel:u,state:f,layout:m}=l();r.db.extract(r.db.getRootDocV2());let b=r.db.getData(),o=ge(s,u);if(b.type=r.type,b.layoutAlgorithm=ve(m),b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,l().look==="neo")b.markers=["barbNeo"];else b.markers=["barb"];b.diagramId=s,await ye(b,o);let x=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((Y,j)=>{let O=typeof j==="string"?j:typeof j?.id==="string"?j.id:"",y=b.nodes.find((N)=>N.id===O);if(!O){a.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(j));return}let V=o.node()?.querySelectorAll("g.node, g.rough-node"),F;if(V?.forEach((N)=>{let st=N.textContent?.trim();if(N.id===y?.domId||st===O)F=N}),!F){a.warn("⚠️ Could not find node matching text:",O);return}let z=F.parentNode;if(!z){a.warn("⚠️ Node has no parent, cannot wrap:",O);return}let W=document.createElementNS("http://www.w3.org/2000/svg","a"),K=Y.url.replace(/^"+|"+$/g,"");if(W.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",K),W.setAttribute("target","_blank"),Y.tooltip){let N=Y.tooltip.replace(/^"+|"+$/g,"");W.setAttribute("title",N),F.setAttribute("title",N)}z.replaceChild(W,F),W.appendChild(F),a.info("\uD83D\uDD17 Wrapped node in <a> tag for:",O,Y.url)})}catch(G){a.error("❌ Error injecting clickable links:",G)}M.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),le(o,x,pt,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:pe},B={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Xt=e(()=>new Map,"newClassesList"),Jt=e(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Ct=e((t)=>JSON.parse(JSON.stringify(t)),"clone"),Je=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Xt(),this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=E,this.setAccTitle=S,this.getAccDescription=A,this.setAccDescription=T,this.setDiagramTitle=R,this.getDiagramTitle=L,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{e(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(let r of Array.isArray(t)?t:t.doc)switch(r.stmt){case ot:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Gt:this.addRelation(r.state1,r.state2,r.description);break;case _e:this.addStyleClass(r.id.trim(),r.classes);break;case De:this.handleStyleDef(r);break;case Ce:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),c=l();He(),ut(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,c.look,this.classes);for(let r of this.nodes){if(!Array.isArray(r.label))continue;if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(t){let s=t.id.trim().split(","),c=t.styleClass.split(",");for(let r of s){let u=this.getState(r);if(!u){let f=r.trim();this.addState(f),u=this.getState(f)}if(u)u.styles=c.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(t){if(a.info("Setting root doc",t),this.rootDoc=t,this.version===1)this.extract(t);else this.extract(this.getRootDocV2())}docTranslator(t,s,c){if(s.stmt===Gt){this.docTranslator(t,s.state1,!0),this.docTranslator(t,s.state2,!1);return}if(s.stmt===ot)if(s.id===B.START_NODE)s.id=t.id+(c?"_start":"_end"),s.start=c;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],u=[];for(let f of s.doc)if(f.type===Qt){let m=Ct(f);m.doc=Ct(u),r.push(m),u=[]}else u.push(f);if(r.length>0&&u.length>0){let f={stmt:ot,id:Ui(),type:"divider",doc:Ct(u)};r.push(Ct(f)),s.doc=r}s.doc.forEach((f)=>this.docTranslator(s,f,!0))}getRootDocV2(){return this.docTranslator({id:nt,stmt:nt},{id:nt,stmt:nt,doc:this.rootDoc},!0),{id:nt,doc:this.rootDoc}}addState(t,s=ft,c=void 0,r=void 0,u=void 0,f=void 0,m=void 0,b=void 0){let o=t?.trim();if(!this.currentDocument.states.has(o))a.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:c,note:u,classes:[],styles:[],textStyles:[]});else{let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);if(!D.doc)D.doc=c;if(!D.type)D.type=s}if(r)a.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((x)=>this.addDescription(o,x.trim()));if(u){let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);D.note=u,D.note.text=v.sanitizeText(D.note.text,l())}if(f)a.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((x)=>this.setCssClass(o,x.trim()));if(m)a.info("Setting state styles",o,m),(Array.isArray(m)?m:[m]).forEach((x)=>this.setStyle(o,x.trim()));if(b)a.info("Setting state styles",o,m),(Array.isArray(b)?b:[b]).forEach((x)=>this.setTextStyle(o,x.trim()))}clear(t){if(this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xt(),!t)this.links=new Map,C()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){a.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,s,c){this.links.set(t,{url:s,tooltip:c}),a.warn("Adding link",t,s,c)}getLinks(){return this.links}startIdIfNeeded(t=""){if(t===B.START_NODE)return this.startEndCount++,`${B.START_TYPE}${this.startEndCount}`;return t}startTypeIfNeeded(t="",s=ft){return t===B.START_NODE?B.START_TYPE:s}endIdIfNeeded(t=""){if(t===B.END_NODE)return this.startEndCount++,`${B.END_TYPE}${this.startEndCount}`;return t}endTypeIfNeeded(t="",s=ft){return t===B.END_NODE?B.END_TYPE:s}addRelationObjs(t,s,c=""){let r=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),f=this.startIdIfNeeded(s.id.trim()),m=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(f,m,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:v.sanitizeText(c,l())})}addRelation(t,s,c){if(typeof t==="object"&&typeof s==="object")this.addRelationObjs(t,s,c);else if(typeof t==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),f=this.endIdIfNeeded(s.trim()),m=this.endTypeIfNeeded(s);this.addState(r,u),this.addState(f,m),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:c?v.sanitizeText(c,l()):void 0})}}addDescription(t,s){let c=this.currentDocument.states.get(t),r=s.startsWith(":")?s.replace(":","").trim():s;c?.descriptions?.push(v.sanitizeText(r,l()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,s=""){if(!this.classes.has(t))this.classes.set(t,{id:t,styles:[],textStyles:[]});let c=this.classes.get(t);if(s&&c)s.split(B.STYLECLASS_SEP).forEach((r)=>{let u=r.replace(/([^;]*);/,"$1").trim();if(RegExp(B.COLOR_KEYWORD).exec(r)){let m=u.replace(B.FILL_KEYWORD,B.BG_FILL).replace(B.COLOR_KEYWORD,B.FILL_KEYWORD);c.textStyles.push(m)}c.styles.push(u)})}getClasses(){return this.classes}setupToolTips(t){let s=$t();p(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(u)=>{let f=p(u.currentTarget),m=f.attr("title");if(m===null)return;let b=u.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),s.html(Re.sanitize(m)),f.classed("hover",!0)}).on("mouseout",(u)=>{s.transition().duration(500).style("opacity",0),p(u.currentTarget).classed("hover",!1)})}setCssClass(t,s){t.split(",").forEach((c)=>{let r=this.getState(c);if(!r){let u=c.trim();this.addState(u),r=this.getState(u)}r?.classes?.push(s)})}setStyle(t,s){this.getState(t)?.styles?.push(s)}setTextStyle(t,s){this.getState(t)?.textStyles?.push(s)}bindFunctions(t){this.funs.forEach((s)=>{s(t)})}getDirectionStatement(){return this.rootDoc.find((t)=>t.stmt===Ut)}getDirection(){return this.getDirectionStatement()?.value??Ee}setDirection(t){let s=this.getDirectionStatement();if(s)s.value=t;else this.rootDoc.unshift({stmt:Ut,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=l();for(let s of this.nodes)if(s.wrappingWidth??=t.state?.wrappingWidth,!s.isGroup)s.minWidth??=t.state?.minNodeWidth;return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:pe(this.getRootDocV2())}}getConfig(){return l().state}},qe=e((t)=>{let{theme:s,bkgColorArray:c,borderColorArray:r}=t;if(!oe(s,r))return"";let u=se(t.look),f=ue(c),m="";for(let b=0;b<ht(r);b++){let o=r[b],D=f?`fill: ${c[b%c.length]};`:"",x=`[data-look="${u}"][data-color-id="color-${b}"]`;m+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:e(function(g){this.conditionStack.push(g)},"begin"),popState:e(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:e(function(g){this.begin(g)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(g,n,_,w){function i(){let d=n.yytext.indexOf("%%");if(d===0)return!1;if(d>0){let X=n.yytext.slice(0,d),J=n.yytext.slice(d);if(J)g.lexer.unput(J);n.yytext=X}return!0}e(i,"processId");var it=w;switch(_){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!i())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!i())return;return this.popState(),"ID";break;case 66:if(!i())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;break;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!i())return;return 24;case 74:return n.yytext=n.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return Q}();Lt.lexer=me;function Tt(){this.yy={}}return e(Tt,"Parser"),Tt.prototype=Lt,Lt.Parser=Tt,new Tt}();Bt.parser=Bt;var Ee=Bt,_e="TB",qt="TB",Ut="dir",ot="state",nt="root",Gt="relation",ve="classDef",De="style",Ce="applyClass",ut="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",re="markdown",ie="normal",Ft="rect",Pt="rectWithTitle",Ae="stateStart",xe="stateEnd",Yt="divider",Ht="roundedWithTitle",Le="note",we="noteGroup",ft="statediagram",Ie="state",Ne=`${ft}-${Ie}`,ae="transition",Oe="note",$e="note-edge",Fe=`${ae} ${$e}`,Pe=`${ft}-${Oe}`,Be="cluster",Ge=`${ft}-${Be}`,Ye="cluster-alt",Ve=`${ft}-${Ye}`,ne="parent",ce="note",Me="state",Vt="----",We=`${Vt}${ce}`,zt=`${Vt}${ne}`,At=new Map,Z=0,de=0,ct=new Map,je=e((t,s,c,r)=>{if(t===Yt&&c?.id!==void 0&&ct.has(c.id)){let m=ct.get(c.id);return ct.set(s,m),m}let u=de++,f=r?void 0:u;return ct.set(s,f),f},"colorSlotFor");function xt(t="",s=0,c="",r=Vt){let u=c!==null&&c.length>0?`${r}${c}`:"";return`${Me}-${t}${u}-${s}`}e(xt,"stateDomId");var Ue=e((t,s,c,r,u,f,m,b)=>{a.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:dt(t,o,c,r,u,f,m,b);break;case ut:dt(t,o,c,r,u,f,m,b);break;case Gt:{dt(t,o.state1,c,r,u,f,m,b),dt(t,o.state2,c,r,u,f,m,b);let D=m==="neo",x={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:D?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:v.sanitizeText(o.description??"",l()),arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,classes:ae,look:m};u.push(x),Z++}break}})},"setupDoc"),Kt=e((t,s=qt)=>{let c=s;if(t.doc){for(let r of t.doc)if(r.stmt==="dir")c=r.value}return c},"getDir");function ht(t,s,c){if(!s.id||s.id==="</join></fork>"||s.id==="</choice>")return;if(s.cssClasses){if(!Array.isArray(s.cssCompiledStyles))s.cssCompiledStyles=[];s.cssClasses.split(" ").forEach((u)=>{let f=c.get(u);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=t.find((u)=>u.id===s.id);if(r)Object.assign(r,s);else t.push(s)}e(ht,"insertOrUpdateNode");function fe(t){return t?.classes?.join(" ")??""}e(fe,"getClassesFromDbInfo");function pe(t){return t?.styles??[]}e(pe,"getStylesFromDbInfo");var dt=e((t,s,c,r,u,f,m,b)=>{let o=s.id,D=c.get(o),x=fe(D),G=pe(D),Y=l(),j=x.trim()!==""||G.length>0;if(a.info("dataFetcher parsedItem",s,D,G),o!=="root"){let O=Ft;if(s.start===!0)O=Ae;else if(s.start===!1)O=xe;if(s.type!==ut)O=s.type;if(!At.get(o))At.set(o,{id:o,shape:O,description:v.sanitizeText(o,Y),cssClasses:`${x} ${Ne}`,cssStyles:G});let y=At.get(o);if(s.description){if(Array.isArray(y.description))y.shape=Pt,y.description.push(s.description);else if(y.description?.length&&y.description.length>0)if(y.shape=Pt,y.description===o)y.description=[s.description];else y.description=[y.description,s.description];else y.shape=Ft,y.description=s.description;y.description=v.sanitizeTextOrArray(y.description,Y)}if(y.description?.length===1&&y.shape===Pt)if(y.type==="group")y.shape=Ht;else y.shape=Ft;if(!y.type&&s.doc)a.info("Setting cluster for XCX",o,Kt(s)),y.type="group",y.isGroup=!0,y.dir=Kt(s),y.shape=s.type===Qt?Yt:Ht,y.colorIndex=je(y.shape,o,t,j),y.cssClasses=`${y.cssClasses} ${Ge} ${f?Ve:""}`;let V={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:o,dir:y.dir,domId:xt(o,Z),type:y.type,isGroup:y.type==="group",colorIndex:y.colorIndex,padding:8,rx:10,ry:10,look:m,labelType:"markdown"};if(V.shape===Yt)V.label="";if(t&&t.id!=="root")a.trace("Setting node ",o," to be child of its parent ",t.id),V.parentId=t.id;if(V.centerLabel=!0,s.note){let F={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Pe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,ce),type:"node",isGroup:!1,padding:Y.flowchart?.padding,look:m,position:s.note.position},z=o+zt,W={labelStyle:"",shape:we,label:s.note.text,cssClasses:y.cssClasses,cssStyles:[],id:o+zt,domId:xt(o,Z,ne),type:"group",isGroup:!0,padding:16,look:m,position:s.note.position};Z++,W.id=z,F.parentId=z,ht(r,W,b),ht(r,F,b),ht(r,V,b);let K=o,N=F.id;if(s.note.position==="left of")K=F.id,N=o;u.push({id:K+"-"+N,start:K,end:N,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:Fe,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,look:m})}else ht(r,V,b)}if(s.doc)a.trace("Adding nodes children "),Ue(s,s.doc,c,r,u,!f,m,b)},"dataFetcher"),He=e(()=>{At.clear(),Z=0,de=0,ct.clear()},"reset"),Se=e((t,s=qt)=>{if(!t.doc)return s;let c=s;for(let r of t.doc)if(r.stmt==="dir")c=r.value;return c},"getDir"),ze=e(function(t,s){return s.db.getClasses()},"getClasses"),Ke=e(async function(t,s,c,r){a.info("REF0:"),a.info("Drawing state diagram (v2)",s);let{securityLevel:u,state:f,layout:m}=l();r.db.extract(r.db.getRootDocV2());let b=r.db.getData(),o=he(s,u);if(b.type=r.type,b.layoutAlgorithm=ye(m),b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,l().look==="neo")b.markers=["barbNeo"];else b.markers=["barb"];b.diagramId=s,await ge(b,o);let x=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((Y,j)=>{let O=typeof j==="string"?j:typeof j?.id==="string"?j.id:"",y=b.nodes.find((N)=>N.id===O);if(!O){a.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(j));return}let V=o.node()?.querySelectorAll("g.node, g.rough-node"),F;if(V?.forEach((N)=>{let st=N.textContent?.trim();if(N.id===y?.domId||st===O)F=N}),!F){a.warn("⚠️ Could not find node matching text:",O);return}let z=F.parentNode;if(!z){a.warn("⚠️ Node has no parent, cannot wrap:",O);return}let W=document.createElementNS("http://www.w3.org/2000/svg","a"),K=Y.url.replace(/^"+|"+$/g,"");if(W.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",K),W.setAttribute("target","_blank"),Y.tooltip){let N=Y.tooltip.replace(/^"+|"+$/g,"");W.setAttribute("title",N),F.setAttribute("title",N)}z.replaceChild(W,F),W.appendChild(F),a.info("\uD83D\uDD17 Wrapped node in <a> tag for:",O,Y.url)})}catch(G){a.error("❌ Error injecting clickable links:",G)}M.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),le(o,x,ft,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:Se},B={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Xt=e(()=>new Map,"newClassesList"),Jt=e(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Ct=e((t)=>JSON.parse(JSON.stringify(t)),"clone"),Je=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Xt(),this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=E,this.setAccTitle=S,this.getAccDescription=A,this.setAccDescription=T,this.setDiagramTitle=R,this.getDiagramTitle=L,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{e(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(let r of Array.isArray(t)?t:t.doc)switch(r.stmt){case ot:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Gt:this.addRelation(r.state1,r.state2,r.description);break;case ve:this.addStyleClass(r.id.trim(),r.classes);break;case De:this.handleStyleDef(r);break;case Ce:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),c=l();He(),dt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,c.look,this.classes);for(let r of this.nodes){if(!Array.isArray(r.label))continue;if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(t){let s=t.id.trim().split(","),c=t.styleClass.split(",");for(let r of s){let u=this.getState(r);if(!u){let f=r.trim();this.addState(f),u=this.getState(f)}if(u)u.styles=c.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(t){if(a.info("Setting root doc",t),this.rootDoc=t,this.version===1)this.extract(t);else this.extract(this.getRootDocV2())}docTranslator(t,s,c){if(s.stmt===Gt){this.docTranslator(t,s.state1,!0),this.docTranslator(t,s.state2,!1);return}if(s.stmt===ot)if(s.id===B.START_NODE)s.id=t.id+(c?"_start":"_end"),s.start=c;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],u=[];for(let f of s.doc)if(f.type===Qt){let m=Ct(f);m.doc=Ct(u),r.push(m),u=[]}else u.push(f);if(r.length>0&&u.length>0){let f={stmt:ot,id:Ui(),type:"divider",doc:Ct(u)};r.push(Ct(f)),s.doc=r}s.doc.forEach((f)=>this.docTranslator(s,f,!0))}getRootDocV2(){return this.docTranslator({id:nt,stmt:nt},{id:nt,stmt:nt,doc:this.rootDoc},!0),{id:nt,doc:this.rootDoc}}addState(t,s=ut,c=void 0,r=void 0,u=void 0,f=void 0,m=void 0,b=void 0){let o=t?.trim();if(!this.currentDocument.states.has(o))a.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:c,note:u,classes:[],styles:[],textStyles:[]});else{let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);if(!D.doc)D.doc=c;if(!D.type)D.type=s}if(r)a.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((x)=>this.addDescription(o,x.trim()));if(u){let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);D.note=u,D.note.text=v.sanitizeText(D.note.text,l())}if(f)a.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((x)=>this.setCssClass(o,x.trim()));if(m)a.info("Setting state styles",o,m),(Array.isArray(m)?m:[m]).forEach((x)=>this.setStyle(o,x.trim()));if(b)a.info("Setting state styles",o,m),(Array.isArray(b)?b:[b]).forEach((x)=>this.setTextStyle(o,x.trim()))}clear(t){if(this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xt(),!t)this.links=new Map,C()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){a.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,s,c){this.links.set(t,{url:s,tooltip:c}),a.warn("Adding link",t,s,c)}getLinks(){return this.links}startIdIfNeeded(t=""){if(t===B.START_NODE)return this.startEndCount++,`${B.START_TYPE}${this.startEndCount}`;return t}startTypeIfNeeded(t="",s=ut){return t===B.START_NODE?B.START_TYPE:s}endIdIfNeeded(t=""){if(t===B.END_NODE)return this.startEndCount++,`${B.END_TYPE}${this.startEndCount}`;return t}endTypeIfNeeded(t="",s=ut){return t===B.END_NODE?B.END_TYPE:s}addRelationObjs(t,s,c=""){let r=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),f=this.startIdIfNeeded(s.id.trim()),m=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(f,m,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:v.sanitizeText(c,l())})}addRelation(t,s,c){if(typeof t==="object"&&typeof s==="object")this.addRelationObjs(t,s,c);else if(typeof t==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),f=this.endIdIfNeeded(s.trim()),m=this.endTypeIfNeeded(s);this.addState(r,u),this.addState(f,m),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:c?v.sanitizeText(c,l()):void 0})}}addDescription(t,s){let c=this.currentDocument.states.get(t),r=s.startsWith(":")?s.replace(":","").trim():s;c?.descriptions?.push(v.sanitizeText(r,l()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,s=""){if(!this.classes.has(t))this.classes.set(t,{id:t,styles:[],textStyles:[]});let c=this.classes.get(t);if(s&&c)s.split(B.STYLECLASS_SEP).forEach((r)=>{let u=r.replace(/([^;]*);/,"$1").trim();if(RegExp(B.COLOR_KEYWORD).exec(r)){let m=u.replace(B.FILL_KEYWORD,B.BG_FILL).replace(B.COLOR_KEYWORD,B.FILL_KEYWORD);c.textStyles.push(m)}c.styles.push(u)})}getClasses(){return this.classes}setupToolTips(t){let s=$t();p(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(u)=>{let f=p(u.currentTarget),m=f.attr("title");if(m===null)return;let b=u.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),s.html(Re.sanitize(m)),f.classed("hover",!0)}).on("mouseout",(u)=>{s.transition().duration(500).style("opacity",0),p(u.currentTarget).classed("hover",!1)})}setCssClass(t,s){t.split(",").forEach((c)=>{let r=this.getState(c);if(!r){let u=c.trim();this.addState(u),r=this.getState(u)}r?.classes?.push(s)})}setStyle(t,s){this.getState(t)?.styles?.push(s)}setTextStyle(t,s){this.getState(t)?.textStyles?.push(s)}bindFunctions(t){this.funs.forEach((s)=>{s(t)})}getDirectionStatement(){return this.rootDoc.find((t)=>t.stmt===Ut)}getDirection(){return this.getDirectionStatement()?.value??_e}setDirection(t){let s=this.getDirectionStatement();if(s)s.value=t;else this.rootDoc.unshift({stmt:Ut,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=l();for(let s of this.nodes)if(s.wrappingWidth??=t.state?.wrappingWidth,!s.isGroup)s.minWidth??=t.state?.minNodeWidth;return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Se(this.getRootDocV2())}}getConfig(){return l().state}},qe=e((t)=>{let{theme:s,bkgColorArray:c,borderColorArray:r}=t;if(!oe(s,r))return"";let u=se(t.look),f=ue(c),m="";for(let b=0;b<gt(r);b++){let o=r[b],D=f?`fill: ${c[b%c.length]};`:"",x=`[data-look="${u}"][data-color-id="color-${b}"]`;m+=`
7
7
 
8
8
  /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers
9
9
  the body, so what stays visible of \`outer\` is the band behind the label. */
@@ -288,4 +288,4 @@ g.stateGroup line {
288
288
  ry: ${t.radius}px;
289
289
  filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
290
290
  }
291
- `,"getStyles"),Ze=Qe,ks={parser:Te,get db(){return new Je(2)},renderer:Xe,styles:Ze,init:e((t)=>{if(!t.state)t.state={};t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{ks as diagram};
291
+ `,"getStyles"),Ze=Qe,ks={parser:Ee,get db(){return new Je(2)},renderer:Xe,styles:Ze,init:e((t)=>{if(!t.state)t.state={};t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{ks as diagram};
@@ -1,4 +1,4 @@
1
- import{G}from"./chunk-14bad871.js";import{e,a,D,B,C,S,E,T,A,R,L,l,ee,qn,Gr,V,We,U}from"./chunk-pyg1mr80.js";import{X}from"./chunk-zc1mk10n.js";import{_t}from"./chunk-f9k3xrwb.js";import{Xe}from"./chunk-07agqp8h.js";function rt(t,o){return o<t?-1:o>t?1:o>=t?0:NaN}function at(t){return t}function nt(){var t=at,o=rt,k=null,H=ee(0),g=ee(qn),h=ee(0);function s(r){var i,u=(r=Gr(r)).length,m,z,W=0,v=Array(u),c=Array(u),F=+H.apply(this,arguments),_=Math.min(qn,Math.max(-qn,g.apply(this,arguments)-F)),N,Z=Math.min(Math.abs(_)/u,h.apply(this,arguments)),p=Z*(_<0?-1:1),M;for(i=0;i<u;++i)if((M=c[v[i]=i]=+t(r[i],i,r))>0)W+=M;if(o!=null)v.sort(function(I,x){return o(c[I],c[x])});else if(k!=null)v.sort(function(I,x){return k(r[I],r[x])});for(i=0,z=W?(_-u*p)/W:0;i<u;++i,F=N)m=v[i],M=c[m],N=F+(M>0?M*z:0)+p,c[m]={data:r[m],index:i,value:M,startAngle:F,endAngle:N,padAngle:Z};return c}return s.value=function(r){return arguments.length?(t=typeof r==="function"?r:ee(+r),s):t},s.sortValues=function(r){return arguments.length?(o=r,k=null,s):o},s.sort=function(r){return arguments.length?(k=r,o=null,s):k},s.startAngle=function(r){return arguments.length?(H=typeof r==="function"?r:ee(+r),s):H},s.endAngle=function(r){return arguments.length?(g=typeof r==="function"?r:ee(+r),s):g},s.padAngle=function(r){return arguments.length?(h=typeof r==="function"?r:ee(+r),s):h},s}var gt=D.pie,it={sections:new Map,showData:!1,config:gt},{sections:K,showData:ot}=it,xt=structuredClone(gt),St=e(()=>structuredClone(xt),"getConfig"),yt=e(()=>{K=new Map,ot=it.showData,C()},"clear"),wt=e(({label:t,value:o})=>{if(o<0)throw Error(`"${t}" has invalid value: ${o}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);if(!K.has(t))K.set(t,o),a.debug(`added new section: ${t}, with value: ${o}`)},"addSection"),At=e(()=>K,"getSections"),Ct=e((t)=>{ot=t},"setShowData"),$t=e(()=>ot,"getShowData"),dt={getConfig:St,clear:yt,setDiagramTitle:R,getDiagramTitle:L,setAccTitle:S,getAccTitle:E,setAccDescription:T,getAccDescription:A,addSection:wt,getSections:At,setShowData:Ct,getShowData:$t},Dt=e((t,o)=>{G(t,o),o.setShowData(t.showData),t.sections.map(o.addSection)},"populateDb"),Tt={parse:e(async(t)=>{let o=await X("pie",t);a.debug(o),Dt(o,dt)},"parse")},bt=e((t)=>`
1
+ import{G}from"./chunk-ya3ghn3n.js";import{e,a,D,B,C,S,E,T,A,R,L,l,ne,qn,Gr,V,We,U}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";import{_t}from"./chunk-xc2sq3t5.js";import{Xe}from"./chunk-07agqp8h.js";function rt(t,o){return o<t?-1:o>t?1:o>=t?0:NaN}function at(t){return t}function nt(){var t=at,o=rt,k=null,H=ne(0),g=ne(qn),h=ne(0);function s(r){var i,u=(r=Gr(r)).length,m,z,W=0,v=Array(u),c=Array(u),F=+H.apply(this,arguments),_=Math.min(qn,Math.max(-qn,g.apply(this,arguments)-F)),N,Z=Math.min(Math.abs(_)/u,h.apply(this,arguments)),p=Z*(_<0?-1:1),M;for(i=0;i<u;++i)if((M=c[v[i]=i]=+t(r[i],i,r))>0)W+=M;if(o!=null)v.sort(function(I,x){return o(c[I],c[x])});else if(k!=null)v.sort(function(I,x){return k(r[I],r[x])});for(i=0,z=W?(_-u*p)/W:0;i<u;++i,F=N)m=v[i],M=c[m],N=F+(M>0?M*z:0)+p,c[m]={data:r[m],index:i,value:M,startAngle:F,endAngle:N,padAngle:Z};return c}return s.value=function(r){return arguments.length?(t=typeof r==="function"?r:ne(+r),s):t},s.sortValues=function(r){return arguments.length?(o=r,k=null,s):o},s.sort=function(r){return arguments.length?(k=r,o=null,s):k},s.startAngle=function(r){return arguments.length?(H=typeof r==="function"?r:ne(+r),s):H},s.endAngle=function(r){return arguments.length?(g=typeof r==="function"?r:ne(+r),s):g},s.padAngle=function(r){return arguments.length?(h=typeof r==="function"?r:ne(+r),s):h},s}var gt=D.pie,it={sections:new Map,showData:!1,config:gt},{sections:K,showData:ot}=it,xt=structuredClone(gt),St=e(()=>structuredClone(xt),"getConfig"),yt=e(()=>{K=new Map,ot=it.showData,C()},"clear"),wt=e(({label:t,value:o})=>{if(o<0)throw Error(`"${t}" has invalid value: ${o}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);if(!K.has(t))K.set(t,o),a.debug(`added new section: ${t}, with value: ${o}`)},"addSection"),At=e(()=>K,"getSections"),Ct=e((t)=>{ot=t},"setShowData"),$t=e(()=>ot,"getShowData"),dt={getConfig:St,clear:yt,setDiagramTitle:R,getDiagramTitle:L,setAccTitle:S,getAccTitle:E,setAccDescription:T,getAccDescription:A,addSection:wt,getSections:At,setShowData:Ct,getShowData:$t},Dt=e((t,o)=>{G(t,o),o.setShowData(t.showData),t.sections.map(o.addSection)},"populateDb"),Tt={parse:e(async(t)=>{let o=await X("pie",t);a.debug(o),Dt(o,dt)},"parse")},bt=e((t)=>`
2
2
  .pieCircle{
3
3
  stroke: ${t.pieStrokeColor};
4
4
  stroke-width : ${t.pieStrokeWidth};
package/web/index.html CHANGED
@@ -15,7 +15,7 @@
15
15
  <link rel="icon" href="./icon-1wgy7kzy.svg" type="image/svg+xml" />
16
16
  <link rel="apple-touch-icon" href="./apple-touch-icon-7dkm33qp.png" />
17
17
 
18
- <link rel="stylesheet" crossorigin href="./chunk-tf18d2dk.css"><script type="module" crossorigin src="./chunk-qmbgb79a.js"></script></head>
18
+ <link rel="stylesheet" crossorigin href="./chunk-39ng8zwx.css"><script type="module" crossorigin src="./chunk-j6a4z530.js"></script></head>
19
19
  <body>
20
20
  <div id="root"></div>
21
21
 
package/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e,Tt,Qr,qt,Ai,jo,Vo}from"./chunk-h1rypb99.js";var S="backfill";function c(t){return t.query("SELECT sum((SELECT max(seq) FROM store.entries WHERE session_id = sessions.id)) AS n FROM store.sessions").get()?.n??0}function k(t){let e=Qr(t,S);return e?JSON.parse(e):void 0}function y(t,e){qt(t,S,JSON.stringify(e))}class b{db;indexer;batch;todo;page;state;constructor(t,e,s=500){this.db=t;this.indexer=e;this.batch=s;this.todo=t.query("SELECT session_id FROM main.backfill_todo WHERE ord = ?"),this.page=t.query("SELECT seq, time, body FROM store.entries WHERE session_id = ? AND seq > ? ORDER BY seq LIMIT ?"),this.state=k(t)}get running(){return this.state?.state==="running"}begin(t){this.db.transaction(()=>{let e=this.db.query("SELECT max(id) AS id FROM store.search_queue").get()?.id??0;qt(this.db,"queue_done",e),this.db.run("DELETE FROM main.backfill_todo"),this.db.run("INSERT INTO main.backfill_todo (ord, session_id) SELECT row_number() OVER (ORDER BY updated DESC, id), id FROM store.sessions");let s=this.db.query("SELECT count(*) AS n FROM main.backfill_todo").get()?.n??0,r=c(this.db);this.state={state:s?"running":"done",reason:t,ord:1,seq:-1,total:r,sessionsTotal:s,done:0,sessionsDone:0,startedAt:Date.now()},y(this.db,this.state)})()}step(t){let e=this.state;if(e?.state!=="running")return!1;let s={...e};return this.db.transaction(()=>{let r=this.batch;while(r>0&&s.state==="running"){let n=this.todo.get(s.ord)?.session_id;if(n===void 0){s.state="done",this.db.run("DELETE FROM main.backfill_todo");break}if(s.seq<0)this.indexer.reindex(n,0),s.seq=0;let a=this.page.all(n,s.seq,r);for(let i of a)if(this.indexer.indexRow(n,i.seq,i.time,i.body),s.seq=i.seq,s.done++,r--,performance.now()>t){r=0;break}if(r>0)s.ord++,s.seq=-1,s.sessionsDone++;if(performance.now()>t)break}y(this.db,s)})(),this.state=s,!0}}var T=2000,M=30000;class E{options;db;layout;reset;indexer;backfill;terms;queueRows;queueMax;sliceMs;backfillSliceMs;queueBatch;termRefreshMs;queueDone;termCursor;termStale;lastTermRefresh=Number.NEGATIVE_INFINITY;rateStart;estimate;closed=!1;constructor(t){this.options=t;let e=Ai(t.indexPath,t.storePath,t.features);if(this.db=e.db,this.layout=e.layout,this.reset=e.reset,this.sliceMs=t.sliceMs??20,this.backfillSliceMs=t.backfillSliceMs??200,this.queueBatch=t.queueBatch??200,this.termRefreshMs=t.termRefreshMs??60000,this.indexer=new jo(this.db,this.layout),this.terms=new Vo(this.db),this.backfill=new b(this.db,this.indexer,t.batch??500),this.queueRows=this.db.query("SELECT id, session_id, seq FROM store.search_queue WHERE id > ? ORDER BY id LIMIT ?"),this.queueMax=this.db.query("SELECT max(id) AS id FROM store.search_queue"),!this.backfill.state)this.backfill.begin(this.reset?"rebuild":"initial");this.queueDone=Number(Qr(this.db,"queue_done")??0),this.termStale=Number(Qr(this.db,"term_stale")??0)===1}step(t){if(this.closed)return!1;if(this.drainQueue(t??performance.now()+this.sliceMs))return!0;if(this.backfill.running){this.rateStart??={time:performance.now(),done:this.backfill.state?.done??0};let e=this.indexer.outChanges;if(this.backfill.step(t??performance.now()+this.backfillSliceMs),this.markTerms(e),!this.backfill.running)this.lastTermRefresh=Number.NEGATIVE_INFINITY;return!0}return this.refreshTerms(t??performance.now()+this.sliceMs)}drain(){while(this.step());}drainQueue(t){let e=!1;return this.db.transaction(()=>{let s=this.queueRows.all(this.queueDone,this.queueBatch);if(!s.length)return;e=!0;let r=this.indexer.outChanges,n=new Set,a=this.queueDone;for(let i of s){let h=`${i.seq}\x00${i.session_id}`;if(!n.has(h))n.add(h),this.indexer.reindex(i.session_id,i.seq);if(a=i.id,performance.now()>t)break}qt(this.db,"queue_done",a),this.markTerms(r),this.queueDone=a})(),e}markTerms(t){if(this.indexer.outChanges===t||this.termStale)return;this.termStale=!0,qt(this.db,"term_stale",1)}refreshTerms(t){if(this.termCursor===void 0){if(!this.termStale||performance.now()-this.lastTermRefresh<this.termRefreshMs)return!1;this.termCursor="",this.termStale=!1,this.indexer.outChanges=0,qt(this.db,"term_stale",0)}while(this.termCursor!==void 0&&performance.now()<=t){let e=this.termCursor;this.db.transaction(()=>{this.termCursor=this.terms.step(e,T)})()}if(this.termCursor===void 0)this.lastTermRefresh=performance.now();return!0}status(){let t=this.queueMax.get()?.id??this.queueDone,e=this.backfill.state,s;if(e?.state==="running"&&this.rateStart){let n=(performance.now()-this.rateStart.time)/1000,a=(e.done-this.rateStart.done)/n;if(n>0.5&&a>0)s=Math.max(0,Math.round(Math.max(0,e.total-e.done)/a))}let r=e?{state:e.state,reason:e.reason,total:e.total,done:e.done,sessionsTotal:e.sessionsTotal,sessionsDone:e.sessionsDone,startedAt:e.startedAt}:void 0;if(!this.estimate||performance.now()-this.estimate.time>M)this.estimate={time:performance.now(),entries:c(this.db)};return{queueDone:this.queueDone,lag:Math.max(0,t-this.queueDone),entries:this.estimate.entries,...r?{backfill:r}:{},...s!==void 0?{etaSec:s}:{},layout:this.layout,reset:this.reset}}withIndex(t){return t(this.db)}close(){if(this.closed)return;this.closed=!0,this.db.close()}}var g=1000,x=100;function R(t){let e,s,r,n=!1,a=!1,i=0,h=[],l=(u)=>t.postMessage(u),d=(u)=>{if(a)return;if(r)clearTimeout(r);r=setTimeout(q,u)},p=()=>{if(!s||Atomics.load(s,$e)!==1)return;Atomics.store(s,Tt,1),Atomics.notify(s,Tt);while(Atomics.load(s,$e)===1)Atomics.wait(s,$e,1,1e4);Atomics.store(s,Tt,0)};function q(){if(r=void 0,a||!e)return;p();let u=!1;try{u=e.step()}catch(f){l({type:"error",message:f instanceof Error?f.message:String(f),fatal:!1}),n=!1,d(g);return}let o=performance.now();if(u){if(n=!0,o-i>=x)i=o,l({type:"status",status:e.status()});d(0);return}n=!1,i=o;let m=e.status();l({type:"status",status:m});for(let f of h.splice(0))l({type:"flushed",id:f,status:m});d(g)}t.onmessage=(u)=>{let o=u.data;if(o.type==="init"){s=new Int32Array(o.flags);try{e=new E(o.options)}catch(m){l({type:"error",message:m instanceof Error?m.message:String(m),fatal:!0});return}l({type:"status",status:e.status()}),d(0)}else if(o.type==="dirty"){if(!n)d(0)}else if(o.type==="pause")p();else if(o.type==="flush"){if(h.push(o.id),!n)d(0)}else if(o.type==="stop"){if(a=!0,r)clearTimeout(r);e?.close(),l({type:"stopped"})}}}if(!Bun.isMainThread)R(globalThis);export{E as SearchEngine};
2
+ import{He,Tt,Xr,qt,_i,jo,Vo}from"./chunk-8gw5bvh3.js";var S="backfill";function c(t){return t.query("SELECT sum((SELECT max(seq) FROM store.entries WHERE session_id = sessions.id)) AS n FROM store.sessions").get()?.n??0}function k(t){let e=Xr(t,S);return e?JSON.parse(e):void 0}function y(t,e){qt(t,S,JSON.stringify(e))}class b{db;indexer;batch;todo;page;state;constructor(t,e,s=500){this.db=t;this.indexer=e;this.batch=s;this.todo=t.query("SELECT session_id FROM main.backfill_todo WHERE ord = ?"),this.page=t.query("SELECT seq, time, body FROM store.entries WHERE session_id = ? AND seq > ? ORDER BY seq LIMIT ?"),this.state=k(t)}get running(){return this.state?.state==="running"}begin(t){this.db.transaction(()=>{let e=this.db.query("SELECT max(id) AS id FROM store.search_queue").get()?.id??0;qt(this.db,"queue_done",e),this.db.run("DELETE FROM main.backfill_todo"),this.db.run("INSERT INTO main.backfill_todo (ord, session_id) SELECT row_number() OVER (ORDER BY updated DESC, id), id FROM store.sessions");let s=this.db.query("SELECT count(*) AS n FROM main.backfill_todo").get()?.n??0,r=c(this.db);this.state={state:s?"running":"done",reason:t,ord:1,seq:-1,total:r,sessionsTotal:s,done:0,sessionsDone:0,startedAt:Date.now()},y(this.db,this.state)})()}step(t){let e=this.state;if(e?.state!=="running")return!1;let s={...e};return this.db.transaction(()=>{let r=this.batch;while(r>0&&s.state==="running"){let n=this.todo.get(s.ord)?.session_id;if(n===void 0){s.state="done",this.db.run("DELETE FROM main.backfill_todo");break}if(s.seq<0)this.indexer.reindex(n,0),s.seq=0;let a=this.page.all(n,s.seq,r);for(let i of a)if(this.indexer.indexRow(n,i.seq,i.time,i.body),s.seq=i.seq,s.done++,r--,performance.now()>t){r=0;break}if(r>0)s.ord++,s.seq=-1,s.sessionsDone++;if(performance.now()>t)break}y(this.db,s)})(),this.state=s,!0}}var T=2000,M=30000;class E{options;db;layout;reset;indexer;backfill;terms;queueRows;queueMax;sliceMs;backfillSliceMs;queueBatch;termRefreshMs;queueDone;termCursor;termStale;lastTermRefresh=Number.NEGATIVE_INFINITY;rateStart;estimate;closed=!1;constructor(t){this.options=t;let e=_i(t.indexPath,t.storePath,t.features);if(this.db=e.db,this.layout=e.layout,this.reset=e.reset,this.sliceMs=t.sliceMs??20,this.backfillSliceMs=t.backfillSliceMs??200,this.queueBatch=t.queueBatch??200,this.termRefreshMs=t.termRefreshMs??60000,this.indexer=new jo(this.db,this.layout),this.terms=new Vo(this.db),this.backfill=new b(this.db,this.indexer,t.batch??500),this.queueRows=this.db.query("SELECT id, session_id, seq FROM store.search_queue WHERE id > ? ORDER BY id LIMIT ?"),this.queueMax=this.db.query("SELECT max(id) AS id FROM store.search_queue"),!this.backfill.state)this.backfill.begin(this.reset?"rebuild":"initial");this.queueDone=Number(Xr(this.db,"queue_done")??0),this.termStale=Number(Xr(this.db,"term_stale")??0)===1}step(t){if(this.closed)return!1;if(this.drainQueue(t??performance.now()+this.sliceMs))return!0;if(this.backfill.running){this.rateStart??={time:performance.now(),done:this.backfill.state?.done??0};let e=this.indexer.outChanges;if(this.backfill.step(t??performance.now()+this.backfillSliceMs),this.markTerms(e),!this.backfill.running)this.lastTermRefresh=Number.NEGATIVE_INFINITY;return!0}return this.refreshTerms(t??performance.now()+this.sliceMs)}drain(){while(this.step());}drainQueue(t){let e=!1;return this.db.transaction(()=>{let s=this.queueRows.all(this.queueDone,this.queueBatch);if(!s.length)return;e=!0;let r=this.indexer.outChanges,n=new Set,a=this.queueDone;for(let i of s){let h=`${i.seq}\x00${i.session_id}`;if(!n.has(h))n.add(h),this.indexer.reindex(i.session_id,i.seq);if(a=i.id,performance.now()>t)break}qt(this.db,"queue_done",a),this.markTerms(r),this.queueDone=a})(),e}markTerms(t){if(this.indexer.outChanges===t||this.termStale)return;this.termStale=!0,qt(this.db,"term_stale",1)}refreshTerms(t){if(this.termCursor===void 0){if(!this.termStale||performance.now()-this.lastTermRefresh<this.termRefreshMs)return!1;this.termCursor="",this.termStale=!1,this.indexer.outChanges=0,qt(this.db,"term_stale",0)}while(this.termCursor!==void 0&&performance.now()<=t){let e=this.termCursor;this.db.transaction(()=>{this.termCursor=this.terms.step(e,T)})()}if(this.termCursor===void 0)this.lastTermRefresh=performance.now();return!0}status(){let t=this.queueMax.get()?.id??this.queueDone,e=this.backfill.state,s;if(e?.state==="running"&&this.rateStart){let n=(performance.now()-this.rateStart.time)/1000,a=(e.done-this.rateStart.done)/n;if(n>0.5&&a>0)s=Math.max(0,Math.round(Math.max(0,e.total-e.done)/a))}let r=e?{state:e.state,reason:e.reason,total:e.total,done:e.done,sessionsTotal:e.sessionsTotal,sessionsDone:e.sessionsDone,startedAt:e.startedAt}:void 0;if(!this.estimate||performance.now()-this.estimate.time>M)this.estimate={time:performance.now(),entries:c(this.db)};return{queueDone:this.queueDone,lag:Math.max(0,t-this.queueDone),entries:this.estimate.entries,...r?{backfill:r}:{},...s!==void 0?{etaSec:s}:{},layout:this.layout,reset:this.reset}}withIndex(t){return t(this.db)}close(){if(this.closed)return;this.closed=!0,this.db.close()}}var g=1000,x=100;function R(t){let e,s,r,n=!1,a=!1,i=0,h=[],l=(u)=>t.postMessage(u),d=(u)=>{if(a)return;if(r)clearTimeout(r);r=setTimeout(q,u)},p=()=>{if(!s||Atomics.load(s,He)!==1)return;Atomics.store(s,Tt,1),Atomics.notify(s,Tt);while(Atomics.load(s,He)===1)Atomics.wait(s,He,1,1e4);Atomics.store(s,Tt,0)};function q(){if(r=void 0,a||!e)return;p();let u=!1;try{u=e.step()}catch(f){l({type:"error",message:f instanceof Error?f.message:String(f),fatal:!1}),n=!1,d(g);return}let o=performance.now();if(u){if(n=!0,o-i>=x)i=o,l({type:"status",status:e.status()});d(0);return}n=!1,i=o;let m=e.status();l({type:"status",status:m});for(let f of h.splice(0))l({type:"flushed",id:f,status:m});d(g)}t.onmessage=(u)=>{let o=u.data;if(o.type==="init"){s=new Int32Array(o.flags);try{e=new E(o.options)}catch(m){l({type:"error",message:m instanceof Error?m.message:String(m),fatal:!0});return}l({type:"status",status:e.status()}),d(0)}else if(o.type==="dirty"){if(!n)d(0)}else if(o.type==="pause")p();else if(o.type==="flush"){if(h.push(o.id),!n)d(0)}else if(o.type==="stop"){if(a=!0,r)clearTimeout(r);e?.close(),l({type:"stopped"})}}}if(!Bun.isMainThread)R(globalThis);export{E as SearchEngine};
package/chunk-2nb3d92s.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{go,St,st,x,ln,yo}from"./chunk-eegztdzb.js";export{go as child_process,St as crypto,st as fs,x as path,ln as stream,yo as util};
package/chunk-2pa1z37c.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rn,Ii}from"./chunk-t7sc0wwc.js";export{Rn as runUIWorker,Ii as uiTest};
package/chunk-4g5f43ea.js DELETED
@@ -1,3 +0,0 @@
1
- // @bun
2
- function qe(_){if(_===void 0)return;let n=Array.from(_);if(n.length<=64)return _;return n.slice(0,64).join("")}
3
- export{qe};
package/chunk-eegztdzb.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import*as go from"child_process";import*as St from"crypto";import*as st from"fs";import*as x from"path";import*as ln from"stream";import*as yo from"util";export{go,St,st,x,ln,yo};
package/chunk-wd3z74av.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Xt,So}from"./chunk-980drajf.js";import"./chunk-c4qr1f41.js";import"./chunk-r0jc8e7t.js";export{Xt as stream,So as streamSimple};
package/chunk-yna8bwqc.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ur,Br,Cn}from"./chunk-zzwjt7fp.js";export{Ur as ENV_KEY,Br as ENV_SECRET,Cn as fromEnv};
@@ -1 +0,0 @@
1
- import{ir}from"./chunk-zc1mk10n.js";export{ir as createRailroadEbnfServices};
@@ -1 +0,0 @@
1
- import{lt}from"./chunk-y7jq61nv.js";export{lt as default};
@@ -1 +0,0 @@
1
- import{gi}from"./chunk-zc1mk10n.js";export{gi as createRadarServices};
@@ -1 +0,0 @@
1
- import{ki}from"./chunk-zc1mk10n.js";export{ki as createPacketServices};
@@ -1 +0,0 @@
1
- import{Qi,So,Ji,To,Eo,eo}from"./chunk-v0g4cqc1.js";import"./chunk-7pypx5h8.js";import"./chunk-fjag6yg8.js";import"./chunk-pyg1mr80.js";export{So as applyDagreLayoutResult,Qi as getEdgesToRender,To as measureDagreLayout,Ji as prepareLayoutForDagre,eo as render,Eo as runDagreLayoutCore};
@@ -1,2 +0,0 @@
1
- import{e,a,b,l,M,P,Tt,Et,yo,gt,tn,vo,Yn,Pe,bo,Wi,At,Gi,nn,Xn}from"./chunk-pyg1mr80.js";import{J}from"./chunk-fjag6yg8.js";import{x}from"./chunk-qmbgb79a.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 J({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("qq5gh5zr"),import("./chunk-qq5gh5zr.js"));f(t,r)}return{graph:i,groups:u,nodeElements:g}}e(k,"createGraphWithElements");var W=new Map,m=new Map,R=new Map,Z=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"),I=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(I(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"),ee=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=ee(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=te(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 J({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"),te=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(),Z()}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(V(u,n))continue;await Y(s,u,o,t,n,r)}}e(F,"paintLayoutData");async function j(t,r,n,i){if(r.clusterNode)gt(r);else if(H(r,n,i))await tn(t.clusters,r);else gt(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 V(t,r){return t.isLayoutOnly||Boolean(r.skipEdge?.(t))}e(V,"shouldSkipPaintEdge");async function Y(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,q(r,s),i.layoutAlgorithm);if(Wi(r)){if(!Yn.has(r.id))await At(t.edgeLabels,r);K(r,u)}}e(Y,"paintLayoutEdge");function y(t,r,n,i,s){return s.getEdgeNode?.(t,r,i)??(t?n.get(t)??{}:{})}e(y,"getRenderedNode");function q(t,r){return typeof r.skipIntersect==="function"?r.skipIntersect(t):r.skipIntersect??!1}e(q,"shouldSkipIntersect");function K(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}=Q(t,o,n);Pe.get(t.id)[o].attr("transform",`translate(${d}, ${c})`)}}e(K,"positionRenderedEdgeLabel");var ne={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function Q(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(Q,"terminalLabelTranslate");
2
- export{la,ca,W,Fn,to,ua,cr};
@@ -1,2 +0,0 @@
1
- import{z,Me}from"./chunk-pyg1mr80.js";var n=(r,o)=>z.lang.round(Me.parse(r)[o]),Bt=n;
2
- export{Bt};
@@ -1 +0,0 @@
1
- import"./chunk-pyg1mr80.js";import"./chunk-fjag6yg8.js";import"./chunk-7pypx5h8.js";import{eo}from"./chunk-v0g4cqc1.js";export{eo as render};
@@ -1 +0,0 @@
1
- import"./chunk-pyg1mr80.js";import"./chunk-tcp77cp2.js";import{Co}from"./chunk-0k9aec1s.js";import"./chunk-m8knte9z.js";import"./chunk-9dy7z3ej.js";import"./chunk-9xgspn75.js";import"./chunk-01hcjafh.js";export{Co as diagram};
@@ -1 +0,0 @@
1
- import{_i}from"./chunk-zc1mk10n.js";export{_i as createGitGraphServices};
@@ -1 +0,0 @@
1
- import{xi}from"./chunk-zc1mk10n.js";export{xi as createCynefinServices};
@@ -1,8 +0,0 @@
1
- import{e}from"./chunk-pyg1mr80.js";import"./chunk-tcp77cp2.js";import{Ai,Li}from"./chunk-0k9aec1s.js";import"./chunk-m8knte9z.js";import"./chunk-9dy7z3ej.js";import"./chunk-9xgspn75.js";import"./chunk-01hcjafh.js";var r=e((t)=>`${Ai(t)}
2
- .swimlane.cluster:not([data-color-id]) rect {
3
- stroke: ${t.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,"getStyles"),o=r,D=Li({styles:o});export{D as diagram};
@@ -1 +0,0 @@
1
- import{Qn}from"./chunk-0p1nmj5n.js";export{Qn as default};
@@ -1 +0,0 @@
1
- import{o,ne,i,r,y,t,n,_,Z,ae,rt,bt}from"./chunk-qmbgb79a.js";import{vn}from"./chunk-vttgyb5v.js";var U=[{id:"exa",name:"Exa",description:"免密钥 · 综合搜索"},{id:"tavily",name:"Tavily",description:"免密钥 · 支持域名筛选"},{id:"parallel",name:"Parallel",description:"免密钥 · 网页搜索"},{id:"firecrawl",name:"Firecrawl",description:"免密钥 · 网页内容"},{id:"tinyfish",name:"TinyFish",description:"免密钥 · 搜索摘要"},{id:"searxng",name:"SearXNG",description:"免密钥 · 需自建服务"},{id:"brave",name:"Brave",description:"需密钥 · 独立搜索引擎"}];function R(e){return{enabled:e.search.provider!=="off",provider:e.search.provider==="off"?"auto":e.search.provider,searxngUrl:e.search.searxngUrl??"",proxy:e.proxy??"",acceptLanguage:e.acceptLanguage??""}}function A(e,d){return{search:{provider:e.enabled?e.provider:"off",searxngUrl:e.searxngUrl},keys:{...d},proxy:e.proxy,acceptLanguage:e.acceptLanguage}}function z(e,d,x){let g=R(e);if(d.enabled!==g.enabled)return!0;if(d.enabled&&d.provider!==g.provider)return!0;return d.searxngUrl!==g.searxngUrl||d.proxy!==g.proxy||d.acceptLanguage!==g.acceptLanguage||Object.keys(x).length>0}function B({notice:e}){let{cn:d}=_();if(!e)return null;let x=e.type==="success"?vn:Z;return n("div",{role:e.type==="error"?"alert":"status",className:d("flex items-start gap-2 text-xs",e.type==="success"?"text-success":"text-danger"),children:[t(x,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),t("span",{className:"min-w-0 break-words",children:e.text})]})}function F(e){let{Button:d,Input:x,Switch:g,Select:W,StatusChip:p,SettingGroup:h,SettingRow:C,cn:w}=_(),f=ne(),c=e.busy!==void 0;return n("form",{className:"min-w-0 space-y-6",onSubmit:async(s)=>{s.preventDefault(),await e.onSave()},children:[n(h,{title:"联网搜索",children:[t(C,{title:"启用搜索",description:"查询会发送至所选搜索服务。",children:n("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-xs text-dim",children:e.draft.enabled?"已开启":"已关闭"}),t(g,{label:"启用联网搜索",disabled:c,checked:e.draft.enabled,onCheckedChange:(s)=>e.onDraft({...e.draft,enabled:s})})]})}),n("div",{className:"space-y-4 p-4",children:[n("div",{children:[t("label",{htmlFor:`${f}-provider`,className:"mb-1.5 block text-[13px] font-medium text-dim",children:"搜索渠道"}),t(W,{id:`${f}-provider`,value:e.draft.provider,disabled:c||!e.draft.enabled,className:"min-w-0",groups:[{options:[{value:"auto",label:"自动",description:"失败时依次切换渠道"},...U.map((s)=>({value:s.id,label:s.name}))]}],onValueChange:(s)=>{let a=s==="auto"?s:U.find((k)=>k.id===s)?.id;if(a)e.onDraft({...e.draft,provider:a})}}),t("p",{className:"mt-1.5 text-xs leading-5 text-faint",children:"自动:Exa → Tavily → Parallel → Firecrawl → TinyFish"})]}),(e.draft.provider==="searxng"||e.draft.searxngUrl)&&n("div",{children:[t("label",{htmlFor:`${f}-searxng`,className:"mb-1.5 block text-[13px] font-medium text-dim",children:"自建 SearXNG 地址"}),t(x,{id:`${f}-searxng`,type:"url",maxLength:2000,disabled:c||!e.draft.enabled,value:e.draft.searxngUrl,placeholder:"https://search.example.com",onChange:(s)=>e.onDraft({...e.draft,searxngUrl:s.target.value})})]})]})]}),t(h,{title:"渠道与密钥",description:"检测使用已保存配置,按下列顺序执行。",action:n(d,{type:"button",size:"sm",variant:"ghost",disabled:c,onClick:async()=>await e.onCheck("all"),children:[t(ae,{className:w("size-3.5",e.checking==="all"&&"animate-spin"),"aria-hidden":"true"}),e.checking==="all"?"正在检测…":"检测全部渠道"]}),children:U.map((s)=>{let a=s.id,k=a==="searxng"?void 0:e.saved.keys[a],N=k?.source==="environment",D=a==="searxng"?void 0:e.keys[a],K=D==="",v=e.checks[a],m=e.checking==="all"||e.checking===a,S=k?.configured?"已配置密钥":"未配置";if(a==="searxng")S=e.saved.search.searxngUrl?"已配置地址":"未配置地址";if(N)S="来自环境变量";if(K)S="待移除";if(D)S="待保存密钥";return n("div",{className:"min-w-0 p-4",children:[n("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[n("div",{className:"min-w-0 flex-1 basis-28",children:[t("div",{className:"text-sm font-medium text-ink",children:s.name}),t("p",{className:"mt-0.5 text-xs text-faint",children:s.description})]}),n("div",{className:"flex max-w-full flex-wrap items-center justify-end gap-2",children:[t(p,{tone:D!==void 0?"warning":"neutral",children:S}),v&&!m&&t(p,{tone:v.ok?"success":"danger",children:v.ok?`可用 ${v.elapsedMs} ms`:"不可用"}),m&&t(p,{tone:"neutral",pulse:!0,children:"检测中"}),a!=="searxng"&&!N&&n(y,{children:[t(d,{type:"button",size:"sm",variant:"ghost",disabled:c,"aria-label":`${k?.configured?"更换":"设置"} ${s.name} 密钥`,"aria-expanded":e.editingKey===a,"aria-controls":`${f}-${a}-key-editor`,onClick:()=>e.onEditKey(e.editingKey===a?void 0:a),children:k?.configured?"更换":"设置密钥"}),k?.configured&&!K&&t(d,{type:"button",size:"sm",variant:"ghost",disabled:c,"aria-label":`移除 ${s.name} 密钥`,onClick:()=>{e.onKeys({...e.keys,[a]:""}),e.onEditKey(void 0)},children:"移除"})]}),t(d,{type:"button",size:"sm",variant:"ghost",disabled:c,"aria-label":`检测 ${s.name}`,onClick:async()=>await e.onCheck(a),children:"检测"})]})]}),N&&t("p",{className:"mt-1 text-xs text-faint",children:"请在服务端环境变量中更换或移除。"}),a!=="searxng"&&e.editingKey===a&&n("div",{id:`${f}-${a}-key-editor`,className:"mt-3 space-y-2",children:[n("label",{htmlFor:`${f}-${a}-key`,className:"block text-xs font-medium text-dim",children:[s.name," API 密钥"]}),t(x,{id:`${f}-${a}-key`,type:"password",autoComplete:"new-password",maxLength:4000,disabled:c,value:e.keys[a]??"",placeholder:"输入新密钥,保存后生效",onChange:(P)=>{let b={...e.keys};if(P.target.value.trim())b[a]=P.target.value;else delete b[a];e.onKeys(b)}}),n("div",{className:"flex items-center justify-between gap-2",children:[t("p",{className:"min-w-0 text-xs text-faint",children:"密钥只写入,不回显。"}),t(d,{type:"button",size:"sm",variant:"ghost",disabled:c,onClick:()=>{let P={...e.keys};delete P[a],e.onKeys(P),e.onEditKey(void 0)},children:"取消"})]})]}),v&&!v.ok&&!m&&t("p",{role:"status",className:"mt-2 break-words text-xs leading-5 text-danger",children:v.error??(v.kind==="search"?v.meta?.failed[0]?.error:v.meta?.error)??"检测失败,请检查配置。"})]},a)})}),n(h,{title:"网络",children:[n("div",{className:"p-4",children:[t("label",{htmlFor:`${f}-proxy`,className:"mb-1.5 block text-[13px] font-medium text-dim",children:"代理 URL"}),t(x,{id:`${f}-proxy`,type:"url",maxLength:2000,disabled:c,value:e.draft.proxy,placeholder:"http://127.0.0.1:7890",onChange:(s)=>e.onDraft({...e.draft,proxy:s.target.value})}),t("p",{className:"mt-1.5 text-xs text-faint",children:"留空使用服务端环境代理。"})]}),n("div",{className:"p-4",children:[t("label",{htmlFor:`${f}-language`,className:"mb-1.5 block text-[13px] font-medium text-dim",children:"Accept-Language"}),t(x,{id:`${f}-language`,maxLength:200,disabled:c,value:e.draft.acceptLanguage,placeholder:"en-US,en;q=0.9",onChange:(s)=>e.onDraft({...e.draft,acceptLanguage:s.target.value})})]})]}),n("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3 px-0.5",children:[t("div",{className:"min-w-0 flex-1",children:t(B,{notice:e.notice})}),n("div",{className:"flex flex-wrap items-center gap-2",children:[e.dirty&&n(d,{type:"button",size:"sm",variant:"ghost",disabled:c,onClick:e.onRestore,children:[t(rt,{className:"size-3.5","aria-hidden":"true"}),"重置"]}),n(d,{type:"submit",size:"sm",variant:"primary",disabled:c||!e.dirty,children:[t(bt,{className:"size-3.5","aria-hidden":"true"}),e.busy==="save"?"保存中…":"保存"]}),e.onClose&&t(d,{type:"button",size:"sm",variant:"secondary",onClick:e.onClose,children:"关闭"})]})]})]})}function q({connection:e,onClose:d}){let{Button:x}=_(),[g,W]=r(),[p,h]=r(),[C,w]=r({}),[f,c]=r(),[s,a]=r("load"),[k,N]=r(),[D,K]=r({}),[v,m]=r(),[S,P]=r(0),b=i(void 0);o(()=>{let l=new AbortController;return b.current=l,a("load"),m(void 0),W(void 0),h(void 0),w({}),c(void 0),K({}),e.request("/api/plugins/webfetch/settings",{signal:l.signal,cache:S>0?"reload":"default"}).then((u)=>{if(l.signal.aborted)return;W(u),h(R(u))}).catch((u)=>{if(!l.signal.aborted)m({type:"error",text:u instanceof Error?u.message:"加载设置失败,请重试。"})}).finally(()=>{if(!l.signal.aborted)b.current=void 0,a(void 0)}),()=>{l.abort(),b.current?.abort(),b.current=void 0}},[e,S]);async function G(){if(b.current||!g||!p||!z(g,p,C))return;let l=new AbortController;b.current=l,a("save"),m(void 0);try{let u=await e.request("/api/plugins/webfetch/settings",{method:"PATCH",signal:l.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify(A(p,C))});if(l.signal.aborted)return;W(u),h(R(u)),w({}),c(void 0),K({}),m({type:"success",text:"设置已保存。"})}catch(u){if(!l.signal.aborted)m({type:"error",text:u instanceof Error?u.message:"保存失败,请重试。"})}finally{if(!l.signal.aborted)b.current=void 0,a(void 0)}}async function I(l){if(b.current||!g)return;let u=new AbortController;b.current=u,a("test"),N(l),m(void 0);try{let L=await e.request(`/api/plugins/webfetch/test?provider=${l}`,{method:"POST",signal:u.signal});if(u.signal.aborted)return;K((j)=>{let T={...j};for(let E of L.checks)if(E.kind==="search"&&E.provider)T[E.provider]=E;return T})}catch(L){if(!u.signal.aborted)m({type:"error",text:L instanceof Error?L.message:"检测失败,请重试。"})}finally{if(!u.signal.aborted)b.current=void 0,a(void 0),N(void 0)}}if(!g||!p)return n("div",{className:"min-w-0 space-y-3",children:[s==="load"&&t("p",{role:"status",className:"text-sm text-dim",children:"正在加载设置…"}),t(B,{notice:v}),d&&t(x,{type:"button",size:"sm",variant:"secondary",onClick:d,children:"关闭"}),s!=="load"&&t(x,{type:"button",size:"sm",variant:"ghost",onClick:()=>P(S+1),children:"重新加载"})]});return t(F,{saved:g,draft:p,keys:C,editingKey:f,dirty:z(g,p,C),busy:s==="load"?void 0:s,checking:k,checks:D,notice:v,onDraft:(l)=>{h(l),m(void 0)},onKeys:(l)=>{w(l),m(void 0)},onEditKey:c,onClose:d,onSave:G,onCheck:I,onRestore:()=>{h(R(g)),w({}),c(void 0),m(void 0)}})}export{F as SettingsForm,q as default};
@@ -1 +0,0 @@
1
- import{yi}from"./chunk-zc1mk10n.js";export{yi as createTreemapServices};
@@ -1,2 +0,0 @@
1
- import{Rt}from"./chunk-qmbgb79a.js";var Z={};Rt(Z,{default:()=>St});var V={};Rt(V,{default:()=>Yt});var Kr=typeof global=="object"&&global&&global.Object===Object&&global,q=Kr;var Hr=typeof self=="object"&&self&&self.Object===Object&&self,qr=q||Hr||Function("return this")(),xe=qr;var $r=xe.Symbol,Oe=$r;var wt=Object.prototype,{hasOwnProperty:kr,toString:Yr}=wt,G=Oe?Oe.toStringTag:void 0;function Xr(t){var e=kr.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(i){}var a=Yr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var Pt=Xr;var Zr=Object.prototype,Jr=Zr.toString;function Qr(t){return Jr.call(t)}var Et=Qr;var Vr="[object Null]",to="[object Undefined]",It=Oe?Oe.toStringTag:void 0;function eo(t){if(t==null)return t===void 0?to:Vr;return It&&It in Object(t)?Pt(t):Et(t)}var Qe=eo;function ro(t){return t!=null&&typeof t=="object"}var Ee=ro;var oo="[object Symbol]";function ao(t){return typeof t=="symbol"||Ee(t)&&Qe(t)==oo}var ut=ao;function fo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var Gt=fo;var io=Array.isArray,H=io;var no=1/0,Lt=Oe?Oe.prototype:void 0,jt=Lt?Lt.toString:void 0;function Mt(t){if(typeof t=="string")return t;if(H(t))return Gt(t,Mt)+"";if(ut(t))return jt?jt.call(t):"";var e=t+"";return e=="0"&&1/t==-no?"-0":e}var Nt=Mt;function so(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var fe=so;function po(t){return t}var at=po;var uo="[object AsyncFunction]",mo="[object Function]",lo="[object GeneratorFunction]",xo="[object Proxy]";function ho(t){if(!fe(t))return!1;var e=Qe(t);return e==mo||e==lo||e==uo||e==xo}var Ht=ho;var co=xe["__core-js_shared__"],k=co;var Dt=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function go(t){return!!Dt&&Dt in t}var Bt=go;var yo=Function.prototype,_o=yo.toString;function bo(t){if(t!=null){try{return _o.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=bo;var vo=/[\\^$.*+?()[\]{}|]/g,Oo=/^\[object .+?Constructor\]$/,Ao=Function.prototype,To=Object.prototype,wo=Ao.toString,So=To.hasOwnProperty,Po=RegExp("^"+wo.call(So).replace(vo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Co(t){if(!fe(t)||Bt(t))return!1;var e=Ht(t)?Po:Oo;return e.test(_(t))}var Ut=Co;function Eo(t,e){return t==null?void 0:t[e]}var zt=Eo;function Io(t,e){var r=zt(t,e);return Ut(r)?r:void 0}var h=Io;var Lo=h(xe,"WeakMap"),Y=Lo;function jo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Wt=jo;function Mo(){}var qt=Mo;var No=800,Do=16,Ro=Date.now;function Fo(t){var e=0,r=0;return function(){var o=Ro(),a=Do-(o-r);if(r=o,a>0){if(++e>=No)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var $t=Fo;function Bo(t){return function(){return t}}var it=Bo;var Go=function(){try{var t=h(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ur=Go;var Uo=!ur?at:function(t,e){return ur(t,"toString",{configurable:!0,enumerable:!1,value:it(e),writable:!0})},kt=Uo;var zo=$t(kt),da=zo;function Wo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var pa=Wo;function Ko(t,e,r,o){var a=t.length,i=r+(o?1:-1);while(o?i--:++i<a)if(e(t[i],i,t))return i;return-1}var ma=Ko;function Ho(t){return t!==t}var Jt=Ho;function qo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Qt=qo;function $o(t,e,r){return e===e?Qt(t,e,r):ma(t,Jt,r)}var Vt=$o;function ko(t,e){var r=t==null?0:t.length;return!!r&&Vt(t,e,0)>-1}var te=ko;var Yo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function Zo(t,e){var r=typeof t;return e=e==null?Yo:e,!!e&&(r=="number"||r!="symbol"&&Xo.test(t))&&(t>-1&&t%1==0&&t<e)}var bn=Zo;function Jo(t,e){return t===e||t!==t&&e!==e}var Ct=Jo;var ee=Math.max;function Qo(t,e,r){return e=ee(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,i=ee(o.length-e,0),n=Array(i);while(++a<i)n[a]=o[e+a];a=-1;var s=Array(e+1);while(++a<e)s[a]=o[a];return s[e]=r(n),Wt(t,this,s)}}var fa=Qo;function Vo(t,e){return da(fa(t,e,at),t+"")}var xn=Vo;var ta=9007199254740991;function ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ta}var j=ea;function ra(t){return t!=null&&j(t.length)&&!Ht(t)}var $e=ra;var oa=Object.prototype;function aa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oa;return t===r}var _n=aa;function ia(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var re=ia;var na="[object Arguments]";function sa(t){return Ee(t)&&Qe(t)==na}var gt=sa;var oe=Object.prototype,{hasOwnProperty:ua,propertyIsEnumerable:la}=oe,ca=gt(function(){return arguments}())?gt:function(t){return Ee(t)&&ua.call(t,"callee")&&!la.call(t,"callee")},Ft=ca;function Oa(){return!1}var ae=Oa;var se=typeof Z=="object"&&Z&&!Z.nodeType&&Z,ie=se&&typeof X=="object"&&X&&!X.nodeType&&X,Aa=ie&&ie.exports===se,ne=Aa?xe.Buffer:void 0,Ta=ne?ne.isBuffer:void 0,Sa=Ta||ae,St=Sa;var Pa="[object Arguments]",Ca="[object Array]",Ea="[object Boolean]",Ia="[object Date]",La="[object Error]",ja="[object Function]",Ma="[object Map]",Na="[object Number]",Da="[object Object]",Ra="[object RegExp]",Fa="[object Set]",Ba="[object String]",Ga="[object WeakMap]",Ua="[object ArrayBuffer]",za="[object DataView]",Wa="[object Float32Array]",Ka="[object Float64Array]",Ha="[object Int8Array]",qa="[object Int16Array]",$a="[object Int32Array]",Ya="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Za="[object Uint16Array]",Ja="[object Uint32Array]",m={};m[Wa]=m[Ka]=m[Ha]=m[qa]=m[$a]=m[Ya]=m[Xa]=m[Za]=m[Ja]=!0;m[Pa]=m[Ca]=m[Ua]=m[Ea]=m[za]=m[Ia]=m[La]=m[ja]=m[Ma]=m[Na]=m[Da]=m[Ra]=m[Fa]=m[Ba]=m[Ga]=!1;function Qa(t){return Ee(t)&&j(t.length)&&!!m[Qe(t)]}var pe=Qa;function Va(t){return function(e){return t(e)}}var wn=Va;var ue=typeof V=="object"&&V&&!V.nodeType&&V,U=ue&&typeof Q=="object"&&Q&&!Q.nodeType&&Q,tf=U&&U.exports===ue,yt=tf&&q.process,ef=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return yt&&yt.binding&&yt.binding("util")}catch(e){}}(),Yt=ef;var me=Yt&&Yt.isTypedArray,rf=me?wn(me):pe,kn=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t,e){var r=H(t),o=!r&&Ft(t),a=!r&&!o&&St(t),i=!r&&!o&&!a&&kn(t),n=r||o||a||i,s=n?re(t.length,String):[],p=s.length;for(var u in t)if((e||af.call(t,u))&&!(n&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||bn(u,p))))s.push(u);return s}var ha=ff;function nf(t,e){return function(r){return t(e(r))}}var ga=nf;var sf=ga(Object.keys,Object),le=sf;var pf=Object.prototype,uf=pf.hasOwnProperty;function mf(t){if(!_n(t))return le(t);var e=[];for(var r in Object(t))if(uf.call(t,r)&&r!="constructor")e.push(r);return e}var dr=mf;function lf(t){return $e(t)?ha(t):dr(t)}var _e=lf;var df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function hf(t,e){if(H(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||ut(t))return!0;return xf.test(t)||!df.test(t)||e!=null&&t in Object(e)}var M=hf;var cf=h(Object,"create"),b=cf;function gf(){this.__data__=b?b(null):{},this.size=0}var de=gf;function yf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var he=yf;var _f="__lodash_hash_undefined__",bf=Object.prototype,vf=bf.hasOwnProperty;function Of(t){var e=this.__data__;if(b){var r=e[t];return r===_f?void 0:r}return vf.call(e,t)?e[t]:void 0}var ce=Of;var Af=Object.prototype,Tf=Af.hasOwnProperty;function wf(t){var e=this.__data__;return b?e[t]!==void 0:Tf.call(e,t)}var ge=wf;var Sf="__lodash_hash_undefined__";function Pf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Sf:e,this}var ye=Pf;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=de;N.prototype.delete=he;N.prototype.get=ce;N.prototype.has=ge;N.prototype.set=ye;var _t=N;function Cf(){this.__data__=[],this.size=0}var be=Cf;function Ef(t,e){var r=t.length;while(r--)if(Ct(t[r][0],e))return r;return-1}var O=Ef;var If=Array.prototype,Lf=If.splice;function jf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Lf.call(e,r,1);return--this.size,!0}var ve=jf;function Mf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var Ae=Mf;function Nf(t){return O(this.__data__,t)>-1}var Te=Nf;function Df(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Se=Df;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=be;D.prototype.delete=ve;D.prototype.get=Ae;D.prototype.has=Te;D.prototype.set=Se;var A=D;var Rf=h(xe,"Map"),T=Rf;function Ff(){this.size=0,this.__data__={hash:new _t,map:new(T||A),string:new _t}}var Pe=Ff;function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ce=Bf;function Gf(t,e){var r=t.__data__;return Ce(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Gf;function Uf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Ie=Uf;function zf(t){return w(this,t).get(t)}var Le=zf;function Wf(t){return w(this,t).has(t)}var je=Wf;function Kf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var Me=Kf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Pe;R.prototype.delete=Ie;R.prototype.get=Le;R.prototype.has=je;R.prototype.set=Me;var E=R;var Hf="Expected a function";function bt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Hf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],i=r.cache;if(i.has(a))return i.get(a);var n=t.apply(this,o);return r.cache=i.set(a,n)||i,n};return r.cache=new(bt.Cache||E),r}bt.Cache=E;var Ne=bt;var qf=500;function $f(t){var e=Ne(t,function(o){if(r.size===qf)r.clear();return o}),r=e.cache;return e}var De=$f;var kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yf=/\\(\\)?/g,Xf=De(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(kf,function(r,o,a,i){e.push(a?i.replace(Yf,"$1"):o||r)}),e}),Re=Xf;function Zf(t){return t==null?"":Nt(t)}var ya=Zf;function Jf(t,e){if(H(t))return t;return M(t,e)?[t]:Re(ya(t))}var Cn=Jf;var Qf=1/0;function Vf(t){if(typeof t=="string"||ut(t))return t;var e=t+"";return e=="0"&&1/t==-Qf?"-0":e}var Zt=Vf;function ti(t,e){e=Cn(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[Zt(e[r++])];return r&&r==o?t:void 0}var Sn=ti;function ei(t,e,r){var o=t==null?void 0:Sn(t,e);return o===void 0?r:o}var Fe=ei;function ri(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var pr=ri;var Be=Oe?Oe.isConcatSpreadable:void 0;function oi(t){return H(t)||Ft(t)||!!(Be&&t&&t[Be])}var Ue=oi;function ze(t,e,r,o,a){var i=-1,n=t.length;r||(r=Ue),a||(a=[]);while(++i<n){var s=t[i];if(e>0&&r(s))if(e>1)ze(s,e-1,r,o,a);else pr(a,s);else if(!o)a[a.length]=s}return a}var mr=ze;function ai(t,e,r,o){var a=-1,i=t==null?0:t.length;if(o&&i)r=t[++a];while(++a<i)r=e(r,t[a],a,t);return r}var We=ai;function fi(){this.__data__=new A,this.size=0}var Ke=fi;function ii(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var He=ii;function ni(t){return this.__data__.get(t)}var qe=ni;function si(t){return this.__data__.has(t)}var ke=si;var pi=200;function ui(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<pi-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Ye=ui;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=Ke;F.prototype.delete=He;F.prototype.get=qe;F.prototype.has=ke;F.prototype.set=Ye;var Xt=F;function mi(t,e){var r=-1,o=t==null?0:t.length,a=0,i=[];while(++r<o){var n=t[r];if(e(n,r,t))i[a++]=n}return i}var tt=mi;function li(){return[]}var va=li;var di=Object.prototype,xi=di.propertyIsEnumerable,Xe=Object.getOwnPropertySymbols,hi=!Xe?va:function(t){if(t==null)return[];return t=Object(t),tt(Xe(t),function(e){return xi.call(t,e)})},fr=hi;function ci(t,e,r){var o=e(t);return H(t)?o:pr(o,r(t))}var ba=ci;function gi(t){return ba(t,_e,fr)}var Ur=gi;var yi=h(xe,"DataView"),et=yi;var _i=h(xe,"Promise"),rt=_i;var bi=h(xe,"Set"),S=bi;var Ze="[object Map]",vi="[object Object]",Ve="[object Promise]",tr="[object Set]",er="[object WeakMap]",rr="[object DataView]",Oi=_(et),Ai=_(T),Ti=_(rt),wi=_(S),Si=_(Y),I=Qe;if(et&&I(new et(new ArrayBuffer(1)))!=rr||T&&I(new T)!=Ze||rt&&I(rt.resolve())!=Ve||S&&I(new S)!=tr||Y&&I(new Y)!=er)I=function(t){var e=Qe(t),r=e==vi?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case Oi:return rr;case Ai:return Ze;case Ti:return Ve;case wi:return tr;case Si:return er}return e};var dt=I;var Pi=xe.Uint8Array,hr=Pi;var Ci="__lodash_hash_undefined__";function Ei(t){return this.__data__.set(t,Ci),this}var or=Ei;function Ii(t){return this.__data__.has(t)}var ar=Ii;function ot(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}ot.prototype.add=ot.prototype.push=or;ot.prototype.has=ar;var ft=ot;function Li(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var ir=Li;function ji(t,e){return t.has(e)}var nt=ji;var Mi=1,Ni=2;function Di(t,e,r,o,a,i){var n=r&Mi,s=t.length,p=e.length;if(s!=p&&!(n&&p>s))return!1;var u=i.get(t),x=i.get(e);if(u&&x)return u==e&&x==t;var d=-1,l=!0,y=r&Ni?new ft:void 0;i.set(t,e),i.set(e,t);while(++d<s){var c=t[d],g=e[d];if(o)var v=n?o(g,c,d,e,t,i):o(c,g,d,t,e,i);if(v!==void 0){if(v)continue;l=!1;break}if(y){if(!ir(e,function(P,C){if(!nt(y,C)&&(c===P||a(c,P,r,o,i)))return y.push(C)})){l=!1;break}}else if(!(c===g||a(c,g,r,o,i))){l=!1;break}}return i.delete(t),i.delete(e),l}var st=Di;function Ri(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var nr=Ri;function Fi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=Fi;var Bi=1,Gi=2,Ui="[object Boolean]",zi="[object Date]",Wi="[object Error]",Ki="[object Map]",Hi="[object Number]",qi="[object RegExp]",$i="[object Set]",ki="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Zi="[object DataView]",sr=Oe?Oe.prototype:void 0,vt=sr?sr.valueOf:void 0;function Ji(t,e,r,o,a,i,n){switch(r){case Zi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xi:if(t.byteLength!=e.byteLength||!i(new hr(t),new hr(e)))return!1;return!0;case Ui:case zi:case Hi:return Ct(+t,+e);case Wi:return t.name==e.name&&t.message==e.message;case qi:case ki:return t==e+"";case Ki:var s=nr;case $i:var p=o&Bi;if(s||(s=B),t.size!=e.size&&!p)return!1;var u=n.get(t);if(u)return u==e;o|=Gi,n.set(t,e);var x=st(s(t),s(e),o,a,i,n);return n.delete(t),x;case Yi:if(vt)return vt.call(t)==vt.call(e)}return!1}var lr=Ji;var Qi=1,Vi=Object.prototype,tn=Vi.hasOwnProperty;function en(t,e,r,o,a,i){var n=r&Qi,s=Ur(t),p=s.length,u=Ur(e),x=u.length;if(p!=x&&!n)return!1;var d=p;while(d--){var l=s[d];if(!(n?l in e:tn.call(e,l)))return!1}var y=i.get(t),c=i.get(e);if(y&&c)return y==e&&c==t;var g=!0;i.set(t,e),i.set(e,t);var v=n;while(++d<p){l=s[d];var P=t[l],C=e[l];if(o)var Tt=n?o(C,P,l,e,t,i):o(P,C,l,t,e,i);if(!(Tt===void 0?P===C||a(P,C,r,o,i):Tt)){g=!1;break}v||(v=l=="constructor")}if(g&&!v){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))g=!1}return i.delete(t),i.delete(e),g}var xr=en;var rn=1,cr="[object Arguments]",_r="[object Array]",mt="[object Object]",on=Object.prototype,br=on.hasOwnProperty;function an(t,e,r,o,a,i){var n=H(t),s=H(e),p=n?_r:dt(t),u=s?_r:dt(e);p=p==cr?mt:p,u=u==cr?mt:u;var x=p==mt,d=u==mt,l=p==u;if(l&&St(t)){if(!St(e))return!1;n=!0,x=!1}if(l&&!x)return i||(i=new Xt),n||kn(t)?st(t,e,r,o,a,i):lr(t,e,p,r,o,a,i);if(!(r&rn)){var y=x&&br.call(t,"__wrapped__"),c=d&&br.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return i||(i=new Xt),a(g,v,r,o,i)}}if(!l)return!1;return i||(i=new Xt),xr(t,e,r,o,a,i)}var Or=an;function Ar(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Ee(t)&&!Ee(e))return t!==t&&e!==e;return Or(t,e,r,o,Ar,a)}var lt=Ar;var fn=1,nn=2;function sn(t,e,r,o){var a=r.length,i=a,n=!o;if(t==null)return!i;t=Object(t);while(a--){var s=r[a];if(n&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}while(++a<i){s=r[a];var p=s[0],u=t[p],x=s[1];if(n&&s[2]){if(u===void 0&&!(p in t))return!1}else{var d=new Xt;if(o)var l=o(u,x,p,t,e,d);if(!(l===void 0?lt(x,u,fn|nn,o,d):l))return!1}}return!0}var Tr=sn;function pn(t){return t===t&&!fe(t)}var xt=pn;function un(t){var e=_e(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,xt(a)]}return e}var wr=un;function mn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var ht=mn;function ln(t){var e=wr(t);if(e.length==1&&e[0][2])return ht(e[0][0],e[0][1]);return function(r){return r===t||Tr(r,t,e)}}var Sr=ln;function dn(t,e){return t!=null&&e in Object(t)}var Pr=dn;function hn(t,e,r){e=Cn(e,t);var o=-1,a=e.length,i=!1;while(++o<a){var n=Zt(e[o]);if(!(i=t!=null&&r(t,n)))break;t=t[n]}if(i||++o!=a)return i;return a=t==null?0:t.length,!!a&&j(a)&&bn(n,a)&&(H(t)||Ft(t))}var xa=hn;function cn(t,e){return t!=null&&xa(t,e,Pr)}var _a=cn;var gn=1,yn=2;function vn(t,e){if(M(t)&&xt(e))return ht(Zt(t),e);return function(r){var o=Fe(r,t);return o===void 0&&o===e?_a(r,t):lt(e,o,gn|yn)}}var Cr=vn;function On(t){return function(e){return e==null?void 0:e[t]}}var wa=On;function An(t){return function(e){return Sn(e,t)}}var Er=An;function Pn(t){return M(t)?wa(Zt(t)):Er(t)}var Ir=Pn;function En(t){if(typeof t=="function")return t;if(t==null)return at;if(typeof t=="object")return H(t)?Cr(t[0],t[1]):Sr(t);return Ir(t)}var Ge=En;function In(t){return function(e,r,o){var a=-1,i=Object(e),n=o(e),s=n.length;while(s--){var p=n[t?s:++a];if(r(i[p],p,i)===!1)break}return e}}var Lr=In;var Ln=Lr(),gr=Ln;function jn(t,e){return t&&gr(t,e,_e)}var yr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!$e(r))return t(r,o);var a=r.length,i=e?a:-1,n=Object(r);while(e?i--:++i<a)if(o(n[i],i,n)===!1)break;return r}}var jr=Mn;var Nn=jr(yr),Tn=Nn;function Dn(t){return Ee(t)&&$e(t)}var ka=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var Mr=Rn;function Fn(t){return typeof t=="function"?t:at}var vr=Fn;function Bn(t,e){var r=H(t)?pa:Tn;return r(t,vr(e))}var f=Bn;function Gn(t,e){var r=[];return Tn(t,function(o,a,i){if(e(o,a,i))r.push(o)}),r}var Nr=Gn;function Un(t,e){var r=H(t)?tt:Nr;return r(t,Ge(e,3))}var Je=Un;function zn(t,e){return Gt(e,function(r){return t[r]})}var Dr=zn;function Wn(t){return t==null?[]:Dr(t,_e(t))}var pt=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if($e(t)&&(H(t)||typeof t=="string"||typeof t.splice=="function"||St(t)||kn(t)||Ft(t)))return!t.length;var e=dt(t);if(e==Kn||e==Hn)return!t.size;if(_n(t))return!dr(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var ct=Yn;function Xn(t){return t===void 0}var we=Xn;function Zn(t,e,r,o,a){return a(t,function(i,n,s){r=o?(o=!1,i):e(r,i,n,s)}),r}var Rr=Zn;function Jn(t,e,r){var o=H(t)?We:Rr,a=arguments.length<3;return o(t,Ge(e,4),r,a,Tn)}var Kt=Jn;var Qn=1/0,Vn=!(S&&1/B(new S([,-0]))[1]==Qn)?qt:function(t){return new S(t)},Fr=Vn;var ts=200;function es(t,e,r){var o=-1,a=te,i=t.length,n=!0,s=[],p=s;if(r)n=!1,a=Mr;else if(i>=ts){var u=e?null:Fr(t);if(u)return B(u);n=!1,a=nt,p=new ft}else p=e?[]:s;t:while(++o<i){var x=t[o],d=e?e(x):x;if(x=r||x!==0?x:0,n&&d===d){var l=p.length;while(l--)if(p[l]===d)continue t;if(e)p.push(d);s.push(x)}else if(!a(p,d,r)){if(p!==s)p.push(d);s.push(x)}}return s}var Br=es;var rs=xn(function(t){return Br(mr(t,1,ka,!0))}),Ot=rs;var as="\x00",L="\x00",Gr="\x01";class J{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=it(void 0),this._defaultEdgeLabelFn=it(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!Ht(t))t=it(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return _e(this._nodes)}sources(){var t=this;return Je(this.nodes(),function(e){return ct(t._in[e])})}sinks(){var t=this;return Je(this.nodes(),function(e){return ct(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return f(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],f(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];f(_e(this._in[t]),e),delete this._in[t],delete this._preds[t],f(_e(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(we(e))e=L;else{e+="";for(var r=e;!we(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(we(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return _e(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return _e(e)}successors(t){var e=this._sucs[t];if(e)return _e(e)}neighbors(t){var e=this.predecessors(t);if(e)return Ot(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;f(this._nodes,function(i,n){if(t(n))e.setNode(n,i)}),f(this._edgeObjs,function(i){if(e.hasNode(i.v)&&e.hasNode(i.w))e.setEdge(i,r.edge(i))});var o={};function a(i){var n=r.parent(i);if(n===void 0||e.hasNode(n))return o[i]=n,n;else if(n in o)return o[n];else return a(n)}if(this._isCompound)f(e.nodes(),function(i){e.setParent(i,a(i))});return e}setDefaultEdgeLabel(t){if(!Ht(t))t=it(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return pt(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return Kt(t,function(a,i){if(o.length>1)r.setEdge(a,i,e);else r.setEdge(a,i);return i}),this}setEdge(){var t,e,r,o,a=!1,i=arguments[0];if(typeof i==="object"&&i!==null&&"v"in i){if(t=i.v,e=i.w,r=i.name,arguments.length===2)o=arguments[1],a=!0}else if(t=i,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!we(r))r=""+r;var n=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n)){if(a)this._edgeLabels[n]=o;return this}if(!we(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[n]=a?o:this._defaultEdgeLabelFn(t,e,r);var s=fs(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[n]=s,zr(this._preds[e],t),zr(this._sucs[t],e),this._in[e][n]=s,this._out[t][n]=s,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?At(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?At(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?At(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Wr(this._preds[e],t),Wr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=pt(r);if(!e)return o;return Je(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=pt(r);if(!e)return o;return Je(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}J.prototype._nodeCount=0;J.prototype._edgeCount=0;function zr(t,e){if(t[e])t[e]++;else t[e]=1}function Wr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}return a+Gr+i+Gr+(we(o)?as:o)}function fs(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}var s={v:a,w:i};if(o)s.name=o;return s}function At(t,e){return z(t,e.v,e.w,e.name)}
2
- export{xe,Oe,Qe,Ee,ut,Gt,H,fe,at,Ht,it,ur,da,pa,ma,bn,Ct,fa,xn,$e,_n,Ft,St,wn,Yt,kn,ha,ga,dr,_e,ya,Cn,Zt,Sn,pr,mr,Xt,va,fr,ba,Ur,dt,hr,xa,_a,wa,Ge,gr,yr,Tn,ka,vr,f,Je,pt,we,Kt,J};
@@ -1 +0,0 @@
1
- import{Ci}from"./chunk-zc1mk10n.js";export{Ci as createPieServices};
@@ -1 +0,0 @@
1
- import{Ei}from"./chunk-zc1mk10n.js";export{Ei as createEventModelingServices};
@@ -1 +0,0 @@
1
- import{or}from"./chunk-zc1mk10n.js";export{or as createRailroadAbnfServices};
@@ -1 +0,0 @@
1
- import{Ti}from"./chunk-zc1mk10n.js";export{Ti as createArchitectureServices};
@@ -1 +0,0 @@
1
- import{bi}from"./chunk-zc1mk10n.js";export{bi as createWardleyServices};
@@ -1 +0,0 @@
1
- import{wi}from"./chunk-zc1mk10n.js";export{wi as createInfoServices};