@softistx/pulsarix-widget 0.9.1 → 0.10.1

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 (131) hide show
  1. package/README.md +39 -27
  2. package/dist/chunks/{abnfDiagram-XWFEHMT6.xef4vppv.js → abnfDiagram-XWFEHMT6.9n16jbeh.js} +1 -1
  3. package/dist/chunks/architecture-WOLXFQ4H.04w48nbq.js +1 -0
  4. package/dist/chunks/architectureDiagram-CSQXQB3N.3c7xm6kb.js +36 -0
  5. package/dist/chunks/{blockDiagram-BEDRHYPZ.wgdr8xfr.js → blockDiagram-BEDRHYPZ.b7d9kkgr.js} +11 -11
  6. package/dist/chunks/{c4Diagram-M2UUVUY5.t09pndbz.js → c4Diagram-M2UUVUY5.f883rrpb.js} +3 -3
  7. package/dist/chunks/{chat-markdown-CQ4fSIYN.cv3fprzq.js → chat-markdown-BSu4FB_l.ngsfz1hc.js} +29 -29
  8. package/dist/chunks/{classDiagram-v2-KXABOMEV.9yfjtevj.js → classDiagram-v2-KXABOMEV.6gcf0jbx.js} +8 -8
  9. package/dist/chunks/cose-bilkent-JH36ORCC.900yznpf.js +1 -0
  10. package/dist/chunks/cynefin-EF2NZ3EQ.jp3enwcw.js +1 -0
  11. package/dist/chunks/{cynefinDiagram-NJNITYFG.k6mhek0s.js → cynefinDiagram-NJNITYFG.7y6esx64.js} +1 -1
  12. package/dist/chunks/{dagre-KIHZ2IZ3.sqeg911s.js → dagre-KIHZ2IZ3.2xtjsjjb.js} +2 -2
  13. package/dist/chunks/{diagram-7YQZDPLS.k1qvmctj.js → diagram-7YQZDPLS.5a4btxfh.js} +2 -2
  14. package/dist/chunks/{diagram-QBROCOUO.v7fe7e4g.js → diagram-QBROCOUO.je55sz0f.js} +24 -24
  15. package/dist/chunks/{diagram-RJJCUUZO.12s15pm6.js → diagram-RJJCUUZO.19nj7yqv.js} +4 -4
  16. package/dist/chunks/{diagram-WERXNKYE.tmrcv4we.js → diagram-WERXNKYE.h15fxc8e.js} +2 -2
  17. package/dist/chunks/diagram-YHHI257C.rjb588jf.js +3 -0
  18. package/dist/chunks/{diagram-YR4HJLHV.nytxr7pa.js → diagram-YR4HJLHV.5cj602t4.js} +1 -1
  19. package/dist/chunks/{ebnfDiagram-N527522P.6eqw92nv.js → ebnfDiagram-N527522P.edah3bz7.js} +1 -1
  20. package/dist/chunks/editor-shortcuts-dialog-Cz3T8435.kb0b5cra.js +1 -0
  21. package/dist/chunks/editor.ywaw7sz9.js +4 -0
  22. package/dist/chunks/{elk-O5DQBFGD.a5rqryhg.js → elk-O5DQBFGD.qnxmxe5n.js} +13 -13
  23. package/dist/chunks/emoji-picker-00Bw2c2b.2985hrzf.js +4 -0
  24. package/dist/chunks/{erDiagram-K3K3BIDK.exfeddaa.js → erDiagram-K3K3BIDK.9wh4fsa9.js} +8 -8
  25. package/dist/chunks/eventmodeling-K75KTNOO.xt3yb4h8.js +1 -0
  26. package/dist/chunks/{flow-diagram-Byy7DBZZ.pf5vdbkn.js → flow-diagram-DGZOc1z1.1276ykn3.js} +6 -6
  27. package/dist/chunks/flowDiagram-Z6JWZHQI.3t1zqq9x.js +1 -0
  28. package/dist/chunks/{ganttDiagram-3PRQTZWP.0tjaeqjw.js → ganttDiagram-3PRQTZWP.4t4r8jy0.js} +5 -5
  29. package/dist/chunks/gitGraph-VSP46ZUC.v9e8d46n.js +1 -0
  30. package/dist/chunks/{gitGraphDiagram-VXDFKS5L.6vvbj88t.js → gitGraphDiagram-VXDFKS5L.x4pypqh9.js} +19 -19
  31. package/dist/chunks/{grid-E2QIVN74.frpdy6t3.js → grid-E2QIVN74.8njsnft0.js} +1 -1
  32. package/dist/chunks/illustration-BcaGDjvB.ahkxq9mz.js +1 -0
  33. package/dist/chunks/{index.sv013f1z.js → index.0tz15aew.js} +1 -1
  34. package/dist/chunks/{index.zjykrx6y.js → index.0yskyw4t.js} +4 -4
  35. package/dist/chunks/{index.0kv7tp87.js → index.10k18jx6.js} +2 -2
  36. package/dist/chunks/{index.93zpfh3k.js → index.28jrnjz5.js} +2 -2
  37. package/dist/chunks/{index.f6jhkm5c.js → index.2j6fty9j.js} +35 -35
  38. package/dist/chunks/index.3c95g5mh.js +2 -0
  39. package/dist/chunks/{index.d8b8y928.js → index.3y8baz7q.js} +10 -10
  40. package/dist/chunks/{index.7q6v461v.js → index.5n55ccv6.js} +2 -2
  41. package/dist/chunks/{index.yfbwd99n.js → index.5sj251kq.js} +106 -106
  42. package/dist/chunks/{index.3pn4wy4j.js → index.a7m06kba.js} +1 -1
  43. package/dist/chunks/{index.fv9af3wd.js → index.d57x7pg9.js} +6 -6
  44. package/dist/chunks/{index.mcyw2bze.js → index.f1bfv6bh.js} +1 -1
  45. package/dist/chunks/{index.xrg5yg8d.js → index.gzgeb5ax.js} +2 -2
  46. package/dist/chunks/{index.nrd5w1x0.js → index.mjp06b03.js} +2 -2
  47. package/dist/chunks/{index.a6rz456z.js → index.mtrj86e8.js} +2 -2
  48. package/dist/chunks/index.n53k66q8.js +2 -0
  49. package/dist/chunks/index.pg4f51t3.js +44 -0
  50. package/dist/chunks/index.q39061xn.js +2 -0
  51. package/dist/chunks/{index.pyz71tqx.js → index.tnx5y2zc.js} +2 -2
  52. package/dist/chunks/{index.nsckd1vt.js → index.yhmqh641.js} +2 -2
  53. package/dist/chunks/{index.kh3f3gw8.js → index.znt11tbm.js} +2 -2
  54. package/dist/chunks/info-OHQRW6UA.atpz16bq.js +1 -0
  55. package/dist/chunks/{infoDiagram-EZ3ZOAHP.qh2bwz3m.js → infoDiagram-EZ3ZOAHP.mq5603w2.js} +2 -2
  56. package/dist/chunks/{ishikawaDiagram-S3EKX5GW.w2v6vnwd.js → ishikawaDiagram-S3EKX5GW.sx08qj3j.js} +5 -5
  57. package/dist/chunks/{journeyDiagram-POQNLL5X.ftkfdsrw.js → journeyDiagram-POQNLL5X.c3e37ws5.js} +5 -5
  58. package/dist/chunks/{kanban-definition-BH5XI6FM.9scqhcx5.js → kanban-definition-BH5XI6FM.6b85jkvt.js} +7 -7
  59. package/dist/chunks/markup-color-chrome-ykGNUl8y.76asgnkk.js +1 -0
  60. package/dist/chunks/markup-custom-color-MM-HnrqY.de5f5c2g.js +1 -0
  61. package/dist/chunks/mention-list-6cR5VSPa.r7r4w0q8.js +1 -0
  62. package/dist/chunks/{mermaid.core.tnh468qk.js → mermaid.core.kh4z9f22.js} +7 -7
  63. package/dist/chunks/{mindmap-definition-WVAN44T4.gskntx1f.js → mindmap-definition-WVAN44T4.07nv313g.js} +6 -6
  64. package/dist/chunks/packet-JDAUHWVQ.dmnq0wwq.js +1 -0
  65. package/dist/chunks/panel.zcphrx3e.js +7 -0
  66. package/dist/chunks/{pegDiagram-D4NLKWP3.yb58dpky.js → pegDiagram-D4NLKWP3.2mqrk2xy.js} +1 -1
  67. package/dist/chunks/pie-XZMESJXO.0rpk8mwa.js +1 -0
  68. package/dist/chunks/pieDiagram-36ENHN4W.kx9bhkyj.js +39 -0
  69. package/dist/chunks/plated-illustration-pTqcYOQg.a24pxzgf.js +1 -0
  70. package/dist/chunks/{quadrantDiagram-ZQUDMS73.1a721ces.js → quadrantDiagram-ZQUDMS73.68vxq0vb.js} +4 -4
  71. package/dist/chunks/radar-ABXABTNO.xt7snfyy.js +1 -0
  72. package/dist/chunks/railroad-I3PHUGI6.bjssfxkf.js +1 -0
  73. package/dist/chunks/railroad-abnf-LNEFI6M7.mchc5mex.js +1 -0
  74. package/dist/chunks/railroad-ebnf-DWYD2UWJ.wz1e7a1n.js +1 -0
  75. package/dist/chunks/railroad-peg-JR7BVNR7.xg4e4nsz.js +1 -0
  76. package/dist/chunks/{railroadDiagram-JIZHGYPL.xpgkt1zp.js → railroadDiagram-JIZHGYPL.dnj3h1n0.js} +1 -1
  77. package/dist/chunks/{render-VIF2ZAQL.khtqjmgm.js → render-VIF2ZAQL.cawqkxpf.js} +1 -1
  78. package/dist/chunks/{requirementDiagram-AXW2TVFA.ms6anxwg.js → requirementDiagram-AXW2TVFA.5z51j1hn.js} +4 -4
  79. package/dist/chunks/{sankeyDiagram-FBCJTAIF.40yzed7d.js → sankeyDiagram-FBCJTAIF.0dqdm7yd.js} +6 -6
  80. package/dist/chunks/{sequenceDiagram-3LA2ROMG.z0h3shw2.js → sequenceDiagram-3LA2ROMG.0fpdfwg0.js} +11 -11
  81. package/dist/chunks/{sizeCapture-2Q2CQKSF.4dh5g271.js → sizeCapture-2Q2CQKSF.gverqc02.js} +1 -1
  82. package/dist/chunks/{stateDiagram-v2-ATKHQDJO.5ftcgs8s.js → stateDiagram-v2-ATKHQDJO.56dj904f.js} +8 -8
  83. package/dist/chunks/{swimlanes-YQL5WMAO.r6vmskrb.js → swimlanes-YQL5WMAO.frj4npw4.js} +1 -1
  84. package/dist/chunks/swimlanesDiagram-UCCPES4V.834hahmm.js +8 -0
  85. package/dist/chunks/{timeline-definition-7Z437IG3.eke70hfq.js → timeline-definition-7Z437IG3.v99ghwdb.js} +9 -9
  86. package/dist/chunks/treeView-D4JQ5SDB.tbqcaq5q.js +1 -0
  87. package/dist/chunks/treemap-SAJKECNS.jgfv37a0.js +1 -0
  88. package/dist/chunks/{usecaseDiagram-RDK6N6HP.d8p4tnc6.js → usecaseDiagram-RDK6N6HP.b6317ne8.js} +57 -57
  89. package/dist/chunks/{vennDiagram-SHRQU5PJ.4s46abxd.js → vennDiagram-SHRQU5PJ.adr331gc.js} +7 -7
  90. package/dist/chunks/wardley-7MLQ67FV.4653yv6a.js +1 -0
  91. package/dist/chunks/{wardleyDiagram-F3OXNVQS.mq49fny4.js → wardleyDiagram-F3OXNVQS.5tt3knhg.js} +4 -4
  92. package/dist/chunks/{xychartDiagram-GDYJKCDI.d7he0fxa.js → xychartDiagram-GDYJKCDI.dqs1thzc.js} +5 -5
  93. package/dist/index.js +48 -21
  94. package/dist/types/config.d.ts +1 -1
  95. package/dist/types/mount.d.ts +1 -1
  96. package/docs/integration.md +32 -26
  97. package/package.json +4 -4
  98. package/dist/chunks/architecture-WOLXFQ4H.pp4drcrh.js +0 -1
  99. package/dist/chunks/architectureDiagram-CSQXQB3N.0bddzt5e.js +0 -36
  100. package/dist/chunks/cose-bilkent-JH36ORCC.qam7r9b1.js +0 -1
  101. package/dist/chunks/cynefin-EF2NZ3EQ.wgr8qmb2.js +0 -1
  102. package/dist/chunks/diagram-YHHI257C.7735ve6v.js +0 -3
  103. package/dist/chunks/editor-shortcuts-dialog-VmvMTjnq.mm7ab69f.js +0 -1
  104. package/dist/chunks/editor.wb4jsrjy.js +0 -4
  105. package/dist/chunks/emoji-picker-bnO0yA8e.bymgjc9a.js +0 -4
  106. package/dist/chunks/eventmodeling-K75KTNOO.nkahp6zg.js +0 -1
  107. package/dist/chunks/flowDiagram-Z6JWZHQI.54yz6gfm.js +0 -1
  108. package/dist/chunks/gitGraph-VSP46ZUC.2a0am491.js +0 -1
  109. package/dist/chunks/illustration-BfueshiW.syv54ccw.js +0 -1
  110. package/dist/chunks/index.bs3ygyp2.js +0 -2
  111. package/dist/chunks/index.newjn1k4.js +0 -2
  112. package/dist/chunks/index.rn0vxns6.js +0 -44
  113. package/dist/chunks/index.yexf86bf.js +0 -2
  114. package/dist/chunks/info-OHQRW6UA.4824y3cd.js +0 -1
  115. package/dist/chunks/markup-color-chrome-ykGNUl8y.8cysjsfb.js +0 -1
  116. package/dist/chunks/markup-custom-color-CytmKw-R.d25j0pcj.js +0 -1
  117. package/dist/chunks/mention-list-5h2lZwEU.wffam6eb.js +0 -1
  118. package/dist/chunks/packet-JDAUHWVQ.w0pv2dxr.js +0 -1
  119. package/dist/chunks/panel.dq8vt40k.js +0 -7
  120. package/dist/chunks/pie-XZMESJXO.zq72f2fq.js +0 -1
  121. package/dist/chunks/pieDiagram-36ENHN4W.7pgn8ayz.js +0 -39
  122. package/dist/chunks/plated-illustration-VrnsTz7H.tcyq0sxa.js +0 -1
  123. package/dist/chunks/radar-ABXABTNO.288gs0b8.js +0 -1
  124. package/dist/chunks/railroad-I3PHUGI6.aadrd13j.js +0 -1
  125. package/dist/chunks/railroad-abnf-LNEFI6M7.6btgmncj.js +0 -1
  126. package/dist/chunks/railroad-ebnf-DWYD2UWJ.y44ppt8p.js +0 -1
  127. package/dist/chunks/railroad-peg-JR7BVNR7.328jgxkz.js +0 -1
  128. package/dist/chunks/swimlanesDiagram-UCCPES4V.exhrz16x.js +0 -8
  129. package/dist/chunks/treeView-D4JQ5SDB.xz61fh4x.js +0 -1
  130. package/dist/chunks/treemap-SAJKECNS.8gv7pmqr.js +0 -1
  131. package/dist/chunks/wardley-7MLQ67FV.6v9j3be8.js +0 -1
@@ -1 +1 @@
1
- import{e}from"./index.yfbwd99n.js";var h=1;function s(i){return`edge-label-${i.start}-${i.end}-${i.id}`}e(s,"edgeLabelFixtureId");function l(i){return`group-title-${i.id}`}e(l,"groupTitleFixtureId");function a(){if(typeof globalThis>"u")return;return globalThis}e(a,"getCaptureGlobal");function f(){return Boolean(a()?.mermaidCaptureSizes)}e(f,"shouldCaptureSizes");function c(){if(typeof location>"u")return"browser-dev";return`${location.pathname}${location.search}`}e(c,"capturedFromLocation");function p(i,d){let o=a();if(!o)return;let n=d.node(),u=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";o.mermaidCapturedSizes??=[];let r={svgId:u,sizes:i};o.mermaidCapturedSizes.push(r),o.mermaidLastCapturedSizes=r}e(p,"emitCapturedSizes");function m(i,d){let o=[];for(let t of d.nodes){if(t.isGroup)continue;o.push({id:t.id,width:t.width??0,height:t.height??0})}let n=new Set(o.map((t)=>t.id));for(let t of d.edges){let u=typeof t.label==="string"?t.label.trim():t.label,r=s(t);if(!u||n.has(r)||typeof t.width!=="number")continue;n.add(r),o.push({id:r,width:t.width,height:t.height??0})}for(let t of d.nodes)if(t.isGroup&&t.labelBBox)o.push({id:l(t),width:t.labelBBox.width,height:t.labelBBox.height});if(o.length===0)return;p({metadata:{captureVersion:h,capturedAt:new Date().toISOString(),capturedFrom:c()},nodes:o},i)}e(m,"captureNodeSizes");export{m as captureNodeSizes};
1
+ import{e}from"./index.5sj251kq.js";var h=1;function s(i){return`edge-label-${i.start}-${i.end}-${i.id}`}e(s,"edgeLabelFixtureId");function l(i){return`group-title-${i.id}`}e(l,"groupTitleFixtureId");function a(){if(typeof globalThis>"u")return;return globalThis}e(a,"getCaptureGlobal");function f(){return Boolean(a()?.mermaidCaptureSizes)}e(f,"shouldCaptureSizes");function c(){if(typeof location>"u")return"browser-dev";return`${location.pathname}${location.search}`}e(c,"capturedFromLocation");function p(i,d){let o=a();if(!o)return;let n=d.node(),u=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";o.mermaidCapturedSizes??=[];let r={svgId:u,sizes:i};o.mermaidCapturedSizes.push(r),o.mermaidLastCapturedSizes=r}e(p,"emitCapturedSizes");function m(i,d){let o=[];for(let t of d.nodes){if(t.isGroup)continue;o.push({id:t.id,width:t.width??0,height:t.height??0})}let n=new Set(o.map((t)=>t.id));for(let t of d.edges){let u=typeof t.label==="string"?t.label.trim():t.label,r=s(t);if(!u||n.has(r)||typeof t.width!=="number")continue;n.add(r),o.push({id:r,width:t.width,height:t.height??0})}for(let t of d.nodes)if(t.isGroup&&t.labelBBox)o.push({id:l(t),width:t.labelBBox.width,height:t.labelBBox.height});if(o.length===0)return;p({metadata:{captureVersion:h,capturedAt:new Date().toISOString(),capturedFrom:c()},nodes:o},i)}e(m,"captureNodeSizes");export{m as captureNodeSizes};
@@ -1,9 +1,9 @@
1
- import{e,n,Pe,y,A,L,R,I,M,D,O,u,m,ve,he,pe,Ct,ys,z,Ae,_e}from"./index.yfbwd99n.js";import{Xt}from"./index.7q6v461v.js";import{Ee}from"./index.newjn1k4.js";import{ge}from"./index.pyz71tqx.js";var Pt=function(){var t=e(function(Q,c,p,a){for(p=p||{},a=Q.length;a--;p[Q[a]]=c);return p},"o"),s=[1,2],l=[1,3],r=[1,4],d=[2,4],f=[1,9],g=[1,11],b=[1,16],o=[1,17],E=[1,18],_=[1,19],B=[1,33],G=[1,20],W=[1,21],w=[1,22],S=[1,23],Y=[1,24],N=[1,26],H=[1,27],V=[1,28],K=[1,29],x=[1,30],st=[1,31],pt=[1,32],St=[1,35],gt=[1,36],yt=[1,37],mt=[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],bt=[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],Vt=[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(c,p,a,T,v,i,it){var h=i.length-1;switch(v){case 3:return T.setRootDoc(i[h]),i[h];break;case 4:this.$=[];break;case 5:if(i[h]!="nl")i[h-1].push(i[h]),this.$=i[h-1];break;case 6:case 7:this.$=i[h];break;case 8:this.$="nl";break;case 12:this.$=i[h];break;case 13:let Tt=i[h-1];Tt.description=T.trimColon(i[h]),this.$=Tt;break;case 14:this.$={stmt:"relation",state1:i[h-2],state2:i[h]};break;case 15:let Et=T.trimColon(i[h]);this.$={stmt:"relation",state1:i[h-3],state2:i[h-1],description:Et};break;case 19:this.$={stmt:"state",id:i[h-3],type:"default",description:"",doc:i[h-1]};break;case 20:var X=i[h],J=i[h-2].trim();if(i[h].match(":")){var lt=i[h].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[h-3],type:"default",description:i[h-5],doc:i[h-1]};break;case 22:this.$={stmt:"state",id:i[h],type:"fork"};break;case 23:this.$={stmt:"state",id:i[h],type:"join"};break;case 24:this.$={stmt:"state",id:i[h],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[h-1].trim(),note:{position:i[h-2].trim(),text:i[h].trim()}};break;case 29:this.$=i[h].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[h].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[h-3],url:i[h-2],tooltip:i[h-1]};break;case 33:this.$={stmt:"click",id:i[h-3],url:i[h-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[h-1].trim(),classes:i[h].trim()};break;case 36:this.$={stmt:"style",id:i[h-1].trim(),styleClass:i[h].trim()};break;case 37:this.$={stmt:"applyClass",id:i[h-1].trim(),styleClass:i[h].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[h].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[h-2].trim(),classes:[i[h].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[h-2].trim(),classes:[i[h].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:l,6:r},{1:[3]},{3:5,4:s,5:l,6:r},{3:6,4:s,5:l,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],d,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:f,5:g,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:E,22:_,24:B,25:G,26:W,27:w,28:S,29:Y,32:25,33:N,35:H,37:V,38:K,41:x,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},t(k,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:b,17:o,19:E,22:_,24:B,25:G,26:W,27:w,28:S,29:Y,32:25,33:N,35:H,37:V,38:K,41:x,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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:B,57:rt},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(bt,[2,44],{58:[1,56]}),t(bt,[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:B,57:rt},t(k,[2,17]),t(Vt,d,{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:g,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:E,21:[1,72],22:_,24:B,25:G,26:W,27:w,28:S,29:Y,32:25,33:N,35:H,37:V,38:K,41:x,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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(bt,[2,46]),t(bt,[2,47]),t(k,[2,15]),t(k,[2,19]),t(Vt,d,{7:78}),t(k,[2,26]),t(k,[2,27]),{5:[1,79]},{5:[1,80]},{4:f,5:g,8:8,9:10,10:12,11:13,12:14,13:15,16:b,17:o,19:E,21:[1,81],22:_,24:B,25:G,26:W,27:w,28:S,29:Y,32:25,33:N,35:H,37:V,38:K,41:x,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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(c,p){if(p.recoverable)this.trace(c);else{var a=Error(c);throw a.hash=p,a}},"parseError"),parse:e(function(c){var p=this,a=[0],T=[],v=[null],i=[],it=this.table,h="",X=0,J=0,lt=0,Tt=2,Et=1,fe=i.slice.call(arguments,1),C=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(C.setInput(c,tt.yy),tt.yy.lexer=C,tt.yy.parser=this,typeof C.yylloc>"u")C.yylloc={};var It=C.yylloc;i.push(It);var Se=C.options&&C.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ye(U){a.length=a.length-2*U,v.length=v.length-U,i.length=i.length-U}e(ye,"popStack");function Mt(){var U=T.pop()||C.lex()||Et;if(typeof U!=="number"){if(U instanceof Array)T=U,U=T.pop();U=p.symbols_[U]||U}return U}e(Mt,"lex");var F,Nt,et,j,ts,Ot,at={},_t,q,Wt,vt;while(!0){if(et=a[a.length-1],this.defaultActions[et])j=this.defaultActions[et];else{if(F===null||typeof F>"u")F=Mt();j=it[et]&&it[et][F]}if(typeof j>"u"||!j.length||!j[0]){var Rt="";vt=[];for(_t in it[et])if(this.terminals_[_t]&&_t>Tt)vt.push("'"+this.terminals_[_t]+"'");if(C.showPosition)Rt="Parse error on line "+(X+1)+`:
2
- `+C.showPosition()+`
3
- Expecting `+vt.join(", ")+", got '"+(this.terminals_[F]||F)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(F==Et?"end of input":"'"+(this.terminals_[F]||F)+"'");this.parseError(Rt,{text:C.match,token:this.terminals_[F]||F,line:C.yylineno,loc:It,expected:vt})}if(j[0]instanceof Array&&j.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+F);switch(j[0]){case 1:if(a.push(F),v.push(C.yytext),i.push(C.yylloc),a.push(j[1]),F=null,!Nt){if(J=C.yyleng,h=C.yytext,X=C.yylineno,It=C.yylloc,lt>0)lt--}else F=Nt,Nt=null;break;case 2:if(q=this.productions_[j[1]][1],at.$=v[v.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},Se)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[h,J,X,tt.yy,j[1],v,i].concat(fe)),typeof Ot<"u")return Ot;if(q)a=a.slice(0,-1*q*2),v=v.slice(0,-1*q),i=i.slice(0,-1*q);a.push(this.productions_[j[1]][0]),v.push(at.$),i.push(at._$),Wt=it[a[a.length-2]][a[a.length-1]],a.push(Wt);break;case 3:return!0}}return!0},"parse")},ue=function(){var Q={EOF:1,parseError:e(function(p,a){if(this.yy.parser)this.yy.parser.parseError(p,a);else throw Error(p)},"parseError"),setInput:e(function(c,p){if(this.yy=p||this.yy||{},this._input=c,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 c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var p=c.match(/(?:\r\n?|\n).*/g);if(p)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),c},"input"),unput:e(function(c){var p=c.length,a=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var T=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),a.length-1)this.yylineno-=a.length-1;var v=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:a?(a.length===T.length?this.yylloc.first_column:0)+T[T.length-a.length].length-a[0].length:this.yylloc.first_column-p},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-p];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
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(c){this.unput(this.match.slice(c))},"less"),pastInput:e(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var c=this.match;if(c.length<20)c+=this._input.substr(0,20-c.length);return(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var c=this.pastInput(),p=Array(c.length+1).join("-");return c+this.upcomingInput()+`
5
- `+p+"^"},"showPosition"),test_match:e(function(c,p){var a,T,v;if(this.options.backtrack_lexer){if(v={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)v.yylloc.range=this.yylloc.range.slice(0)}if(T=c[0].match(/(?:\r\n?|\n).*/g),T)this.yylineno+=T.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,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(c[0].length),this.matched+=c[0],a=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(a)return a;else if(this._backtrack){for(var i in v)this[i]=v[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var c,p,a,T;if(!this._more)this.yytext="",this.match="";var v=this._currentRules();for(var i=0;i<v.length;i++)if(a=this._input.match(this.rules[v[i]]),a&&(!p||a[0].length>p[0].length)){if(p=a,T=i,this.options.backtrack_lexer)if(c=this.test_match(a,v[i]),c!==!1)return c;else if(this._backtrack){p=!1;continue}else return!1;else if(!this.options.flex)break}if(p){if(c=this.test_match(p,v[T]),c!==!1)return c;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 p=this.next();if(p)return p;else return this.lex()},"lex"),begin:e(function(p){this.conditionStack.push(p)},"begin"),popState:e(function(){var p=this.conditionStack.length-1;if(p>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(p){if(p=this.conditionStack.length-1-Math.abs(p||0),p>=0)return this.conditionStack[p];else return"INITIAL"},"topState"),pushState:e(function(p){this.begin(p)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(p,a,T,v){function i(){let h=a.yytext.indexOf("%%");if(h===0)return!1;if(h>0){let X=a.yytext.slice(0,h),J=a.yytext.slice(h);if(J)p.lexer.unput(J);a.yytext=X}return!0}e(i,"processId");var it=v;switch(T){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(),a.yytext=a.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),a.yytext=a.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: "'+a.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(),a.yytext=a.yytext.substr(2).trim(),31;break;case 68:return this.popState(),a.yytext=a.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 a.yytext=a.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=ue;function kt(){this.yy={}}return e(kt,"Parser"),kt.prototype=Lt,Lt.Parser=kt,new kt}();Pt.parser=Pt;var me=Pt,be="TB",qt="TB",jt="dir",ot="state",nt="root",Bt="relation",ke="classDef",Te="style",De="applyClass",ut="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",se="markdown",re="normal",$t="rect",Ft="rectWithTitle",Ce="stateStart",xe="stateEnd",Gt="divider",Ut="roundedWithTitle",Le="note",we="noteGroup",ft="statediagram",Ie="state",Ne=`${ft}-${Ie}`,ie="transition",Oe="note",Re="note-edge",$e=`${ie} ${Re}`,Fe=`${ft}-${Oe}`,Be="cluster",Ge=`${ft}-${Be}`,Ye="cluster-alt",Ve=`${ft}-${Ye}`,ae="parent",ne="note",Me="state",Yt="----",We=`${Yt}${ne}`,Ht=`${Yt}${ae}`,At=new Map,Z=0,oe=0,ct=new Map,je=e((t,s,l,r)=>{if(t===Gt&&l?.id!==void 0&&ct.has(l.id)){let g=ct.get(l.id);return ct.set(s,g),g}let d=oe++,f=r?void 0:d;return ct.set(s,f),f},"colorSlotFor");function xt(t="",s=0,l="",r=Yt){let d=l!==null&&l.length>0?`${r}${l}`:"";return`${Me}-${t}${d}-${s}`}e(xt,"stateDomId");var Ue=e((t,s,l,r,d,f,g,b)=>{n.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:dt(t,o,l,r,d,f,g,b);break;case ut:dt(t,o,l,r,d,f,g,b);break;case Bt:{dt(t,o.state1,l,r,d,f,g,b),dt(t,o.state2,l,r,d,f,g,b);let E=g==="neo",_={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:E?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:y.sanitizeText(o.description??"",u()),arrowheadStyle:te,labelpos:ee,labelType:se,thickness:re,classes:ie,look:g};d.push(_),Z++}break}})},"setupDoc"),zt=e((t,s=qt)=>{let l=s;if(t.doc){for(let r of t.doc)if(r.stmt==="dir")l=r.value}return l},"getDir");function ht(t,s,l){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((d)=>{let f=l.get(d);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=t.find((d)=>d.id===s.id);if(r)Object.assign(r,s);else t.push(s)}e(ht,"insertOrUpdateNode");function le(t){return t?.classes?.join(" ")??""}e(le,"getClassesFromDbInfo");function ce(t){return t?.styles??[]}e(ce,"getStylesFromDbInfo");var dt=e((t,s,l,r,d,f,g,b)=>{let o=s.id,E=l.get(o),_=le(E),B=ce(E),G=u(),W=_.trim()!==""||B.length>0;if(n.info("dataFetcher parsedItem",s,E,B),o!=="root"){let w=$t;if(s.start===!0)w=Ce;else if(s.start===!1)w=xe;if(s.type!==ut)w=s.type;if(!At.get(o))At.set(o,{id:o,shape:w,description:y.sanitizeText(o,G),cssClasses:`${_} ${Ne}`,cssStyles:B});let S=At.get(o);if(s.description){if(Array.isArray(S.description))S.shape=Ft,S.description.push(s.description);else if(S.description?.length&&S.description.length>0)if(S.shape=Ft,S.description===o)S.description=[s.description];else S.description=[S.description,s.description];else S.shape=$t,S.description=s.description;S.description=y.sanitizeTextOrArray(S.description,G)}if(S.description?.length===1&&S.shape===Ft)if(S.type==="group")S.shape=Ut;else S.shape=$t;if(!S.type&&s.doc)n.info("Setting cluster for XCX",o,zt(s)),S.type="group",S.isGroup=!0,S.dir=zt(s),S.shape=s.type===Qt?Gt:Ut,S.colorIndex=je(S.shape,o,t,W),S.cssClasses=`${S.cssClasses} ${Ge} ${f?Ve:""}`;let Y={labelStyle:"",shape:S.shape,label:S.description,cssClasses:S.cssClasses,cssCompiledStyles:[],cssStyles:S.cssStyles,id:o,dir:S.dir,domId:xt(o,Z),type:S.type,isGroup:S.type==="group",colorIndex:S.colorIndex,padding:8,rx:10,ry:10,look:g,labelType:"markdown"};if(Y.shape===Gt)Y.label="";if(t&&t.id!=="root")n.trace("Setting node ",o," to be child of its parent ",t.id),Y.parentId=t.id;if(Y.centerLabel=!0,s.note){let N={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Fe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,ne),type:"node",isGroup:!1,padding:G.flowchart?.padding,look:g,position:s.note.position},H=o+Ht,V={labelStyle:"",shape:we,label:s.note.text,cssClasses:S.cssClasses,cssStyles:[],id:o+Ht,domId:xt(o,Z,ae),type:"group",isGroup:!0,padding:16,look:g,position:s.note.position};Z++,V.id=H,N.parentId=H,ht(r,V,b),ht(r,N,b),ht(r,Y,b);let K=o,x=N.id;if(s.note.position==="left of")K=N.id,x=o;d.push({id:K+"-"+x,start:K,end:x,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:$e,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:se,thickness:re,look:g})}else ht(r,Y,b)}if(s.doc)n.trace("Adding nodes children "),Ue(s,s.doc,l,r,d,!f,g,b)},"dataFetcher"),He=e(()=>{At.clear(),Z=0,oe=0,ct.clear()},"reset"),de=e((t,s=qt)=>{if(!t.doc)return s;let l=s;for(let r of t.doc)if(r.stmt==="dir")l=r.value;return l},"getDir"),ze=e(function(t,s){return s.db.getClasses()},"getClasses"),Ke=e(async function(t,s,l,r){n.info("REF0:"),n.info("Drawing state diagram (v2)",s);let{securityLevel:d,state:f,layout:g}=u();r.db.extract(r.db.getRootDocV2());let b=r.db.getData(),o=Ee(s,d);if(b.type=r.type,b.layoutAlgorithm=_e(g),b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,u().look==="neo")b.markers=["barbNeo"];else b.markers=["barb"];b.diagramId=s,await Ae(b,o);let _=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((G,W)=>{let w=typeof W==="string"?W:typeof W?.id==="string"?W.id:"",S=b.nodes.find((x)=>x.id===w);if(!w){n.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(W));return}let Y=o.node()?.querySelectorAll("g.node, g.rough-node"),N;if(Y?.forEach((x)=>{let st=x.textContent?.trim();if(x.id===S?.domId||st===w)N=x}),!N){n.warn("⚠️ Could not find node matching text:",w);return}let H=N.parentNode;if(!H){n.warn("⚠️ Node has no parent, cannot wrap:",w);return}let V=document.createElementNS("http://www.w3.org/2000/svg","a"),K=G.url.replace(/^"+|"+$/g,"");if(V.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",K),V.setAttribute("target","_blank"),G.tooltip){let x=G.tooltip.replace(/^"+|"+$/g,"");V.setAttribute("title",x),N.setAttribute("title",x)}H.replaceChild(V,N),V.appendChild(N),n.info("\uD83D\uDD17 Wrapped node in <a> tag for:",w,G.url)})}catch(B){n.error("❌ Error injecting clickable links:",B)}z.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),ge(o,_,ft,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:de},P={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Kt=e(()=>new Map,"newClassesList"),Jt=e(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Dt=e((t)=>JSON.parse(JSON.stringify(t)),"clone"),Je=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Kt(),this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=R,this.setAccTitle=L,this.getAccDescription=M,this.setAccDescription=I,this.setDiagramTitle=D,this.getDiagramTitle=O,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 Bt:this.addRelation(r.state1,r.state2,r.description);break;case ke:this.addStyleClass(r.id.trim(),r.classes);break;case Te:this.handleStyleDef(r);break;case De:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),l=u();He(),dt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,l.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(","),l=t.styleClass.split(",");for(let r of s){let d=this.getState(r);if(!d){let f=r.trim();this.addState(f),d=this.getState(f)}if(d)d.styles=l.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(t){if(n.info("Setting root doc",t),this.rootDoc=t,this.version===1)this.extract(t);else this.extract(this.getRootDocV2())}docTranslator(t,s,l){if(s.stmt===Bt){this.docTranslator(t,s.state1,!0),this.docTranslator(t,s.state2,!1);return}if(s.stmt===ot)if(s.id===P.START_NODE)s.id=t.id+(l?"_start":"_end"),s.start=l;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],d=[];for(let f of s.doc)if(f.type===Qt){let g=Dt(f);g.doc=Dt(d),r.push(g),d=[]}else d.push(f);if(r.length>0&&d.length>0){let f={stmt:ot,id:ys(),type:"divider",doc:Dt(d)};r.push(Dt(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,l=void 0,r=void 0,d=void 0,f=void 0,g=void 0,b=void 0){let o=t?.trim();if(!this.currentDocument.states.has(o))n.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:l,note:d,classes:[],styles:[],textStyles:[]});else{let E=this.currentDocument.states.get(o);if(!E)throw Error(`State not found: ${o}`);if(!E.doc)E.doc=l;if(!E.type)E.type=s}if(r)n.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((_)=>this.addDescription(o,_.trim()));if(d){let E=this.currentDocument.states.get(o);if(!E)throw Error(`State not found: ${o}`);E.note=d,E.note.text=y.sanitizeText(E.note.text,u())}if(f)n.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((_)=>this.setCssClass(o,_.trim()));if(g)n.info("Setting state styles",o,g),(Array.isArray(g)?g:[g]).forEach((_)=>this.setStyle(o,_.trim()));if(b)n.info("Setting state styles",o,g),(Array.isArray(b)?b:[b]).forEach((_)=>this.setTextStyle(o,_.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=Kt(),!t)this.links=new Map,A()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){n.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,s,l){this.links.set(t,{url:s,tooltip:l}),n.warn("Adding link",t,s,l)}getLinks(){return this.links}startIdIfNeeded(t=""){if(t===P.START_NODE)return this.startEndCount++,`${P.START_TYPE}${this.startEndCount}`;return t}startTypeIfNeeded(t="",s=ut){return t===P.START_NODE?P.START_TYPE:s}endIdIfNeeded(t=""){if(t===P.END_NODE)return this.startEndCount++,`${P.END_TYPE}${this.startEndCount}`;return t}endTypeIfNeeded(t="",s=ut){return t===P.END_NODE?P.END_TYPE:s}addRelationObjs(t,s,l=""){let r=this.startIdIfNeeded(t.id.trim()),d=this.startTypeIfNeeded(t.id.trim(),t.type),f=this.startIdIfNeeded(s.id.trim()),g=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,d,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(f,g,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:y.sanitizeText(l,u())})}addRelation(t,s,l){if(typeof t==="object"&&typeof s==="object")this.addRelationObjs(t,s,l);else if(typeof t==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(t.trim()),d=this.startTypeIfNeeded(t),f=this.endIdIfNeeded(s.trim()),g=this.endTypeIfNeeded(s);this.addState(r,d),this.addState(f,g),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:l?y.sanitizeText(l,u()):void 0})}}addDescription(t,s){let l=this.currentDocument.states.get(t),r=s.startsWith(":")?s.replace(":","").trim():s;l?.descriptions?.push(y.sanitizeText(r,u()))}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 l=this.classes.get(t);if(s&&l)s.split(P.STYLECLASS_SEP).forEach((r)=>{let d=r.replace(/([^;]*);/,"$1").trim();if(RegExp(P.COLOR_KEYWORD).exec(r)){let g=d.replace(P.FILL_KEYWORD,P.BG_FILL).replace(P.COLOR_KEYWORD,P.FILL_KEYWORD);l.textStyles.push(g)}l.styles.push(d)})}getClasses(){return this.classes}setupToolTips(t){let s=Xt();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(d)=>{let f=m(d.currentTarget),g=f.attr("title");if(g===null)return;let b=d.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(Pe.sanitize(g)),f.classed("hover",!0)}).on("mouseout",(d)=>{s.transition().duration(500).style("opacity",0),m(d.currentTarget).classed("hover",!1)})}setCssClass(t,s){t.split(",").forEach((l)=>{let r=this.getState(l);if(!r){let d=l.trim();this.addState(d),r=this.getState(d)}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===jt)}getDirection(){return this.getDirectionStatement()?.value??be}setDirection(t){let s=this.getDirectionStatement();if(s)s.value=t;else this.rootDoc.unshift({stmt:jt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=u();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:de(this.getRootDocV2())}}getConfig(){return u().state}},qe=e((t)=>{let{theme:s,bkgColorArray:l,borderColorArray:r}=t;if(!he(s,r))return"";let d=pe(t.look),f=ve(l),g="";for(let b=0;b<Ct(r);b++){let o=r[b],E=f?`fill: ${l[b%l.length]};`:"",_=`[data-look="${d}"][data-color-id="color-${b}"]`;g+=`
1
+ import{e,n,Oe,y,A,L,R,I,M,P,O,u,p,ge,de,fe,Tt,ys,F,Se,Ee}from"./index.5sj251kq.js";import{Kt}from"./index.5n55ccv6.js";import{Ce}from"./index.3c95g5mh.js";import{pe}from"./index.tnx5y2zc.js";var Pt=function(){var t=e(function(Q,c,S,a){for(S=S||{},a=Q.length;a--;S[Q[a]]=c);return S},"o"),s=[1,2],l=[1,3],r=[1,4],d=[2,4],f=[1,9],m=[1,11],b=[1,16],o=[1,17],E=[1,18],_=[1,19],G=[1,33],Y=[1,20],j=[1,21],x=[1,22],g=[1,23],V=[1,24],w=[1,26],z=[1,27],W=[1,28],K=[1,29],C=[1,30],st=[1,31],pt=[1,32],St=[1,35],gt=[1,36],yt=[1,37],mt=[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],bt=[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],Vt=[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(c,S,a,T,v,i,it){var h=i.length-1;switch(v){case 3:return T.setRootDoc(i[h]),i[h];break;case 4:this.$=[];break;case 5:if(i[h]!="nl")i[h-1].push(i[h]),this.$=i[h-1];break;case 6:case 7:this.$=i[h];break;case 8:this.$="nl";break;case 12:this.$=i[h];break;case 13:let Et=i[h-1];Et.description=T.trimColon(i[h]),this.$=Et;break;case 14:this.$={stmt:"relation",state1:i[h-2],state2:i[h]};break;case 15:let _t=T.trimColon(i[h]);this.$={stmt:"relation",state1:i[h-3],state2:i[h-1],description:_t};break;case 19:this.$={stmt:"state",id:i[h-3],type:"default",description:"",doc:i[h-1]};break;case 20:var X=i[h],J=i[h-2].trim();if(i[h].match(":")){var lt=i[h].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[h-3],type:"default",description:i[h-5],doc:i[h-1]};break;case 22:this.$={stmt:"state",id:i[h],type:"fork"};break;case 23:this.$={stmt:"state",id:i[h],type:"join"};break;case 24:this.$={stmt:"state",id:i[h],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[h-1].trim(),note:{position:i[h-2].trim(),text:i[h].trim()}};break;case 29:this.$=i[h].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[h].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[h-3],url:i[h-2],tooltip:i[h-1]};break;case 33:this.$={stmt:"click",id:i[h-3],url:i[h-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[h-1].trim(),classes:i[h].trim()};break;case 36:this.$={stmt:"style",id:i[h-1].trim(),styleClass:i[h].trim()};break;case 37:this.$={stmt:"applyClass",id:i[h-1].trim(),styleClass:i[h].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[h].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[h-2].trim(),classes:[i[h].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[h-2].trim(),classes:[i[h].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:l,6:r},{1:[3]},{3:5,4:s,5:l,6:r},{3:6,4:s,5:l,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],d,{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:E,22:_,24:G,25:Y,26:j,27:x,28:g,29:V,32:25,33:w,35:z,37:W,38:K,41:C,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},t(k,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:b,17:o,19:E,22:_,24:G,25:Y,26:j,27:x,28:g,29:V,32:25,33:w,35:z,37:W,38:K,41:C,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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(bt,[2,44],{58:[1,56]}),t(bt,[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(Vt,d,{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:E,21:[1,72],22:_,24:G,25:Y,26:j,27:x,28:g,29:V,32:25,33:w,35:z,37:W,38:K,41:C,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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(bt,[2,46]),t(bt,[2,47]),t(k,[2,15]),t(k,[2,19]),t(Vt,d,{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:E,21:[1,81],22:_,24:G,25:Y,26:j,27:x,28:g,29:V,32:25,33:w,35:z,37:W,38:K,41:C,45:st,48:pt,51:St,52:gt,53:yt,54:mt,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(c,S){if(S.recoverable)this.trace(c);else{var a=Error(c);throw a.hash=S,a}},"parseError"),parse:e(function(c){var S=this,a=[0],T=[],v=[null],i=[],it=this.table,h="",X=0,J=0,lt=0,Et=2,_t=1,ye=i.slice.call(arguments,1),D=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(D.setInput(c,tt.yy),tt.yy.lexer=D,tt.yy.parser=this,typeof D.yylloc>"u")D.yylloc={};var It=D.yylloc;i.push(It);var me=D.options&&D.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(H){a.length=a.length-2*H,v.length=v.length-H,i.length=i.length-H}e(be,"popStack");function Mt(){var H=T.pop()||D.lex()||_t;if(typeof H!=="number"){if(H instanceof Array)T=H,H=T.pop();H=S.symbols_[H]||H}return H}e(Mt,"lex");var N,Nt,et,U,ts,Ot,at={},vt,q,Wt,Dt;while(!0){if(et=a[a.length-1],this.defaultActions[et])U=this.defaultActions[et];else{if(N===null||typeof N>"u")N=Mt();U=it[et]&&it[et][N]}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(D.showPosition)Rt="Parse error on line "+(X+1)+`:
2
+ `+D.showPosition()+`
3
+ Expecting `+Dt.join(", ")+", got '"+(this.terminals_[N]||N)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(N==_t?"end of input":"'"+(this.terminals_[N]||N)+"'");this.parseError(Rt,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:It,expected:Dt})}if(U[0]instanceof Array&&U.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+N);switch(U[0]){case 1:if(a.push(N),v.push(D.yytext),i.push(D.yylloc),a.push(U[1]),N=null,!Nt){if(J=D.yyleng,h=D.yytext,X=D.yylineno,It=D.yylloc,lt>0)lt--}else N=Nt,Nt=null;break;case 2:if(q=this.productions_[U[1]][1],at.$=v[v.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},me)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[h,J,X,tt.yy,U[1],v,i].concat(ye)),typeof Ot<"u")return Ot;if(q)a=a.slice(0,-1*q*2),v=v.slice(0,-1*q),i=i.slice(0,-1*q);a.push(this.productions_[U[1]][0]),v.push(at.$),i.push(at._$),Wt=it[a[a.length-2]][a[a.length-1]],a.push(Wt);break;case 3:return!0}}return!0},"parse")},ue=function(){var Q={EOF:1,parseError:e(function(S,a){if(this.yy.parser)this.yy.parser.parseError(S,a);else throw Error(S)},"parseError"),setInput:e(function(c,S){if(this.yy=S||this.yy||{},this._input=c,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 c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var S=c.match(/(?:\r\n?|\n).*/g);if(S)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),c},"input"),unput:e(function(c){var S=c.length,a=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var T=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),a.length-1)this.yylineno-=a.length-1;var v=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:a?(a.length===T.length?this.yylloc.first_column:0)+T[T.length-a.length].length-a[0].length:this.yylloc.first_column-S},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-S];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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(c){this.unput(this.match.slice(c))},"less"),pastInput:e(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var c=this.match;if(c.length<20)c+=this._input.substr(0,20-c.length);return(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var c=this.pastInput(),S=Array(c.length+1).join("-");return c+this.upcomingInput()+`
5
+ `+S+"^"},"showPosition"),test_match:e(function(c,S){var a,T,v;if(this.options.backtrack_lexer){if(v={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)v.yylloc.range=this.yylloc.range.slice(0)}if(T=c[0].match(/(?:\r\n?|\n).*/g),T)this.yylineno+=T.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,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(c[0].length),this.matched+=c[0],a=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(a)return a;else if(this._backtrack){for(var i in v)this[i]=v[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var c,S,a,T;if(!this._more)this.yytext="",this.match="";var v=this._currentRules();for(var i=0;i<v.length;i++)if(a=this._input.match(this.rules[v[i]]),a&&(!S||a[0].length>S[0].length)){if(S=a,T=i,this.options.backtrack_lexer)if(c=this.test_match(a,v[i]),c!==!1)return c;else if(this._backtrack){S=!1;continue}else return!1;else if(!this.options.flex)break}if(S){if(c=this.test_match(S,v[T]),c!==!1)return c;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 S=this.next();if(S)return S;else return this.lex()},"lex"),begin:e(function(S){this.conditionStack.push(S)},"begin"),popState:e(function(){var S=this.conditionStack.length-1;if(S>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(S){if(S=this.conditionStack.length-1-Math.abs(S||0),S>=0)return this.conditionStack[S];else return"INITIAL"},"topState"),pushState:e(function(S){this.begin(S)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(S,a,T,v){function i(){let h=a.yytext.indexOf("%%");if(h===0)return!1;if(h>0){let X=a.yytext.slice(0,h),J=a.yytext.slice(h);if(J)S.lexer.unput(J);a.yytext=X}return!0}e(i,"processId");var it=v;switch(T){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(),a.yytext=a.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),a.yytext=a.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: "'+a.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(),a.yytext=a.yytext.substr(2).trim(),31;break;case 68:return this.popState(),a.yytext=a.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 a.yytext=a.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=ue;function kt(){this.yy={}}return e(kt,"Parser"),kt.prototype=Lt,Lt.Parser=kt,new kt}();Pt.parser=Pt;var ke=Pt,Te="TB",qt="TB",jt="dir",ot="state",nt="root",Bt="relation",_e="classDef",ve="style",De="applyClass",ut="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",se="markdown",re="normal",$t="rect",Ft="rectWithTitle",Ae="stateStart",xe="stateEnd",Gt="divider",Ut="roundedWithTitle",Le="note",we="noteGroup",ft="statediagram",Ie="state",Ne=`${ft}-${Ie}`,ie="transition",Re="note",$e="note-edge",Fe=`${ie} ${$e}`,Pe=`${ft}-${Re}`,Be="cluster",Ge=`${ft}-${Be}`,Ye="cluster-alt",Ve=`${ft}-${Ye}`,ae="parent",ne="note",Me="state",Yt="----",We=`${Yt}${ne}`,Ht=`${Yt}${ae}`,At=new Map,Z=0,oe=0,ct=new Map,je=e((t,s,l,r)=>{if(t===Gt&&l?.id!==void 0&&ct.has(l.id)){let m=ct.get(l.id);return ct.set(s,m),m}let d=oe++,f=r?void 0:d;return ct.set(s,f),f},"colorSlotFor");function xt(t="",s=0,l="",r=Yt){let d=l!==null&&l.length>0?`${r}${l}`:"";return`${Me}-${t}${d}-${s}`}e(xt,"stateDomId");var Ue=e((t,s,l,r,d,f,m,b)=>{n.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:dt(t,o,l,r,d,f,m,b);break;case ut:dt(t,o,l,r,d,f,m,b);break;case Bt:{dt(t,o.state1,l,r,d,f,m,b),dt(t,o.state2,l,r,d,f,m,b);let E=m==="neo",_={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:E?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:y.sanitizeText(o.description??"",u()),arrowheadStyle:te,labelpos:ee,labelType:se,thickness:re,classes:ie,look:m};d.push(_),Z++}break}})},"setupDoc"),zt=e((t,s=qt)=>{let l=s;if(t.doc){for(let r of t.doc)if(r.stmt==="dir")l=r.value}return l},"getDir");function ht(t,s,l){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((d)=>{let f=l.get(d);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=t.find((d)=>d.id===s.id);if(r)Object.assign(r,s);else t.push(s)}e(ht,"insertOrUpdateNode");function le(t){return t?.classes?.join(" ")??""}e(le,"getClassesFromDbInfo");function ce(t){return t?.styles??[]}e(ce,"getStylesFromDbInfo");var dt=e((t,s,l,r,d,f,m,b)=>{let o=s.id,E=l.get(o),_=le(E),G=ce(E),Y=u(),j=_.trim()!==""||G.length>0;if(n.info("dataFetcher parsedItem",s,E,G),o!=="root"){let x=$t;if(s.start===!0)x=Ae;else if(s.start===!1)x=xe;if(s.type!==ut)x=s.type;if(!At.get(o))At.set(o,{id:o,shape:x,description:y.sanitizeText(o,Y),cssClasses:`${_} ${Ne}`,cssStyles:G});let g=At.get(o);if(s.description){if(Array.isArray(g.description))g.shape=Ft,g.description.push(s.description);else if(g.description?.length&&g.description.length>0)if(g.shape=Ft,g.description===o)g.description=[s.description];else g.description=[g.description,s.description];else g.shape=$t,g.description=s.description;g.description=y.sanitizeTextOrArray(g.description,Y)}if(g.description?.length===1&&g.shape===Ft)if(g.type==="group")g.shape=Ut;else g.shape=$t;if(!g.type&&s.doc)n.info("Setting cluster for XCX",o,zt(s)),g.type="group",g.isGroup=!0,g.dir=zt(s),g.shape=s.type===Qt?Gt:Ut,g.colorIndex=je(g.shape,o,t,j),g.cssClasses=`${g.cssClasses} ${Ge} ${f?Ve:""}`;let V={labelStyle:"",shape:g.shape,label:g.description,cssClasses:g.cssClasses,cssCompiledStyles:[],cssStyles:g.cssStyles,id:o,dir:g.dir,domId:xt(o,Z),type:g.type,isGroup:g.type==="group",colorIndex:g.colorIndex,padding:8,rx:10,ry:10,look:m,labelType:"markdown"};if(V.shape===Gt)V.label="";if(t&&t.id!=="root")n.trace("Setting node ",o," to be child of its parent ",t.id),V.parentId=t.id;if(V.centerLabel=!0,s.note){let w={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Pe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,ne),type:"node",isGroup:!1,padding:Y.flowchart?.padding,look:m,position:s.note.position},z=o+Ht,W={labelStyle:"",shape:we,label:s.note.text,cssClasses:g.cssClasses,cssStyles:[],id:o+Ht,domId:xt(o,Z,ae),type:"group",isGroup:!0,padding:16,look:m,position:s.note.position};Z++,W.id=z,w.parentId=z,ht(r,W,b),ht(r,w,b),ht(r,V,b);let K=o,C=w.id;if(s.note.position==="left of")K=w.id,C=o;d.push({id:K+"-"+C,start:K,end:C,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:Fe,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:se,thickness:re,look:m})}else ht(r,V,b)}if(s.doc)n.trace("Adding nodes children "),Ue(s,s.doc,l,r,d,!f,m,b)},"dataFetcher"),He=e(()=>{At.clear(),Z=0,oe=0,ct.clear()},"reset"),he=e((t,s=qt)=>{if(!t.doc)return s;let l=s;for(let r of t.doc)if(r.stmt==="dir")l=r.value;return l},"getDir"),ze=e(function(t,s){return s.db.getClasses()},"getClasses"),Ke=e(async function(t,s,l,r){n.info("REF0:"),n.info("Drawing state diagram (v2)",s);let{securityLevel:d,state:f,layout:m}=u();r.db.extract(r.db.getRootDocV2());let b=r.db.getData(),o=Ce(s,d);if(b.type=r.type,b.layoutAlgorithm=Ee(m),b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,u().look==="neo")b.markers=["barbNeo"];else b.markers=["barb"];b.diagramId=s,await Se(b,o);let _=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((Y,j)=>{let x=typeof j==="string"?j:typeof j?.id==="string"?j.id:"",g=b.nodes.find((C)=>C.id===x);if(!x){n.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(j));return}let V=o.node()?.querySelectorAll("g.node, g.rough-node"),w;if(V?.forEach((C)=>{let st=C.textContent?.trim();if(C.id===g?.domId||st===x)w=C}),!w){n.warn("⚠️ Could not find node matching text:",x);return}let z=w.parentNode;if(!z){n.warn("⚠️ Node has no parent, cannot wrap:",x);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 C=Y.tooltip.replace(/^"+|"+$/g,"");W.setAttribute("title",C),w.setAttribute("title",C)}z.replaceChild(W,w),W.appendChild(w),n.info("\uD83D\uDD17 Wrapped node in <a> tag for:",x,Y.url)})}catch(G){n.error("❌ Error injecting clickable links:",G)}F.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),pe(o,_,ft,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:he},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=R,this.setAccTitle=L,this.getAccDescription=M,this.setAccDescription=I,this.setDiagramTitle=P,this.getDiagramTitle=O,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 Bt:this.addRelation(r.state1,r.state2,r.description);break;case _e:this.addStyleClass(r.id.trim(),r.classes);break;case ve:this.handleStyleDef(r);break;case De:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),l=u();He(),dt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,l.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(","),l=t.styleClass.split(",");for(let r of s){let d=this.getState(r);if(!d){let f=r.trim();this.addState(f),d=this.getState(f)}if(d)d.styles=l.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(t){if(n.info("Setting root doc",t),this.rootDoc=t,this.version===1)this.extract(t);else this.extract(this.getRootDocV2())}docTranslator(t,s,l){if(s.stmt===Bt){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+(l?"_start":"_end"),s.start=l;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],d=[];for(let f of s.doc)if(f.type===Qt){let m=Ct(f);m.doc=Ct(d),r.push(m),d=[]}else d.push(f);if(r.length>0&&d.length>0){let f={stmt:ot,id:ys(),type:"divider",doc:Ct(d)};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,l=void 0,r=void 0,d=void 0,f=void 0,m=void 0,b=void 0){let o=t?.trim();if(!this.currentDocument.states.has(o))n.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:l,note:d,classes:[],styles:[],textStyles:[]});else{let E=this.currentDocument.states.get(o);if(!E)throw Error(`State not found: ${o}`);if(!E.doc)E.doc=l;if(!E.type)E.type=s}if(r)n.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((_)=>this.addDescription(o,_.trim()));if(d){let E=this.currentDocument.states.get(o);if(!E)throw Error(`State not found: ${o}`);E.note=d,E.note.text=y.sanitizeText(E.note.text,u())}if(f)n.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((_)=>this.setCssClass(o,_.trim()));if(m)n.info("Setting state styles",o,m),(Array.isArray(m)?m:[m]).forEach((_)=>this.setStyle(o,_.trim()));if(b)n.info("Setting state styles",o,m),(Array.isArray(b)?b:[b]).forEach((_)=>this.setTextStyle(o,_.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,A()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){n.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,s,l){this.links.set(t,{url:s,tooltip:l}),n.warn("Adding link",t,s,l)}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,l=""){let r=this.startIdIfNeeded(t.id.trim()),d=this.startTypeIfNeeded(t.id.trim(),t.type),f=this.startIdIfNeeded(s.id.trim()),m=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,d,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:y.sanitizeText(l,u())})}addRelation(t,s,l){if(typeof t==="object"&&typeof s==="object")this.addRelationObjs(t,s,l);else if(typeof t==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(t.trim()),d=this.startTypeIfNeeded(t),f=this.endIdIfNeeded(s.trim()),m=this.endTypeIfNeeded(s);this.addState(r,d),this.addState(f,m),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:l?y.sanitizeText(l,u()):void 0})}}addDescription(t,s){let l=this.currentDocument.states.get(t),r=s.startsWith(":")?s.replace(":","").trim():s;l?.descriptions?.push(y.sanitizeText(r,u()))}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 l=this.classes.get(t);if(s&&l)s.split(B.STYLECLASS_SEP).forEach((r)=>{let d=r.replace(/([^;]*);/,"$1").trim();if(RegExp(B.COLOR_KEYWORD).exec(r)){let m=d.replace(B.FILL_KEYWORD,B.BG_FILL).replace(B.COLOR_KEYWORD,B.FILL_KEYWORD);l.textStyles.push(m)}l.styles.push(d)})}getClasses(){return this.classes}setupToolTips(t){let s=Kt();p(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(d)=>{let f=p(d.currentTarget),m=f.attr("title");if(m===null)return;let b=d.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(Oe.sanitize(m)),f.classed("hover",!0)}).on("mouseout",(d)=>{s.transition().duration(500).style("opacity",0),p(d.currentTarget).classed("hover",!1)})}setCssClass(t,s){t.split(",").forEach((l)=>{let r=this.getState(l);if(!r){let d=l.trim();this.addState(d),r=this.getState(d)}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===jt)}getDirection(){return this.getDirectionStatement()?.value??Te}setDirection(t){let s=this.getDirectionStatement();if(s)s.value=t;else this.rootDoc.unshift({stmt:jt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=u();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:he(this.getRootDocV2())}}getConfig(){return u().state}},qe=e((t)=>{let{theme:s,bkgColorArray:l,borderColorArray:r}=t;if(!de(s,r))return"";let d=fe(t.look),f=ge(l),m="";for(let b=0;b<Tt(r);b++){let o=r[b],E=f?`fill: ${l[b%l.length]};`:"",_=`[data-look="${d}"][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. */
@@ -62,7 +62,7 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[F]||F)+"'";else Rt="Parse e
62
62
  ${_}.statediagram-cluster .divider path[fill='none'] {
63
63
  stroke: ${o};
64
64
  }
65
- `}return g},"genColor"),Qe=e((t)=>`
65
+ `}return m},"genColor"),Qe=e((t)=>`
66
66
  ${qe(t)}
67
67
  defs [id$="-barbEnd"] {
68
68
  fill: ${t.transitionColor};
@@ -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,Ts={parser:me,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{Ts as diagram};
291
+ `,"getStyles"),Ze=Qe,Ts={parser:ke,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{Ts as diagram};