@belonguniverseai/react-sdk 0.6.2 → 0.6.4

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 (81) hide show
  1. package/dist/api/agent-grants.d.ts +23 -8
  2. package/dist/api/client.d.ts +53 -4
  3. package/dist/api/queries.d.ts +2 -0
  4. package/dist/app/call-summary.d.ts +30 -0
  5. package/dist/component/abnfDiagram-N423BO3Z-DR3fMT7g.js +90 -0
  6. package/dist/component/arc-DJkYOSuJ.js +86 -0
  7. package/dist/component/{architectureDiagram-3BPJPVTR-DYcaPx2M.js → architectureDiagram-T3A2C74G-BIp4IBPk.js} +1872 -1785
  8. package/dist/component/{blockDiagram-GPEHLZMM-BdjruLO5.js → blockDiagram-VBNYF7ZC-BqryGqC6.js} +895 -894
  9. package/dist/component/{c4Diagram-AAUBKEIU-Bd2ebSgB.js → c4Diagram-5PPSVZJV-GktlF-Di.js} +3 -3
  10. package/dist/component/{channel-CYFijF_t.js → channel-3CusDaXb.js} +2 -2
  11. package/dist/component/{chunk-ND2GUHAM-OX1-DIU1.js → chunk-2GRJ4B5K-DMTs6j_c.js} +5 -5
  12. package/dist/component/{chunk-QZHKN3VN-DLQ8oUCc.js → chunk-2Q5K7J3B-CIU34hPH.js} +2 -2
  13. package/dist/component/{chunk-AQP2D5EJ-D4G4syYu.js → chunk-5RXB4S5H-Ds3vF1Mv.js} +399 -378
  14. package/dist/component/{chunk-FMBD7UC4-CbRxWx_A.js → chunk-5VM5RSS4-DGxDkIm6.js} +2 -2
  15. package/dist/component/chunk-6Q2QTUOP-BI8oZt98.js +673 -0
  16. package/dist/component/{chunk-727SXJPM-A5r5oL1_.js → chunk-GF5L2VYU-D-36xUd5.js} +244 -239
  17. package/dist/component/{chunk-4BX2VUAB-DVpS0I_p.js → chunk-JWPE2WC7-8N_wQ762.js} +2 -2
  18. package/dist/component/{chunk-2J33WTMH-B06Y_xVy.js → chunk-KBJHAD2P-ChxxpkWc.js} +2 -2
  19. package/dist/component/chunk-RYQCIY6F-CSY-95OP.js +316 -0
  20. package/dist/component/{chunk-55IACEB6-DmZctFkK.js → chunk-XXDRQBXY-BQd9yyE1.js} +2 -2
  21. package/dist/component/{classDiagram-4FO5ZUOK-4S9mdFC1.js → classDiagram-JCYQIIEL-BOq63iUL.js} +3 -3
  22. package/dist/component/{classDiagram-v2-Q7XG4LA2-4S9mdFC1.js → classDiagram-v2-OCEON4UE-BOq63iUL.js} +3 -3
  23. package/dist/component/{cose-bilkent-S5V4N54A-BIrVaakt.js → cose-bilkent-JH36ORCC-B9x8cp5w.js} +2 -2
  24. package/dist/component/{wardley-L42UT6IY-HA1eSIS_.js → cynefin-VYW2F7L2-DAyxamLw.js} +9199 -7918
  25. package/dist/component/cynefinDiagram-MW4NZA55-OF6l99SS.js +302 -0
  26. package/dist/component/dagre-VZM6K2ZE-CELO1hFb.js +343 -0
  27. package/dist/component/diagram-7IWD3JNH-COzvm6E2.js +353 -0
  28. package/dist/component/{diagram-KO2AKTUF-Da1E68Eo.js → diagram-B4RE2ZJO-DR9KMRGw.js} +24 -24
  29. package/dist/component/{diagram-LMA3HP47-dRbk5sBa.js → diagram-LBJQPF4R-D47Zqm-k.js} +23 -23
  30. package/dist/component/{diagram-OG6HWLK6-CcKT8mhn.js → diagram-Q27KOJAE-Key1bw_Y.js} +197 -197
  31. package/dist/component/diagram-UB23O5K3-Cxf-sZnK.js +222 -0
  32. package/dist/component/ebnfDiagram-BXEA7PRR-C8uURt_x.js +112 -0
  33. package/dist/component/{erDiagram-TEJ5UH35-3ATYT9J-.js → erDiagram-JOGREHBK-CpCxe8Ib.js} +142 -131
  34. package/dist/component/{flowDiagram-I6XJVG4X-D9PLm9Od.js → flowDiagram-UKHOOZJN-urFG2I71.js} +268 -258
  35. package/dist/component/ganttDiagram-PKOTCBZU-8nA9faYf.js +2714 -0
  36. package/dist/component/{gitGraphDiagram-PVQCEYII-13gVhAGc.js → gitGraphDiagram-DS77QQ5N-u4cbNW8o.js} +33 -33
  37. package/dist/component/{graph-BZLHvygk.js → graph-CWpEkm4G.js} +35 -35
  38. package/dist/component/{highlighted-body-OFNGDK62-DCxRI4UV.js → highlighted-body-OFNGDK62-Bo-15uvJ.js} +2 -2
  39. package/dist/component/index.js +2 -2
  40. package/dist/component/{infoDiagram-5YYISTIA-DymxA7AN.js → infoDiagram-6WML65LV-ZAv4gZpA.js} +4 -4
  41. package/dist/component/{ishikawaDiagram-YF4QCWOH-C3sTn76C.js → ishikawaDiagram-WSZJBQD7-CvB6evSz.js} +27 -27
  42. package/dist/component/{journeyDiagram-JHISSGLW-Cq0hOAfJ.js → journeyDiagram-NVQOT4AX-M5BRYuPr.js} +5 -5
  43. package/dist/component/{kanban-definition-UN3LZRKU-5tBWjkp7.js → kanban-definition-27J2QSJJ-LL6GkmVe.js} +35 -35
  44. package/dist/component/layout-Br2UjHRU.js +1522 -0
  45. package/dist/component/{linear-BT4blD8s.js → linear-DVg61V66.js} +13 -13
  46. package/dist/component/map-CdwokNh2.js +227 -0
  47. package/dist/component/{mermaid-GHXKKRXX-DXPXjnb7.js → mermaid-GHXKKRXX-C2L7fCIM.js} +29577 -29128
  48. package/dist/component/{mindmap-definition-RKZ34NQL-DO-OuAQQ.js → mindmap-definition-FAOFIHXS-BBZzsLh7.js} +26 -26
  49. package/dist/component/pegDiagram-VL7TDLO6-BEG86cY8.js +98 -0
  50. package/dist/component/pieDiagram-7S7Q4E2Y-BTkrNjAi.js +210 -0
  51. package/dist/component/{quadrantDiagram-W4KKPZXB-CaJWg9ep.js → quadrantDiagram-CIZ2JOQS-BsjBAd4w.js} +14 -15
  52. package/dist/component/railroadDiagram-AXF67PYL-DuE0ZFxj.js +80 -0
  53. package/dist/component/{requirementDiagram-4Y6WPE33-CmZrtZqe.js → requirementDiagram-LRYGKXZP-CcshEEMy.js} +15 -15
  54. package/dist/component/{sankeyDiagram-5OEKKPKP-Cp95M1aj.js → sankeyDiagram-W5VNT64P-CFn011ig.js} +2 -2
  55. package/dist/component/{sequenceDiagram-3UESZ5HK-C0x0WvhR.js → sequenceDiagram-SI44F4Z6-DmMZNJDw.js} +960 -963
  56. package/dist/component/sizeCapture-X5ZJPWSS-Ce4PhIAO.js +49 -0
  57. package/dist/component/{stateDiagram-AJRCARHV-H10vaGL3.js → stateDiagram-OKZ733FA-DDVzQKaO.js} +5 -5
  58. package/dist/component/{stateDiagram-v2-BHNVJYJU-rj7ljkc-.js → stateDiagram-v2-UEYNNEHI-DeeW8PDA.js} +3 -3
  59. package/dist/component/swimlanes-SLNWSIFB-CZh2_vzg.js +5335 -0
  60. package/dist/component/swimlanesDiagram-ULZ7WXOC-Wb0Ri7qR.js +16 -0
  61. package/dist/component/{timeline-definition-PNZ67QCA-Cil1QaqZ.js → timeline-definition-Z64GVDOM-rfiLwdTR.js} +15 -15
  62. package/dist/component/vennDiagram-T6HMQDX7-D8l7hqNb.js +1581 -0
  63. package/dist/component/{wardleyDiagram-YWT4CUSO-Xq5Hnmio.js → wardleyDiagram-T6FBY63Y-7YqmpmtC.js} +15 -15
  64. package/dist/component/{xychartDiagram-2RQKCTM6-dinwR4Zm.js → xychartDiagram-ELKLHX3M-Dx2ECqt8.js} +464 -418
  65. package/dist/embed/voice/line-slots.d.ts +37 -2
  66. package/dist/embed/voice-call.d.ts +12 -0
  67. package/dist/i18n/messages/en.d.ts +1 -2
  68. package/dist/lib/web-storage.d.ts +8 -0
  69. package/dist/stream/belong-chat-transport.d.ts +1 -0
  70. package/dist/stream/belong-data-parts.d.ts +2 -0
  71. package/dist/stream/stream-state-store.d.ts +13 -0
  72. package/dist/types/public.d.ts +3 -0
  73. package/package.json +1 -1
  74. package/dist/component/arc-TLcl3N8_.js +0 -86
  75. package/dist/component/dagre-BM42HDAG-BoPUzTvD.js +0 -448
  76. package/dist/component/diagram-2AECGRRQ-PIXCGxIt.js +0 -220
  77. package/dist/component/diagram-5GNKFQAL-CbJxbGBh.js +0 -126
  78. package/dist/component/ganttDiagram-6RSMTGT7-F_XUzD1p.js +0 -2709
  79. package/dist/component/layout-Bu6nRdWm.js +0 -1731
  80. package/dist/component/pieDiagram-4H26LBE5-BkEktPwZ.js +0 -166
  81. package/dist/component/vennDiagram-CIIHVFJN-Dk8PKmfb.js +0 -1560
@@ -1,207 +1,208 @@
1
- import { g as Zt } from "./chunk-55IACEB6-DmZctFkK.js";
2
- import { s as te } from "./chunk-2J33WTMH-B06Y_xVy.js";
3
- import { _ as f, l as _, c as w, r as ee, u as se, a as ie, b as re, g as ae, s as ne, q as oe, t as le, ae as ce, k as W, B as he } from "./mermaid-GHXKKRXX-DXPXjnb7.js";
1
+ import { g as te } from "./chunk-XXDRQBXY-BQd9yyE1.js";
2
+ import { s as ee } from "./chunk-KBJHAD2P-ChxxpkWc.js";
3
+ import { _ as f, l as _, c as $, x as se, y as ie, a as re, b as ae, g as ne, s as oe, o as le, p as ce, ac as he, k as j, q as ue, d as bt, a8 as de } from "./mermaid-GHXKKRXX-C2L7fCIM.js";
4
+ import { f as fe } from "./chunk-2GRJ4B5K-DMTs6j_c.js";
4
5
  globalThis.process = globalThis.process || { env: {} };
5
6
  globalThis.global = globalThis.global || globalThis;
6
- var Dt = (function() {
7
- var t = /* @__PURE__ */ f(function(Y, a, c, r) {
8
- for (c = c || {}, r = Y.length; r--; c[Y[r]] = a) ;
9
- return c;
10
- }, "o"), e = [1, 2], l = [1, 3], s = [1, 4], u = [2, 4], d = [1, 9], S = [1, 11], g = [1, 16], n = [1, 17], T = [1, 18], m = [1, 19], N = [1, 33], A = [1, 20], k = [1, 21], h = [1, 22], x = [1, 23], D = [1, 24], $ = [1, 26], L = [1, 27], P = [1, 28], I = [1, 29], J = [1, 30], st = [1, 31], it = [1, 32], rt = [1, 35], at = [1, 36], nt = [1, 37], ot = [1, 38], j = [1, 34], p = [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], lt = [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], At = [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], yt = {
7
+ var vt = (function() {
8
+ var t = /* @__PURE__ */ f(function(V, a, d, r) {
9
+ for (d = d || {}, r = V.length; r--; d[V[r]] = a) ;
10
+ return d;
11
+ }, "o"), e = [1, 2], o = [1, 3], s = [1, 4], c = [2, 4], h = [1, 9], p = [1, 11], y = [1, 16], n = [1, 17], T = [1, 18], m = [1, 19], O = [1, 33], x = [1, 20], k = [1, 21], u = [1, 22], L = [1, 23], I = [1, 24], v = [1, 26], F = [1, 27], C = [1, 28], P = [1, 29], w = [1, 30], H = [1, 31], it = [1, 32], rt = [1, 35], at = [1, 36], nt = [1, 37], ot = [1, 38], z = [1, 34], S = [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], lt = [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], xt = [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], yt = {
11
12
  trace: /* @__PURE__ */ f(function() {
12
13
  }, "trace"),
13
14
  yy: {},
14
15
  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 },
15
16
  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" },
16
17
  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]],
17
- performAction: /* @__PURE__ */ f(function(a, c, r, y, E, i, F) {
18
- var o = i.length - 1;
18
+ performAction: /* @__PURE__ */ f(function(a, d, r, g, E, i, B) {
19
+ var l = i.length - 1;
19
20
  switch (E) {
20
21
  case 3:
21
- return y.setRootDoc(i[o]), i[o];
22
+ return g.setRootDoc(i[l]), i[l];
22
23
  case 4:
23
24
  this.$ = [];
24
25
  break;
25
26
  case 5:
26
- i[o] != "nl" && (i[o - 1].push(i[o]), this.$ = i[o - 1]);
27
+ i[l] != "nl" && (i[l - 1].push(i[l]), this.$ = i[l - 1]);
27
28
  break;
28
29
  case 6:
29
30
  case 7:
30
- this.$ = i[o];
31
+ this.$ = i[l];
31
32
  break;
32
33
  case 8:
33
34
  this.$ = "nl";
34
35
  break;
35
36
  case 12:
36
- this.$ = i[o];
37
+ this.$ = i[l];
37
38
  break;
38
39
  case 13:
39
- const q = i[o - 1];
40
- q.description = y.trimColon(i[o]), this.$ = q;
40
+ const Q = i[l - 1];
41
+ Q.description = g.trimColon(i[l]), this.$ = Q;
41
42
  break;
42
43
  case 14:
43
- this.$ = { stmt: "relation", state1: i[o - 2], state2: i[o] };
44
+ this.$ = { stmt: "relation", state1: i[l - 2], state2: i[l] };
44
45
  break;
45
46
  case 15:
46
- const gt = y.trimColon(i[o]);
47
- this.$ = { stmt: "relation", state1: i[o - 3], state2: i[o - 1], description: gt };
47
+ const gt = g.trimColon(i[l]);
48
+ this.$ = { stmt: "relation", state1: i[l - 3], state2: i[l - 1], description: gt };
48
49
  break;
49
50
  case 19:
50
- this.$ = { stmt: "state", id: i[o - 3], type: "default", description: "", doc: i[o - 1] };
51
+ this.$ = { stmt: "state", id: i[l - 3], type: "default", description: "", doc: i[l - 1] };
51
52
  break;
52
53
  case 20:
53
- var B = i[o], H = i[o - 2].trim();
54
- if (i[o].match(":")) {
55
- var ht = i[o].split(":");
56
- B = ht[0], H = [H, ht[1]];
54
+ var Y = i[l], K = i[l - 2].trim();
55
+ if (i[l].match(":")) {
56
+ var ht = i[l].split(":");
57
+ Y = ht[0], K = [K, ht[1]];
57
58
  }
58
- this.$ = { stmt: "state", id: B, type: "default", description: H };
59
+ this.$ = { stmt: "state", id: Y, type: "default", description: K };
59
60
  break;
60
61
  case 21:
61
- this.$ = { stmt: "state", id: i[o - 3], type: "default", description: i[o - 5], doc: i[o - 1] };
62
+ this.$ = { stmt: "state", id: i[l - 3], type: "default", description: i[l - 5], doc: i[l - 1] };
62
63
  break;
63
64
  case 22:
64
- this.$ = { stmt: "state", id: i[o], type: "fork" };
65
+ this.$ = { stmt: "state", id: i[l], type: "fork" };
65
66
  break;
66
67
  case 23:
67
- this.$ = { stmt: "state", id: i[o], type: "join" };
68
+ this.$ = { stmt: "state", id: i[l], type: "join" };
68
69
  break;
69
70
  case 24:
70
- this.$ = { stmt: "state", id: i[o], type: "choice" };
71
+ this.$ = { stmt: "state", id: i[l], type: "choice" };
71
72
  break;
72
73
  case 25:
73
- this.$ = { stmt: "state", id: y.getDividerId(), type: "divider" };
74
+ this.$ = { stmt: "state", id: g.getDividerId(), type: "divider" };
74
75
  break;
75
76
  case 26:
76
- this.$ = { stmt: "state", id: i[o - 1].trim(), note: { position: i[o - 2].trim(), text: i[o].trim() } };
77
+ this.$ = { stmt: "state", id: i[l - 1].trim(), note: { position: i[l - 2].trim(), text: i[l].trim() } };
77
78
  break;
78
79
  case 29:
79
- this.$ = i[o].trim(), y.setAccTitle(this.$);
80
+ this.$ = i[l].trim(), g.setAccTitle(this.$);
80
81
  break;
81
82
  case 30:
82
83
  case 31:
83
- this.$ = i[o].trim(), y.setAccDescription(this.$);
84
+ this.$ = i[l].trim(), g.setAccDescription(this.$);
84
85
  break;
85
86
  case 32:
86
87
  this.$ = {
87
88
  stmt: "click",
88
- id: i[o - 3],
89
- url: i[o - 2],
90
- tooltip: i[o - 1]
89
+ id: i[l - 3],
90
+ url: i[l - 2],
91
+ tooltip: i[l - 1]
91
92
  };
92
93
  break;
93
94
  case 33:
94
95
  this.$ = {
95
96
  stmt: "click",
96
- id: i[o - 3],
97
- url: i[o - 1],
97
+ id: i[l - 3],
98
+ url: i[l - 1],
98
99
  tooltip: ""
99
100
  };
100
101
  break;
101
102
  case 34:
102
103
  case 35:
103
- this.$ = { stmt: "classDef", id: i[o - 1].trim(), classes: i[o].trim() };
104
+ this.$ = { stmt: "classDef", id: i[l - 1].trim(), classes: i[l].trim() };
104
105
  break;
105
106
  case 36:
106
- this.$ = { stmt: "style", id: i[o - 1].trim(), styleClass: i[o].trim() };
107
+ this.$ = { stmt: "style", id: i[l - 1].trim(), styleClass: i[l].trim() };
107
108
  break;
108
109
  case 37:
109
- this.$ = { stmt: "applyClass", id: i[o - 1].trim(), styleClass: i[o].trim() };
110
+ this.$ = { stmt: "applyClass", id: i[l - 1].trim(), styleClass: i[l].trim() };
110
111
  break;
111
112
  case 38:
112
- y.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
113
+ g.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
113
114
  break;
114
115
  case 39:
115
- y.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
116
+ g.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
116
117
  break;
117
118
  case 40:
118
- y.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
119
+ g.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
119
120
  break;
120
121
  case 41:
121
- y.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
122
+ g.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
122
123
  break;
123
124
  case 44:
124
125
  case 45:
125
- this.$ = { stmt: "state", id: i[o].trim(), type: "default", description: "" };
126
+ this.$ = { stmt: "state", id: i[l].trim(), type: "default", description: "" };
126
127
  break;
127
128
  case 46:
128
- this.$ = { stmt: "state", id: i[o - 2].trim(), classes: [i[o].trim()], type: "default", description: "" };
129
+ this.$ = { stmt: "state", id: i[l - 2].trim(), classes: [i[l].trim()], type: "default", description: "" };
129
130
  break;
130
131
  case 47:
131
- this.$ = { stmt: "state", id: i[o - 2].trim(), classes: [i[o].trim()], type: "default", description: "" };
132
+ this.$ = { stmt: "state", id: i[l - 2].trim(), classes: [i[l].trim()], type: "default", description: "" };
132
133
  break;
133
134
  }
134
135
  }, "anonymous"),
135
- table: [{ 3: 1, 4: e, 5: l, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: l, 6: s }, { 3: 6, 4: e, 5: l, 6: s }, 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: d, 5: S, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: n, 19: T, 22: m, 24: N, 25: A, 26: k, 27: h, 28: x, 29: D, 32: 25, 33: $, 35: L, 37: P, 38: I, 41: J, 45: st, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: j }, t(p, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: n, 19: T, 22: m, 24: N, 25: A, 26: k, 27: h, 28: x, 29: D, 32: 25, 33: $, 35: L, 37: P, 38: I, 41: J, 45: st, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: j }, t(p, [2, 7]), t(p, [2, 8]), t(p, [2, 9]), t(p, [2, 10]), t(p, [2, 11]), t(p, [2, 12], { 14: [1, 40], 15: [1, 41] }), t(p, [2, 16]), { 18: [1, 42] }, t(p, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, t(p, [2, 22]), t(p, [2, 23]), t(p, [2, 24]), t(p, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, t(p, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, t(p, [2, 31]), { 13: 51, 24: N, 57: j }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, t(lt, [2, 44], { 58: [1, 56] }), t(lt, [2, 45], { 58: [1, 57] }), t(p, [2, 38]), t(p, [2, 39]), t(p, [2, 40]), t(p, [2, 41]), t(p, [2, 6]), t(p, [2, 13]), { 13: 58, 24: N, 57: j }, t(p, [2, 17]), t(At, u, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, t(p, [2, 29]), t(p, [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(p, [2, 14], { 14: [1, 71] }), { 4: d, 5: S, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: n, 19: T, 21: [1, 72], 22: m, 24: N, 25: A, 26: k, 27: h, 28: x, 29: D, 32: 25, 33: $, 35: L, 37: P, 38: I, 41: J, 45: st, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: j }, t(p, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, t(p, [2, 34]), t(p, [2, 35]), t(p, [2, 36]), t(p, [2, 37]), t(lt, [2, 46]), t(lt, [2, 47]), t(p, [2, 15]), t(p, [2, 19]), t(At, u, { 7: 78 }), t(p, [2, 26]), t(p, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: d, 5: S, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: n, 19: T, 21: [1, 81], 22: m, 24: N, 25: A, 26: k, 27: h, 28: x, 29: D, 32: 25, 33: $, 35: L, 37: P, 38: I, 41: J, 45: st, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: j }, t(p, [2, 32]), t(p, [2, 33]), t(p, [2, 21])],
136
+ table: [{ 3: 1, 4: e, 5: o, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: o, 6: s }, { 3: 6, 4: e, 5: o, 6: s }, 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], c, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: y, 17: n, 19: T, 22: m, 24: O, 25: x, 26: k, 27: u, 28: L, 29: I, 32: 25, 33: v, 35: F, 37: C, 38: P, 41: w, 45: H, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: z }, t(S, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: y, 17: n, 19: T, 22: m, 24: O, 25: x, 26: k, 27: u, 28: L, 29: I, 32: 25, 33: v, 35: F, 37: C, 38: P, 41: w, 45: H, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: z }, t(S, [2, 7]), t(S, [2, 8]), t(S, [2, 9]), t(S, [2, 10]), t(S, [2, 11]), t(S, [2, 12], { 14: [1, 40], 15: [1, 41] }), t(S, [2, 16]), { 18: [1, 42] }, t(S, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, t(S, [2, 22]), t(S, [2, 23]), t(S, [2, 24]), t(S, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, t(S, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, t(S, [2, 31]), { 13: 51, 24: O, 57: z }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, t(lt, [2, 44], { 58: [1, 56] }), t(lt, [2, 45], { 58: [1, 57] }), t(S, [2, 38]), t(S, [2, 39]), t(S, [2, 40]), t(S, [2, 41]), t(S, [2, 6]), t(S, [2, 13]), { 13: 58, 24: O, 57: z }, t(S, [2, 17]), t(xt, c, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, t(S, [2, 29]), t(S, [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(S, [2, 14], { 14: [1, 71] }), { 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: y, 17: n, 19: T, 21: [1, 72], 22: m, 24: O, 25: x, 26: k, 27: u, 28: L, 29: I, 32: 25, 33: v, 35: F, 37: C, 38: P, 41: w, 45: H, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: z }, t(S, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, t(S, [2, 34]), t(S, [2, 35]), t(S, [2, 36]), t(S, [2, 37]), t(lt, [2, 46]), t(lt, [2, 47]), t(S, [2, 15]), t(S, [2, 19]), t(xt, c, { 7: 78 }), t(S, [2, 26]), t(S, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: y, 17: n, 19: T, 21: [1, 81], 22: m, 24: O, 25: x, 26: k, 27: u, 28: L, 29: I, 32: 25, 33: v, 35: F, 37: C, 38: P, 41: w, 45: H, 48: it, 51: rt, 52: at, 53: nt, 54: ot, 57: z }, t(S, [2, 32]), t(S, [2, 33]), t(S, [2, 21])],
136
137
  defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] },
137
- parseError: /* @__PURE__ */ f(function(a, c) {
138
- if (c.recoverable)
138
+ parseError: /* @__PURE__ */ f(function(a, d) {
139
+ if (d.recoverable)
139
140
  this.trace(a);
140
141
  else {
141
142
  var r = new Error(a);
142
- throw r.hash = c, r;
143
+ throw r.hash = d, r;
143
144
  }
144
145
  }, "parseError"),
145
146
  parse: /* @__PURE__ */ f(function(a) {
146
- var c = this, r = [0], y = [], E = [null], i = [], F = this.table, o = "", B = 0, H = 0, ht = 2, q = 1, gt = i.slice.call(arguments, 1), b = Object.create(this.lexer), M = { yy: {} };
147
+ var d = this, r = [0], g = [], E = [null], i = [], B = this.table, l = "", Y = 0, K = 0, ht = 2, Q = 1, gt = i.slice.call(arguments, 1), b = Object.create(this.lexer), U = { yy: {} };
147
148
  for (var Tt in this.yy)
148
- Object.prototype.hasOwnProperty.call(this.yy, Tt) && (M.yy[Tt] = this.yy[Tt]);
149
- b.setInput(a, M.yy), M.yy.lexer = b, M.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
149
+ Object.prototype.hasOwnProperty.call(this.yy, Tt) && (U.yy[Tt] = this.yy[Tt]);
150
+ b.setInput(a, U.yy), U.yy.lexer = b, U.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
150
151
  var Et = b.yylloc;
151
152
  i.push(Et);
152
- var qt = b.options && b.options.ranges;
153
- typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
154
- function Qt(O) {
155
- r.length = r.length - 2 * O, E.length = E.length - O, i.length = i.length - O;
153
+ var Qt = b.options && b.options.ranges;
154
+ typeof U.yy.parseError == "function" ? this.parseError = U.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
155
+ function Zt(N) {
156
+ r.length = r.length - 2 * N, E.length = E.length - N, i.length = i.length - N;
156
157
  }
157
- f(Qt, "popStack");
158
- function xt() {
159
- var O;
160
- return O = y.pop() || b.lex() || q, typeof O != "number" && (O instanceof Array && (y = O, O = y.pop()), O = c.symbols_[O] || O), O;
158
+ f(Zt, "popStack");
159
+ function Lt() {
160
+ var N;
161
+ return N = g.pop() || b.lex() || Q, typeof N != "number" && (N instanceof Array && (g = N, N = g.pop()), N = d.symbols_[N] || N), N;
161
162
  }
162
- f(xt, "lex");
163
- for (var C, U, R, _t, z = {}, ut, G, Lt, dt; ; ) {
164
- if (U = r[r.length - 1], this.defaultActions[U] ? R = this.defaultActions[U] : ((C === null || typeof C > "u") && (C = xt()), R = F[U] && F[U][C]), typeof R > "u" || !R.length || !R[0]) {
163
+ f(Lt, "lex");
164
+ for (var A, W, R, _t, X = {}, ut, G, It, dt; ; ) {
165
+ if (W = r[r.length - 1], this.defaultActions[W] ? R = this.defaultActions[W] : ((A === null || typeof A > "u") && (A = Lt()), R = B[W] && B[W][A]), typeof R > "u" || !R.length || !R[0]) {
165
166
  var mt = "";
166
167
  dt = [];
167
- for (ut in F[U])
168
+ for (ut in B[W])
168
169
  this.terminals_[ut] && ut > ht && dt.push("'" + this.terminals_[ut] + "'");
169
- b.showPosition ? mt = "Parse error on line " + (B + 1) + `:
170
+ b.showPosition ? mt = "Parse error on line " + (Y + 1) + `:
170
171
  ` + b.showPosition() + `
171
- Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt = "Parse error on line " + (B + 1) + ": Unexpected " + (C == q ? "end of input" : "'" + (this.terminals_[C] || C) + "'"), this.parseError(mt, {
172
+ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : mt = "Parse error on line " + (Y + 1) + ": Unexpected " + (A == Q ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(mt, {
172
173
  text: b.match,
173
- token: this.terminals_[C] || C,
174
+ token: this.terminals_[A] || A,
174
175
  line: b.yylineno,
175
176
  loc: Et,
176
177
  expected: dt
177
178
  });
178
179
  }
179
180
  if (R[0] instanceof Array && R.length > 1)
180
- throw new Error("Parse Error: multiple actions possible at state: " + U + ", token: " + C);
181
+ throw new Error("Parse Error: multiple actions possible at state: " + W + ", token: " + A);
181
182
  switch (R[0]) {
182
183
  case 1:
183
- r.push(C), E.push(b.yytext), i.push(b.yylloc), r.push(R[1]), C = null, H = b.yyleng, o = b.yytext, B = b.yylineno, Et = b.yylloc;
184
+ r.push(A), E.push(b.yytext), i.push(b.yylloc), r.push(R[1]), A = null, K = b.yyleng, l = b.yytext, Y = b.yylineno, Et = b.yylloc;
184
185
  break;
185
186
  case 2:
186
- if (G = this.productions_[R[1]][1], z.$ = E[E.length - G], z._$ = {
187
+ if (G = this.productions_[R[1]][1], X.$ = E[E.length - G], X._$ = {
187
188
  first_line: i[i.length - (G || 1)].first_line,
188
189
  last_line: i[i.length - 1].last_line,
189
190
  first_column: i[i.length - (G || 1)].first_column,
190
191
  last_column: i[i.length - 1].last_column
191
- }, qt && (z._$.range = [
192
+ }, Qt && (X._$.range = [
192
193
  i[i.length - (G || 1)].range[0],
193
194
  i[i.length - 1].range[1]
194
- ]), _t = this.performAction.apply(z, [
195
- o,
196
- H,
197
- B,
198
- M.yy,
195
+ ]), _t = this.performAction.apply(X, [
196
+ l,
197
+ K,
198
+ Y,
199
+ U.yy,
199
200
  R[1],
200
201
  E,
201
202
  i
202
203
  ].concat(gt)), typeof _t < "u")
203
204
  return _t;
204
- G && (r = r.slice(0, -1 * G * 2), E = E.slice(0, -1 * G), i = i.slice(0, -1 * G)), r.push(this.productions_[R[1]][0]), E.push(z.$), i.push(z._$), Lt = F[r[r.length - 2]][r[r.length - 1]], r.push(Lt);
205
+ G && (r = r.slice(0, -1 * G * 2), E = E.slice(0, -1 * G), i = i.slice(0, -1 * G)), r.push(this.productions_[R[1]][0]), E.push(X.$), i.push(X._$), It = B[r[r.length - 2]][r[r.length - 1]], r.push(It);
205
206
  break;
206
207
  case 3:
207
208
  return !0;
@@ -209,18 +210,18 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
209
210
  }
210
211
  return !0;
211
212
  }, "parse")
212
- }, Jt = /* @__PURE__ */ (function() {
213
- var Y = {
213
+ }, qt = /* @__PURE__ */ (function() {
214
+ var V = {
214
215
  EOF: 1,
215
- parseError: /* @__PURE__ */ f(function(c, r) {
216
+ parseError: /* @__PURE__ */ f(function(d, r) {
216
217
  if (this.yy.parser)
217
- this.yy.parser.parseError(c, r);
218
+ this.yy.parser.parseError(d, r);
218
219
  else
219
- throw new Error(c);
220
+ throw new Error(d);
220
221
  }, "parseError"),
221
222
  // resets the lexer, sets new input
222
- setInput: /* @__PURE__ */ f(function(a, c) {
223
- return this.yy = c || this.yy || {}, this._input = a, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
223
+ setInput: /* @__PURE__ */ f(function(a, d) {
224
+ return this.yy = d || this.yy || {}, this._input = a, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
224
225
  first_line: 1,
225
226
  first_column: 0,
226
227
  last_line: 1,
@@ -231,22 +232,22 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
231
232
  input: /* @__PURE__ */ f(function() {
232
233
  var a = this._input[0];
233
234
  this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a;
234
- var c = a.match(/(?:\r\n?|\n).*/g);
235
- return c ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a;
235
+ var d = a.match(/(?:\r\n?|\n).*/g);
236
+ return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a;
236
237
  }, "input"),
237
238
  // unshifts one char (or a string) into the input
238
239
  unput: /* @__PURE__ */ f(function(a) {
239
- var c = a.length, r = a.split(/(?:\r\n?|\n)/g);
240
- this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
241
- var y = this.match.split(/(?:\r\n?|\n)/g);
240
+ var d = a.length, r = a.split(/(?:\r\n?|\n)/g);
241
+ this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d;
242
+ var g = this.match.split(/(?:\r\n?|\n)/g);
242
243
  this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1);
243
244
  var E = this.yylloc.range;
244
245
  return this.yylloc = {
245
246
  first_line: this.yylloc.first_line,
246
247
  last_line: this.yylineno + 1,
247
248
  first_column: this.yylloc.first_column,
248
- last_column: r ? (r.length === y.length ? this.yylloc.first_column : 0) + y[y.length - r.length].length - r[0].length : this.yylloc.first_column - c
249
- }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
249
+ last_column: r ? (r.length === g.length ? this.yylloc.first_column : 0) + g[g.length - r.length].length - r[0].length : this.yylloc.first_column - d
250
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this;
250
251
  }, "unput"),
251
252
  // When called from action, caches matched text and appends it on next action
252
253
  more: /* @__PURE__ */ f(function() {
@@ -281,13 +282,13 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
281
282
  }, "upcomingInput"),
282
283
  // displays the character position where the lexing error occurred, i.e. for error messages
283
284
  showPosition: /* @__PURE__ */ f(function() {
284
- var a = this.pastInput(), c = new Array(a.length + 1).join("-");
285
+ var a = this.pastInput(), d = new Array(a.length + 1).join("-");
285
286
  return a + this.upcomingInput() + `
286
- ` + c + "^";
287
+ ` + d + "^";
287
288
  }, "showPosition"),
288
289
  // test the lexed token: return FALSE when not a match, otherwise return token
289
- test_match: /* @__PURE__ */ f(function(a, c) {
290
- var r, y, E;
290
+ test_match: /* @__PURE__ */ f(function(a, d) {
291
+ var r, g, E;
291
292
  if (this.options.backtrack_lexer && (E = {
292
293
  yylineno: this.yylineno,
293
294
  yylloc: {
@@ -307,12 +308,12 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
307
308
  yy: this.yy,
308
309
  conditionStack: this.conditionStack.slice(0),
309
310
  done: this.done
310
- }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), y = a[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
311
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), g = a[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = {
311
312
  first_line: this.yylloc.last_line,
312
313
  last_line: this.yylineno + 1,
313
314
  first_column: this.yylloc.last_column,
314
- last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + a[0].length
315
- }, this.yytext += a[0], this.match += a[0], this.matches = a, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(a[0].length), this.matched += a[0], r = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), r)
315
+ last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + a[0].length
316
+ }, this.yytext += a[0], this.match += a[0], this.matches = a, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(a[0].length), this.matched += a[0], r = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), r)
316
317
  return r;
317
318
  if (this._backtrack) {
318
319
  for (var i in E)
@@ -326,22 +327,22 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
326
327
  if (this.done)
327
328
  return this.EOF;
328
329
  this._input || (this.done = !0);
329
- var a, c, r, y;
330
+ var a, d, r, g;
330
331
  this._more || (this.yytext = "", this.match = "");
331
332
  for (var E = this._currentRules(), i = 0; i < E.length; i++)
332
- if (r = this._input.match(this.rules[E[i]]), r && (!c || r[0].length > c[0].length)) {
333
- if (c = r, y = i, this.options.backtrack_lexer) {
333
+ if (r = this._input.match(this.rules[E[i]]), r && (!d || r[0].length > d[0].length)) {
334
+ if (d = r, g = i, this.options.backtrack_lexer) {
334
335
  if (a = this.test_match(r, E[i]), a !== !1)
335
336
  return a;
336
337
  if (this._backtrack) {
337
- c = !1;
338
+ d = !1;
338
339
  continue;
339
340
  } else
340
341
  return !1;
341
342
  } else if (!this.options.flex)
342
343
  break;
343
344
  }
344
- return c ? (a = this.test_match(c, E[y]), a !== !1 ? a : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
345
+ return d ? (a = this.test_match(d, E[g]), a !== !1 ? a : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
345
346
  ` + this.showPosition(), {
346
347
  text: "",
347
348
  token: null,
@@ -350,47 +351,47 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
350
351
  }, "next"),
351
352
  // return next match that has a token
352
353
  lex: /* @__PURE__ */ f(function() {
353
- var c = this.next();
354
- return c || this.lex();
354
+ var d = this.next();
355
+ return d || this.lex();
355
356
  }, "lex"),
356
357
  // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
357
- begin: /* @__PURE__ */ f(function(c) {
358
- this.conditionStack.push(c);
358
+ begin: /* @__PURE__ */ f(function(d) {
359
+ this.conditionStack.push(d);
359
360
  }, "begin"),
360
361
  // pop the previously active lexer condition state off the condition stack
361
362
  popState: /* @__PURE__ */ f(function() {
362
- var c = this.conditionStack.length - 1;
363
- return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
363
+ var d = this.conditionStack.length - 1;
364
+ return d > 0 ? this.conditionStack.pop() : this.conditionStack[0];
364
365
  }, "popState"),
365
366
  // produce the lexer rule set which is active for the currently active lexer condition state
366
367
  _currentRules: /* @__PURE__ */ f(function() {
367
368
  return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
368
369
  }, "_currentRules"),
369
370
  // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
370
- topState: /* @__PURE__ */ f(function(c) {
371
- return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
371
+ topState: /* @__PURE__ */ f(function(d) {
372
+ return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL";
372
373
  }, "topState"),
373
374
  // alias for begin(condition)
374
- pushState: /* @__PURE__ */ f(function(c) {
375
- this.begin(c);
375
+ pushState: /* @__PURE__ */ f(function(d) {
376
+ this.begin(d);
376
377
  }, "pushState"),
377
378
  // return the number of states currently on the stack
378
379
  stateStackSize: /* @__PURE__ */ f(function() {
379
380
  return this.conditionStack.length;
380
381
  }, "stateStackSize"),
381
382
  options: { "case-insensitive": !0 },
382
- performAction: /* @__PURE__ */ f(function(c, r, y, E) {
383
+ performAction: /* @__PURE__ */ f(function(d, r, g, E) {
383
384
  function i() {
384
- const F = r.yytext.indexOf("%%");
385
- if (F === 0)
385
+ const B = r.yytext.indexOf("%%");
386
+ if (B === 0)
386
387
  return !1;
387
- if (F > 0) {
388
- const o = r.yytext.slice(0, F), B = r.yytext.slice(F);
389
- B && c.lexer.unput(B), r.yytext = o;
388
+ if (B > 0) {
389
+ const l = r.yytext.slice(0, B), Y = r.yytext.slice(B);
390
+ Y && d.lexer.unput(Y), r.yytext = l;
390
391
  }
391
392
  return !0;
392
393
  }
393
- switch (f(i, "processId"), y) {
394
+ switch (f(i, "processId"), g) {
394
395
  case 0:
395
396
  return 38;
396
397
  case 1:
@@ -503,301 +504,304 @@ Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : mt =
503
504
  case 51:
504
505
  return "STATE_DESCR";
505
506
  case 52:
506
- return 19;
507
+ throw new Error('Error: State name must be a single word. Found: "' + r.yytext.trim() + '"');
507
508
  case 53:
509
+ return 19;
510
+ case 54:
508
511
  this.popState();
509
512
  break;
510
- case 54:
511
- return this.popState(), this.pushState("struct"), 20;
512
513
  case 55:
513
- return this.popState(), 21;
514
+ return this.popState(), this.pushState("struct"), 20;
514
515
  case 56:
515
- break;
516
+ return this.popState(), 21;
516
517
  case 57:
517
- return this.begin("NOTE"), 29;
518
+ break;
518
519
  case 58:
519
- return this.popState(), this.pushState("NOTE_ID"), 59;
520
+ return this.begin("NOTE"), 29;
520
521
  case 59:
521
- return this.popState(), this.pushState("NOTE_ID"), 60;
522
+ return this.popState(), this.pushState("NOTE_ID"), 59;
522
523
  case 60:
524
+ return this.popState(), this.pushState("NOTE_ID"), 60;
525
+ case 61:
523
526
  this.popState(), this.pushState("FLOATING_NOTE");
524
527
  break;
525
- case 61:
526
- return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
527
528
  case 62:
528
- break;
529
+ return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
529
530
  case 63:
530
- return "NOTE_TEXT";
531
+ break;
531
532
  case 64:
532
- return i() ? (this.popState(), "ID") : void 0;
533
+ return "NOTE_TEXT";
533
534
  case 65:
534
- return i() ? (this.popState(), this.pushState("NOTE_TEXT"), 24) : void 0;
535
+ return i() ? (this.popState(), "ID") : void 0;
535
536
  case 66:
536
- return this.popState(), r.yytext = r.yytext.substr(2).trim(), 31;
537
+ return i() ? (this.popState(), this.pushState("NOTE_TEXT"), 24) : void 0;
537
538
  case 67:
538
- return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 31;
539
+ return this.popState(), r.yytext = r.yytext.substr(2).trim(), 31;
539
540
  case 68:
540
- return 6;
541
+ return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 31;
541
542
  case 69:
542
543
  return 6;
543
544
  case 70:
544
- return 16;
545
+ return 6;
545
546
  case 71:
546
- return 57;
547
+ return 16;
547
548
  case 72:
548
- return i() ? 24 : void 0;
549
+ return 57;
549
550
  case 73:
550
- return r.yytext = r.yytext.trim(), 14;
551
+ return i() ? 24 : void 0;
551
552
  case 74:
552
- return 15;
553
+ return r.yytext = r.yytext.trim(), 14;
553
554
  case 75:
554
- return 28;
555
+ return 15;
555
556
  case 76:
556
- return 58;
557
+ return 28;
557
558
  case 77:
558
- return 5;
559
+ return 58;
559
560
  case 78:
561
+ return 5;
562
+ case 79:
560
563
  return "INVALID";
561
564
  }
562
565
  }, "anonymous"),
563
- 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, /^(?:[^\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],
564
- conditions: { LINE: { rules: [10, 11, 12], inclusive: !1 }, struct: { rules: [10, 11, 12, 23, 27, 30, 36, 43, 44, 45, 46, 55, 56, 57, 71, 72, 73, 74, 75, 76], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [64], inclusive: !1 }, FLOATING_NOTE: { rules: [61, 62, 63], inclusive: !1 }, NOTE_TEXT: { rules: [66, 67], inclusive: !1 }, NOTE_ID: { rules: [65], inclusive: !1 }, NOTE: { rules: [58, 59, 60], 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], 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, 54, 57, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78], inclusive: !0 } }
566
+ 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],
567
+ 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 } }
565
568
  };
566
- return Y;
569
+ return V;
567
570
  })();
568
- yt.lexer = Jt;
571
+ yt.lexer = qt;
569
572
  function ct() {
570
573
  this.yy = {};
571
574
  }
572
575
  return f(ct, "Parser"), ct.prototype = yt, yt.Parser = ct, new ct();
573
576
  })();
574
- Dt.parser = Dt;
575
- var Ge = Dt, ue = "TB", Ft = "TB", It = "dir", X = "state", K = "root", vt = "relation", de = "classDef", fe = "style", pe = "applyClass", tt = "default", Bt = "divider", Gt = "fill:none", Yt = "fill: #333", Vt = "c", Mt = "markdown", Ut = "normal", bt = "rect", kt = "rectWithTitle", Se = "stateStart", ye = "stateEnd", Ot = "divider", Nt = "roundedWithTitle", ge = "note", Te = "noteGroup", et = "statediagram", Ee = "state", _e = `${et}-${Ee}`, Wt = "transition", me = "note", be = "note-edge", ke = `${Wt} ${be}`, De = `${et}-${me}`, ve = "cluster", Ce = `${et}-${ve}`, Ae = "cluster-alt", xe = `${et}-${Ae}`, jt = "parent", Ht = "note", Le = "state", Ct = "----", Ie = `${Ct}${Ht}`, Rt = `${Ct}${jt}`, zt = /* @__PURE__ */ f((t, e = Ft) => {
577
+ vt.parser = vt;
578
+ var Ue = vt, pe = "TB", Bt = "TB", wt = "dir", q = "state", J = "root", Ct = "relation", Se = "classDef", ye = "style", ge = "applyClass", et = "default", Yt = "divider", Gt = "fill:none", Vt = "fill: #333", Mt = "c", Ut = "markdown", Wt = "normal", kt = "rect", Dt = "rectWithTitle", Te = "stateStart", Ee = "stateEnd", Nt = "divider", Ot = "roundedWithTitle", _e = "note", me = "noteGroup", st = "statediagram", be = "state", ke = `${st}-${be}`, jt = "transition", De = "note", ve = "note-edge", Ce = `${jt} ${ve}`, Ae = `${st}-${De}`, xe = "cluster", Le = `${st}-${xe}`, Ie = "cluster-alt", we = `${st}-${Ie}`, Ht = "parent", zt = "note", Ne = "state", At = "----", Oe = `${At}${zt}`, Rt = `${At}${Ht}`, Kt = /* @__PURE__ */ f((t, e = Bt) => {
576
579
  if (!t.doc)
577
580
  return e;
578
- let l = e;
581
+ let o = e;
579
582
  for (const s of t.doc)
580
- s.stmt === "dir" && (l = s.value);
581
- return l;
582
- }, "getDir"), Oe = /* @__PURE__ */ f(function(t, e) {
583
+ s.stmt === "dir" && (o = s.value);
584
+ return o;
585
+ }, "getDir"), Re = /* @__PURE__ */ f(function(t, e) {
583
586
  return e.db.getClasses();
584
- }, "getClasses"), Ne = /* @__PURE__ */ f(async function(t, e, l, s) {
587
+ }, "getClasses"), $e = /* @__PURE__ */ f(async function(t, e, o, s) {
585
588
  _.info("REF0:"), _.info("Drawing state diagram (v2)", e);
586
- const { securityLevel: u, state: d, layout: S } = w();
589
+ const { securityLevel: c, state: h, layout: p } = $();
587
590
  s.db.extract(s.db.getRootDocV2());
588
- const g = s.db.getData(), n = Zt(e, u);
589
- g.type = s.type, g.layoutAlgorithm = S, g.nodeSpacing = d?.nodeSpacing || 50, g.rankSpacing = d?.rankSpacing || 50, w().look === "neo" ? g.markers = ["barbNeo"] : g.markers = ["barb"], g.diagramId = e, await ee(g, n);
591
+ const y = s.db.getData(), n = te(e, c);
592
+ y.type = s.type, y.layoutAlgorithm = p, y.nodeSpacing = h?.nodeSpacing || 50, y.rankSpacing = h?.rankSpacing || 50, $().look === "neo" ? y.markers = ["barbNeo"] : y.markers = ["barb"], y.diagramId = e, await se(y, n);
590
593
  const m = 8;
591
594
  try {
592
- (typeof s.db.getLinks == "function" ? s.db.getLinks() : /* @__PURE__ */ new Map()).forEach((A, k) => {
593
- const h = typeof k == "string" ? k : typeof k?.id == "string" ? k.id : "";
594
- if (!h) {
595
+ (typeof s.db.getLinks == "function" ? s.db.getLinks() : /* @__PURE__ */ new Map()).forEach((x, k) => {
596
+ const u = typeof k == "string" ? k : typeof k?.id == "string" ? k.id : "", L = y.nodes.find((w) => w.id === u);
597
+ if (!u) {
595
598
  _.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(k));
596
599
  return;
597
600
  }
598
- const x = n.node()?.querySelectorAll("g");
599
- let D;
600
- if (x?.forEach((I) => {
601
- I.textContent?.trim() === h && (D = I);
602
- }), !D) {
603
- _.warn("⚠️ Could not find node matching text:", h);
601
+ const I = n.node()?.querySelectorAll("g.node, g.rough-node");
602
+ let v;
603
+ if (I?.forEach((w) => {
604
+ const H = w.textContent?.trim();
605
+ (w.id === L?.domId || H === u) && (v = w);
606
+ }), !v) {
607
+ _.warn("⚠️ Could not find node matching text:", u);
604
608
  return;
605
609
  }
606
- const $ = D.parentNode;
607
- if (!$) {
608
- _.warn("⚠️ Node has no parent, cannot wrap:", h);
610
+ const F = v.parentNode;
611
+ if (!F) {
612
+ _.warn("⚠️ Node has no parent, cannot wrap:", u);
609
613
  return;
610
614
  }
611
- const L = document.createElementNS("http://www.w3.org/2000/svg", "a"), P = A.url.replace(/^"+|"+$/g, "");
612
- if (L.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", P), L.setAttribute("target", "_blank"), A.tooltip) {
613
- const I = A.tooltip.replace(/^"+|"+$/g, "");
614
- L.setAttribute("title", I);
615
+ const C = document.createElementNS("http://www.w3.org/2000/svg", "a"), P = x.url.replace(/^"+|"+$/g, "");
616
+ if (C.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", P), C.setAttribute("target", "_blank"), x.tooltip) {
617
+ const w = x.tooltip.replace(/^"+|"+$/g, "");
618
+ C.setAttribute("title", w), v.setAttribute("title", w);
615
619
  }
616
- $.replaceChild(L, D), L.appendChild(D), _.info("🔗 Wrapped node in <a> tag for:", h, A.url);
620
+ F.replaceChild(C, v), C.appendChild(v), _.info("🔗 Wrapped node in <a> tag for:", u, x.url);
617
621
  });
618
- } catch (N) {
619
- _.error("❌ Error injecting clickable links:", N);
622
+ } catch (O) {
623
+ _.error("❌ Error injecting clickable links:", O);
620
624
  }
621
- se.insertTitle(
625
+ ie.insertTitle(
622
626
  n,
623
627
  "statediagramTitleText",
624
- d?.titleTopMargin ?? 25,
628
+ h?.titleTopMargin ?? 25,
625
629
  s.db.getDiagramTitle()
626
- ), te(n, m, et, d?.useMaxWidth ?? !0);
627
- }, "draw"), Ye = {
628
- getClasses: Oe,
629
- draw: Ne,
630
- getDir: zt
631
- }, pt = /* @__PURE__ */ new Map(), V = 0;
632
- function St(t = "", e = 0, l = "", s = Ct) {
633
- const u = l !== null && l.length > 0 ? `${s}${l}` : "";
634
- return `${Le}-${t}${u}-${e}`;
630
+ ), ee(n, m, st, h?.useMaxWidth ?? !0);
631
+ }, "draw"), We = {
632
+ getClasses: Re,
633
+ draw: $e,
634
+ getDir: Kt
635
+ }, pt = /* @__PURE__ */ new Map(), M = 0;
636
+ function St(t = "", e = 0, o = "", s = At) {
637
+ const c = o !== null && o.length > 0 ? `${s}${o}` : "";
638
+ return `${Ne}-${t}${c}-${e}`;
635
639
  }
636
640
  f(St, "stateDomId");
637
- var Re = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
641
+ var Fe = /* @__PURE__ */ f((t, e, o, s, c, h, p, y) => {
638
642
  _.trace("items", e), e.forEach((n) => {
639
643
  switch (n.stmt) {
640
- case X:
641
- Z(t, n, l, s, u, d, S, g);
644
+ case q:
645
+ tt(t, n, o, s, c, h, p, y);
642
646
  break;
643
- case tt:
644
- Z(t, n, l, s, u, d, S, g);
647
+ case et:
648
+ tt(t, n, o, s, c, h, p, y);
645
649
  break;
646
- case vt:
650
+ case Ct:
647
651
  {
648
- Z(
652
+ tt(
649
653
  t,
650
654
  n.state1,
651
- l,
655
+ o,
652
656
  s,
653
- u,
654
- d,
655
- S,
656
- g
657
- ), Z(
657
+ c,
658
+ h,
659
+ p,
660
+ y
661
+ ), tt(
658
662
  t,
659
663
  n.state2,
660
- l,
664
+ o,
661
665
  s,
662
- u,
663
- d,
664
- S,
665
- g
666
+ c,
667
+ h,
668
+ p,
669
+ y
666
670
  );
667
- const T = S === "neo", m = {
668
- id: "edge" + V,
671
+ const T = p === "neo", m = {
672
+ id: "edge" + M,
669
673
  start: n.state1.id,
670
674
  end: n.state2.id,
671
675
  arrowhead: "normal",
672
676
  arrowTypeEnd: T ? "arrow_barb_neo" : "arrow_barb",
673
677
  style: Gt,
674
678
  labelStyle: "",
675
- label: W.sanitizeText(n.description ?? "", w()),
676
- arrowheadStyle: Yt,
677
- labelpos: Vt,
678
- labelType: Mt,
679
- thickness: Ut,
680
- classes: Wt,
681
- look: S
679
+ label: j.sanitizeText(n.description ?? "", $()),
680
+ arrowheadStyle: Vt,
681
+ labelpos: Mt,
682
+ labelType: Ut,
683
+ thickness: Wt,
684
+ classes: jt,
685
+ look: p
682
686
  };
683
- u.push(m), V++;
687
+ c.push(m), M++;
684
688
  }
685
689
  break;
686
690
  }
687
691
  });
688
- }, "setupDoc"), wt = /* @__PURE__ */ f((t, e = Ft) => {
689
- let l = e;
692
+ }, "setupDoc"), $t = /* @__PURE__ */ f((t, e = Bt) => {
693
+ let o = e;
690
694
  if (t.doc)
691
695
  for (const s of t.doc)
692
- s.stmt === "dir" && (l = s.value);
693
- return l;
696
+ s.stmt === "dir" && (o = s.value);
697
+ return o;
694
698
  }, "getDir");
695
- function Q(t, e, l) {
699
+ function Z(t, e, o) {
696
700
  if (!e.id || e.id === "</join></fork>" || e.id === "</choice>")
697
701
  return;
698
- e.cssClasses && (Array.isArray(e.cssCompiledStyles) || (e.cssCompiledStyles = []), e.cssClasses.split(" ").forEach((u) => {
699
- const d = l.get(u);
700
- d && (e.cssCompiledStyles = [...e.cssCompiledStyles ?? [], ...d.styles]);
702
+ e.cssClasses && (Array.isArray(e.cssCompiledStyles) || (e.cssCompiledStyles = []), e.cssClasses.split(" ").forEach((c) => {
703
+ const h = o.get(c);
704
+ h && (e.cssCompiledStyles = [...e.cssCompiledStyles ?? [], ...h.styles]);
701
705
  }));
702
- const s = t.find((u) => u.id === e.id);
706
+ const s = t.find((c) => c.id === e.id);
703
707
  s ? Object.assign(s, e) : t.push(e);
704
708
  }
705
- f(Q, "insertOrUpdateNode");
706
- function Kt(t) {
709
+ f(Z, "insertOrUpdateNode");
710
+ function Xt(t) {
707
711
  return t?.classes?.join(" ") ?? "";
708
712
  }
709
- f(Kt, "getClassesFromDbInfo");
710
- function Xt(t) {
713
+ f(Xt, "getClassesFromDbInfo");
714
+ function Jt(t) {
711
715
  return t?.styles ?? [];
712
716
  }
713
- f(Xt, "getStylesFromDbInfo");
714
- var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
715
- const n = e.id, T = l.get(n), m = Kt(T), N = Xt(T), A = w();
716
- if (_.info("dataFetcher parsedItem", e, T, N), n !== "root") {
717
- let k = bt;
718
- e.start === !0 ? k = Se : e.start === !1 && (k = ye), e.type !== tt && (k = e.type), pt.get(n) || pt.set(n, {
717
+ f(Jt, "getStylesFromDbInfo");
718
+ var tt = /* @__PURE__ */ f((t, e, o, s, c, h, p, y) => {
719
+ const n = e.id, T = o.get(n), m = Xt(T), O = Jt(T), x = $();
720
+ if (_.info("dataFetcher parsedItem", e, T, O), n !== "root") {
721
+ let k = kt;
722
+ e.start === !0 ? k = Te : e.start === !1 && (k = Ee), e.type !== et && (k = e.type), pt.get(n) || pt.set(n, {
719
723
  id: n,
720
724
  shape: k,
721
- description: W.sanitizeText(n, A),
722
- cssClasses: `${m} ${_e}`,
723
- cssStyles: N
725
+ description: j.sanitizeText(n, x),
726
+ cssClasses: `${m} ${ke}`,
727
+ cssStyles: O
724
728
  });
725
- const h = pt.get(n);
726
- e.description && (Array.isArray(h.description) ? (h.shape = kt, h.description.push(e.description)) : h.description?.length && h.description.length > 0 ? (h.shape = kt, h.description === n ? h.description = [e.description] : h.description = [h.description, e.description]) : (h.shape = bt, h.description = e.description), h.description = W.sanitizeTextOrArray(h.description, A)), h.description?.length === 1 && h.shape === kt && (h.type === "group" ? h.shape = Nt : h.shape = bt), !h.type && e.doc && (_.info("Setting cluster for XCX", n, wt(e)), h.type = "group", h.isGroup = !0, h.dir = wt(e), h.shape = e.type === Bt ? Ot : Nt, h.cssClasses = `${h.cssClasses} ${Ce} ${d ? xe : ""}`);
727
- const x = {
729
+ const u = pt.get(n);
730
+ e.description && (Array.isArray(u.description) ? (u.shape = Dt, u.description.push(e.description)) : u.description?.length && u.description.length > 0 ? (u.shape = Dt, u.description === n ? u.description = [e.description] : u.description = [u.description, e.description]) : (u.shape = kt, u.description = e.description), u.description = j.sanitizeTextOrArray(u.description, x)), u.description?.length === 1 && u.shape === Dt && (u.type === "group" ? u.shape = Ot : u.shape = kt), !u.type && e.doc && (_.info("Setting cluster for XCX", n, $t(e)), u.type = "group", u.isGroup = !0, u.dir = $t(e), u.explicitDir = e.doc.some((I) => I.stmt === "dir"), u.shape = e.type === Yt ? Nt : Ot, u.cssClasses = `${u.cssClasses} ${Le} ${h ? we : ""}`);
731
+ const L = {
728
732
  labelStyle: "",
729
- shape: h.shape,
730
- label: h.description,
731
- cssClasses: h.cssClasses,
733
+ shape: u.shape,
734
+ label: u.description,
735
+ cssClasses: u.cssClasses,
732
736
  cssCompiledStyles: [],
733
- cssStyles: h.cssStyles,
737
+ cssStyles: u.cssStyles,
734
738
  id: n,
735
- dir: h.dir,
736
- domId: St(n, V),
737
- type: h.type,
738
- isGroup: h.type === "group",
739
+ dir: u.dir,
740
+ domId: St(n, M),
741
+ type: u.type,
742
+ isGroup: u.type === "group",
739
743
  padding: 8,
740
744
  rx: 10,
741
745
  ry: 10,
742
- look: S,
746
+ look: p,
743
747
  labelType: "markdown"
744
748
  };
745
- if (x.shape === Ot && (x.label = ""), t && t.id !== "root" && (_.trace("Setting node ", n, " to be child of its parent ", t.id), x.parentId = t.id), x.centerLabel = !0, e.note) {
746
- const D = {
749
+ if (L.shape === Nt && (L.label = ""), t && t.id !== "root" && (_.trace("Setting node ", n, " to be child of its parent ", t.id), L.parentId = t.id), L.centerLabel = !0, e.note) {
750
+ const I = {
747
751
  labelStyle: "",
748
- shape: ge,
752
+ shape: _e,
749
753
  label: e.note.text,
750
754
  labelType: "markdown",
751
- cssClasses: De,
755
+ cssClasses: Ae,
752
756
  // useHtmlLabels: false,
753
757
  cssStyles: [],
754
758
  cssCompiledStyles: [],
755
- id: n + Ie + "-" + V,
756
- domId: St(n, V, Ht),
757
- type: h.type,
758
- isGroup: h.type === "group",
759
- padding: A.flowchart?.padding,
760
- look: S,
759
+ id: n + Oe + "-" + M,
760
+ domId: St(n, M, zt),
761
+ type: u.type,
762
+ isGroup: u.type === "group",
763
+ padding: x.flowchart?.padding,
764
+ look: p,
761
765
  position: e.note.position
762
- }, $ = n + Rt, L = {
766
+ }, v = n + Rt, F = {
763
767
  labelStyle: "",
764
- shape: Te,
768
+ shape: me,
765
769
  label: e.note.text,
766
- cssClasses: h.cssClasses,
770
+ cssClasses: u.cssClasses,
767
771
  cssStyles: [],
768
772
  id: n + Rt,
769
- domId: St(n, V, jt),
773
+ domId: St(n, M, Ht),
770
774
  type: "group",
771
775
  isGroup: !0,
772
776
  padding: 16,
773
777
  //getConfig().flowchart.padding
774
- look: S,
778
+ look: p,
775
779
  position: e.note.position
776
780
  };
777
- V++, L.id = $, D.parentId = $, Q(s, L, g), Q(s, D, g), Q(s, x, g);
778
- let P = n, I = D.id;
779
- e.note.position === "left of" && (P = D.id, I = n), u.push({
780
- id: P + "-" + I,
781
- start: P,
782
- end: I,
781
+ M++, F.id = v, I.parentId = v, Z(s, F, y), Z(s, I, y), Z(s, L, y);
782
+ let C = n, P = I.id;
783
+ e.note.position === "left of" && (C = I.id, P = n), c.push({
784
+ id: C + "-" + P,
785
+ start: C,
786
+ end: P,
783
787
  arrowhead: "none",
784
788
  arrowTypeEnd: "",
785
789
  style: Gt,
786
790
  labelStyle: "",
787
- classes: ke,
788
- arrowheadStyle: Yt,
789
- labelpos: Vt,
790
- labelType: Mt,
791
- thickness: Ut,
792
- look: S
791
+ classes: Ce,
792
+ arrowheadStyle: Vt,
793
+ labelpos: Mt,
794
+ labelType: Ut,
795
+ thickness: Wt,
796
+ look: p
793
797
  });
794
798
  } else
795
- Q(s, x, g);
799
+ Z(s, L, y);
796
800
  }
797
- e.doc && (_.trace("Adding nodes children "), Re(e, e.doc, l, s, u, !d, S, g));
798
- }, "dataFetcher"), we = /* @__PURE__ */ f(() => {
799
- pt.clear(), V = 0;
800
- }, "reset"), v = {
801
+ e.doc && (_.trace("Adding nodes children "), Fe(e, e.doc, o, s, c, !h, p, y));
802
+ }, "dataFetcher"), Pe = /* @__PURE__ */ f(() => {
803
+ pt.clear(), M = 0;
804
+ }, "reset"), D = {
801
805
  START_NODE: "[*]",
802
806
  START_TYPE: "start",
803
807
  END_NODE: "[*]",
@@ -806,13 +810,13 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
806
810
  FILL_KEYWORD: "fill",
807
811
  BG_FILL: "bgFill",
808
812
  STYLECLASS_SEP: ","
809
- }, $t = /* @__PURE__ */ f(() => /* @__PURE__ */ new Map(), "newClassesList"), Pt = /* @__PURE__ */ f(() => ({
813
+ }, Ft = /* @__PURE__ */ f(() => /* @__PURE__ */ new Map(), "newClassesList"), Pt = /* @__PURE__ */ f(() => ({
810
814
  relations: [],
811
815
  states: /* @__PURE__ */ new Map(),
812
816
  documents: {}
813
- }), "newDoc"), ft = /* @__PURE__ */ f((t) => JSON.parse(JSON.stringify(t)), "clone"), Ve = class {
817
+ }), "newDoc"), ft = /* @__PURE__ */ f((t) => JSON.parse(JSON.stringify(t)), "clone"), je = class {
814
818
  constructor(t) {
815
- this.version = t, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = $t(), this.documents = { root: Pt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.getAccTitle = ie, this.setAccTitle = re, this.getAccDescription = ae, this.setAccDescription = ne, this.setDiagramTitle = oe, this.getDiagramTitle = le, 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);
819
+ this.version = t, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = Ft(), this.documents = { root: Pt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.funs = [], this.getAccTitle = re, this.setAccTitle = ae, this.getAccDescription = ne, this.setAccDescription = oe, this.setDiagramTitle = le, this.getDiagramTitle = ce, 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);
816
820
  }
817
821
  static {
818
822
  f(this, "StateDB");
@@ -838,34 +842,34 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
838
842
  this.clear(!0);
839
843
  for (const s of Array.isArray(t) ? t : t.doc)
840
844
  switch (s.stmt) {
841
- case X:
845
+ case q:
842
846
  this.addState(s.id.trim(), s.type, s.doc, s.description, s.note);
843
847
  break;
844
- case vt:
848
+ case Ct:
845
849
  this.addRelation(s.state1, s.state2, s.description);
846
850
  break;
847
- case de:
851
+ case Se:
848
852
  this.addStyleClass(s.id.trim(), s.classes);
849
853
  break;
850
- case fe:
854
+ case ye:
851
855
  this.handleStyleDef(s);
852
856
  break;
853
- case pe:
857
+ case ge:
854
858
  this.setCssClass(s.id.trim(), s.styleClass);
855
859
  break;
856
860
  case "click":
857
861
  this.addLink(s.id, s.url, s.tooltip);
858
862
  break;
859
863
  }
860
- const e = this.getStates(), l = w();
861
- we(), Z(
864
+ const e = this.getStates(), o = $();
865
+ Pe(), tt(
862
866
  void 0,
863
867
  this.getRootDocV2(),
864
868
  e,
865
869
  this.nodes,
866
870
  this.edges,
867
871
  !0,
868
- l.look,
872
+ o.look,
869
873
  this.classes
870
874
  );
871
875
  for (const s of this.nodes)
@@ -878,51 +882,51 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
878
882
  }
879
883
  }
880
884
  handleStyleDef(t) {
881
- const e = t.id.trim().split(","), l = t.styleClass.split(",");
885
+ const e = t.id.trim().split(","), o = t.styleClass.split(",");
882
886
  for (const s of e) {
883
- let u = this.getState(s);
884
- if (!u) {
885
- const d = s.trim();
886
- this.addState(d), u = this.getState(d);
887
+ let c = this.getState(s);
888
+ if (!c) {
889
+ const h = s.trim();
890
+ this.addState(h), c = this.getState(h);
887
891
  }
888
- u && (u.styles = l.map((d) => d.replace(/;/g, "")?.trim()));
892
+ c && (c.styles = o.map((h) => h.replace(/;/g, "")?.trim()));
889
893
  }
890
894
  }
891
895
  setRootDoc(t) {
892
896
  _.info("Setting root doc", t), this.rootDoc = t, this.version === 1 ? this.extract(t) : this.extract(this.getRootDocV2());
893
897
  }
894
- docTranslator(t, e, l) {
895
- if (e.stmt === vt) {
898
+ docTranslator(t, e, o) {
899
+ if (e.stmt === Ct) {
896
900
  this.docTranslator(t, e.state1, !0), this.docTranslator(t, e.state2, !1);
897
901
  return;
898
902
  }
899
- if (e.stmt === X && (e.id === v.START_NODE ? (e.id = t.id + (l ? "_start" : "_end"), e.start = l) : e.id = e.id.trim()), e.stmt !== K && e.stmt !== X || !e.doc)
903
+ if (e.stmt === q && (e.id === D.START_NODE ? (e.id = t.id + (o ? "_start" : "_end"), e.start = o) : e.id = e.id.trim()), e.stmt !== J && e.stmt !== q || !e.doc)
900
904
  return;
901
905
  const s = [];
902
- let u = [];
903
- for (const d of e.doc)
904
- if (d.type === Bt) {
905
- const S = ft(d);
906
- S.doc = ft(u), s.push(S), u = [];
906
+ let c = [];
907
+ for (const h of e.doc)
908
+ if (h.type === Yt) {
909
+ const p = ft(h);
910
+ p.doc = ft(c), s.push(p), c = [];
907
911
  } else
908
- u.push(d);
909
- if (s.length > 0 && u.length > 0) {
910
- const d = {
911
- stmt: X,
912
- id: ce(),
912
+ c.push(h);
913
+ if (s.length > 0 && c.length > 0) {
914
+ const h = {
915
+ stmt: q,
916
+ id: he(),
913
917
  type: "divider",
914
- doc: ft(u)
918
+ doc: ft(c)
915
919
  };
916
- s.push(ft(d)), e.doc = s;
920
+ s.push(ft(h)), e.doc = s;
917
921
  }
918
- e.doc.forEach((d) => this.docTranslator(e, d, !0));
922
+ e.doc.forEach((h) => this.docTranslator(e, h, !0));
919
923
  }
920
924
  getRootDocV2() {
921
925
  return this.docTranslator(
922
- { id: K, stmt: K },
923
- { id: K, stmt: K, doc: this.rootDoc },
926
+ { id: J, stmt: J },
927
+ { id: J, stmt: J, doc: this.rootDoc },
924
928
  !0
925
- ), { id: K, doc: this.rootDoc };
929
+ ), { id: J, doc: this.rootDoc };
926
930
  }
927
931
  /**
928
932
  * Function called by parser when a node definition has been found.
@@ -932,16 +936,16 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
932
936
  * @param styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
933
937
  * @param textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.
934
938
  */
935
- addState(t, e = tt, l = void 0, s = void 0, u = void 0, d = void 0, S = void 0, g = void 0) {
939
+ addState(t, e = et, o = void 0, s = void 0, c = void 0, h = void 0, p = void 0, y = void 0) {
936
940
  const n = t?.trim();
937
941
  if (!this.currentDocument.states.has(n))
938
942
  _.info("Adding state ", n, s), this.currentDocument.states.set(n, {
939
- stmt: X,
943
+ stmt: q,
940
944
  id: n,
941
945
  descriptions: [],
942
946
  type: e,
943
- doc: l,
944
- note: u,
947
+ doc: o,
948
+ note: c,
945
949
  classes: [],
946
950
  styles: [],
947
951
  textStyles: []
@@ -950,18 +954,18 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
950
954
  const T = this.currentDocument.states.get(n);
951
955
  if (!T)
952
956
  throw new Error(`State not found: ${n}`);
953
- T.doc || (T.doc = l), T.type || (T.type = e);
957
+ T.doc || (T.doc = o), T.type || (T.type = e);
954
958
  }
955
- if (s && (_.info("Setting state description", n, s), (Array.isArray(s) ? s : [s]).forEach((m) => this.addDescription(n, m.trim()))), u) {
959
+ if (s && (_.info("Setting state description", n, s), (Array.isArray(s) ? s : [s]).forEach((m) => this.addDescription(n, m.trim()))), c) {
956
960
  const T = this.currentDocument.states.get(n);
957
961
  if (!T)
958
962
  throw new Error(`State not found: ${n}`);
959
- T.note = u, T.note.text = W.sanitizeText(T.note.text, w());
963
+ T.note = c, T.note.text = j.sanitizeText(T.note.text, $());
960
964
  }
961
- d && (_.info("Setting state classes", n, d), (Array.isArray(d) ? d : [d]).forEach((m) => this.setCssClass(n, m.trim()))), S && (_.info("Setting state styles", n, S), (Array.isArray(S) ? S : [S]).forEach((m) => this.setStyle(n, m.trim()))), g && (_.info("Setting state styles", n, S), (Array.isArray(g) ? g : [g]).forEach((m) => this.setTextStyle(n, m.trim())));
965
+ h && (_.info("Setting state classes", n, h), (Array.isArray(h) ? h : [h]).forEach((m) => this.setCssClass(n, m.trim()))), p && (_.info("Setting state styles", n, p), (Array.isArray(p) ? p : [p]).forEach((m) => this.setStyle(n, m.trim()))), y && (_.info("Setting state styles", n, p), (Array.isArray(y) ? y : [y]).forEach((m) => this.setTextStyle(n, m.trim())));
962
966
  }
963
967
  clear(t) {
964
- this.nodes = [], this.edges = [], this.documents = { root: Pt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = $t(), t || (this.links = /* @__PURE__ */ new Map(), he());
968
+ this.nodes = [], this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.documents = { root: Pt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = Ft(), t || (this.links = /* @__PURE__ */ new Map(), ue());
965
969
  }
966
970
  getState(t) {
967
971
  return this.currentDocument.states.get(t);
@@ -978,8 +982,8 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
978
982
  /**
979
983
  * Adds a clickable link to a state.
980
984
  */
981
- addLink(t, e, l) {
982
- this.links.set(t, { url: e, tooltip: l }), _.warn("Adding link", t, e, l);
985
+ addLink(t, e, o) {
986
+ this.links.set(t, { url: e, tooltip: o }), _.warn("Adding link", t, e, o);
983
987
  }
984
988
  /**
985
989
  * Get all registered links.
@@ -993,14 +997,14 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
993
997
  * else return the given id
994
998
  */
995
999
  startIdIfNeeded(t = "") {
996
- return t === v.START_NODE ? (this.startEndCount++, `${v.START_TYPE}${this.startEndCount}`) : t;
1000
+ return t === D.START_NODE ? (this.startEndCount++, `${D.START_TYPE}${this.startEndCount}`) : t;
997
1001
  }
998
1002
  /**
999
1003
  * If the id is a start node ( [*] ), then return the start type ('start')
1000
1004
  * else return the given type
1001
1005
  */
1002
- startTypeIfNeeded(t = "", e = tt) {
1003
- return t === v.START_NODE ? v.START_TYPE : e;
1006
+ startTypeIfNeeded(t = "", e = et) {
1007
+ return t === D.START_NODE ? D.START_TYPE : e;
1004
1008
  }
1005
1009
  /**
1006
1010
  * If the id is an end node ( [*] ), then return a new id constructed from
@@ -1008,21 +1012,21 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1008
1012
  * else return the given id
1009
1013
  */
1010
1014
  endIdIfNeeded(t = "") {
1011
- return t === v.END_NODE ? (this.startEndCount++, `${v.END_TYPE}${this.startEndCount}`) : t;
1015
+ return t === D.END_NODE ? (this.startEndCount++, `${D.END_TYPE}${this.startEndCount}`) : t;
1012
1016
  }
1013
1017
  /**
1014
1018
  * If the id is an end node ( [*] ), then return the end type
1015
1019
  * else return the given type
1016
1020
  *
1017
1021
  */
1018
- endTypeIfNeeded(t = "", e = tt) {
1019
- return t === v.END_NODE ? v.END_TYPE : e;
1022
+ endTypeIfNeeded(t = "", e = et) {
1023
+ return t === D.END_NODE ? D.END_TYPE : e;
1020
1024
  }
1021
- addRelationObjs(t, e, l = "") {
1022
- const s = this.startIdIfNeeded(t.id.trim()), u = this.startTypeIfNeeded(t.id.trim(), t.type), d = this.startIdIfNeeded(e.id.trim()), S = this.startTypeIfNeeded(e.id.trim(), e.type);
1025
+ addRelationObjs(t, e, o = "") {
1026
+ const s = this.startIdIfNeeded(t.id.trim()), c = this.startTypeIfNeeded(t.id.trim(), t.type), h = this.startIdIfNeeded(e.id.trim()), p = this.startTypeIfNeeded(e.id.trim(), e.type);
1023
1027
  this.addState(
1024
1028
  s,
1025
- u,
1029
+ c,
1026
1030
  t.doc,
1027
1031
  t.description,
1028
1032
  t.note,
@@ -1030,8 +1034,8 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1030
1034
  t.styles,
1031
1035
  t.textStyles
1032
1036
  ), this.addState(
1033
- d,
1034
- S,
1037
+ h,
1038
+ p,
1035
1039
  e.doc,
1036
1040
  e.description,
1037
1041
  e.note,
@@ -1040,28 +1044,28 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1040
1044
  e.textStyles
1041
1045
  ), this.currentDocument.relations.push({
1042
1046
  id1: s,
1043
- id2: d,
1044
- relationTitle: W.sanitizeText(l, w())
1047
+ id2: h,
1048
+ relationTitle: j.sanitizeText(o, $())
1045
1049
  });
1046
1050
  }
1047
1051
  /**
1048
1052
  * Add a relation between two items. The items may be full objects or just the string id of a state.
1049
1053
  */
1050
- addRelation(t, e, l) {
1054
+ addRelation(t, e, o) {
1051
1055
  if (typeof t == "object" && typeof e == "object")
1052
- this.addRelationObjs(t, e, l);
1056
+ this.addRelationObjs(t, e, o);
1053
1057
  else if (typeof t == "string" && typeof e == "string") {
1054
- const s = this.startIdIfNeeded(t.trim()), u = this.startTypeIfNeeded(t), d = this.endIdIfNeeded(e.trim()), S = this.endTypeIfNeeded(e);
1055
- this.addState(s, u), this.addState(d, S), this.currentDocument.relations.push({
1058
+ const s = this.startIdIfNeeded(t.trim()), c = this.startTypeIfNeeded(t), h = this.endIdIfNeeded(e.trim()), p = this.endTypeIfNeeded(e);
1059
+ this.addState(s, c), this.addState(h, p), this.currentDocument.relations.push({
1056
1060
  id1: s,
1057
- id2: d,
1058
- relationTitle: l ? W.sanitizeText(l, w()) : void 0
1061
+ id2: h,
1062
+ relationTitle: o ? j.sanitizeText(o, $()) : void 0
1059
1063
  });
1060
1064
  }
1061
1065
  }
1062
1066
  addDescription(t, e) {
1063
- const l = this.currentDocument.states.get(t), s = e.startsWith(":") ? e.replace(":", "").trim() : e;
1064
- l?.descriptions?.push(W.sanitizeText(s, w()));
1067
+ const o = this.currentDocument.states.get(t), s = e.startsWith(":") ? e.replace(":", "").trim() : e;
1068
+ o?.descriptions?.push(j.sanitizeText(s, $()));
1065
1069
  }
1066
1070
  cleanupLabel(t) {
1067
1071
  return t.startsWith(":") ? t.slice(2).trim() : t.trim();
@@ -1078,19 +1082,31 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1078
1082
  */
1079
1083
  addStyleClass(t, e = "") {
1080
1084
  this.classes.has(t) || this.classes.set(t, { id: t, styles: [], textStyles: [] });
1081
- const l = this.classes.get(t);
1082
- e && l && e.split(v.STYLECLASS_SEP).forEach((s) => {
1083
- const u = s.replace(/([^;]*);/, "$1").trim();
1084
- if (RegExp(v.COLOR_KEYWORD).exec(s)) {
1085
- const S = u.replace(v.FILL_KEYWORD, v.BG_FILL).replace(v.COLOR_KEYWORD, v.FILL_KEYWORD);
1086
- l.textStyles.push(S);
1085
+ const o = this.classes.get(t);
1086
+ e && o && e.split(D.STYLECLASS_SEP).forEach((s) => {
1087
+ const c = s.replace(/([^;]*);/, "$1").trim();
1088
+ if (RegExp(D.COLOR_KEYWORD).exec(s)) {
1089
+ const p = c.replace(D.FILL_KEYWORD, D.BG_FILL).replace(D.COLOR_KEYWORD, D.FILL_KEYWORD);
1090
+ o.textStyles.push(p);
1087
1091
  }
1088
- l.styles.push(u);
1092
+ o.styles.push(c);
1089
1093
  });
1090
1094
  }
1091
1095
  getClasses() {
1092
1096
  return this.classes;
1093
1097
  }
1098
+ setupToolTips(t) {
1099
+ const e = fe();
1100
+ bt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover", (c) => {
1101
+ const h = bt(c.currentTarget), p = h.attr("title");
1102
+ if (p === null)
1103
+ return;
1104
+ const y = c.currentTarget?.getBoundingClientRect();
1105
+ e.transition().duration(200).style("opacity", ".9"), e.style("left", window.scrollX + y.left + (y.right - y.left) / 2 + "px").style("top", window.scrollY + y.bottom + "px"), e.html(de.sanitize(p)), h.classed("hover", !0);
1106
+ }).on("mouseout", (c) => {
1107
+ e.transition().duration(500).style("opacity", 0), bt(c.currentTarget).classed("hover", !1);
1108
+ });
1109
+ }
1094
1110
  /**
1095
1111
  * Add a (style) class or css class to a state with the given id.
1096
1112
  * If the state isn't already in the list of known states, add it.
@@ -1100,11 +1116,11 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1100
1116
  * @param cssClassName - CSS class name
1101
1117
  */
1102
1118
  setCssClass(t, e) {
1103
- t.split(",").forEach((l) => {
1104
- let s = this.getState(l);
1119
+ t.split(",").forEach((o) => {
1120
+ let s = this.getState(o);
1105
1121
  if (!s) {
1106
- const u = l.trim();
1107
- this.addState(u), s = this.getState(u);
1122
+ const c = o.trim();
1123
+ this.addState(c), s = this.getState(c);
1108
1124
  }
1109
1125
  s?.classes?.push(e);
1110
1126
  });
@@ -1131,37 +1147,42 @@ var Z = /* @__PURE__ */ f((t, e, l, s, u, d, S, g) => {
1131
1147
  setTextStyle(t, e) {
1132
1148
  this.getState(t)?.textStyles?.push(e);
1133
1149
  }
1150
+ bindFunctions(t) {
1151
+ this.funs.forEach((e) => {
1152
+ e(t);
1153
+ });
1154
+ }
1134
1155
  /**
1135
1156
  * Finds the direction statement in the root document.
1136
1157
  * @returns the direction statement if present
1137
1158
  */
1138
1159
  getDirectionStatement() {
1139
- return this.rootDoc.find((t) => t.stmt === It);
1160
+ return this.rootDoc.find((t) => t.stmt === wt);
1140
1161
  }
1141
1162
  getDirection() {
1142
- return this.getDirectionStatement()?.value ?? ue;
1163
+ return this.getDirectionStatement()?.value ?? pe;
1143
1164
  }
1144
1165
  setDirection(t) {
1145
1166
  const e = this.getDirectionStatement();
1146
- e ? e.value = t : this.rootDoc.unshift({ stmt: It, value: t });
1167
+ e ? e.value = t : this.rootDoc.unshift({ stmt: wt, value: t });
1147
1168
  }
1148
1169
  trimColon(t) {
1149
1170
  return t.startsWith(":") ? t.slice(1).trim() : t.trim();
1150
1171
  }
1151
1172
  getData() {
1152
- const t = w();
1173
+ const t = $();
1153
1174
  return {
1154
1175
  nodes: this.nodes,
1155
1176
  edges: this.edges,
1156
1177
  other: {},
1157
1178
  config: t,
1158
- direction: zt(this.getRootDocV2())
1179
+ direction: Kt(this.getRootDocV2())
1159
1180
  };
1160
1181
  }
1161
1182
  getConfig() {
1162
- return w().state;
1183
+ return $().state;
1163
1184
  }
1164
- }, $e = /* @__PURE__ */ f((t) => `
1185
+ }, Be = /* @__PURE__ */ f((t) => `
1165
1186
  defs [id$="-barbEnd"] {
1166
1187
  fill: ${t.transitionColor};
1167
1188
  stroke: ${t.transitionColor};
@@ -1386,11 +1407,11 @@ g.stateGroup line {
1386
1407
  ry: ${t.radius}px;
1387
1408
  filter: ${t.dropShadow ? t.dropShadow.replace("url(#drop-shadow)", `url(${t.svgId}-drop-shadow)`) : "none"}
1388
1409
  }
1389
- `, "getStyles"), Me = $e;
1410
+ `, "getStyles"), He = Be;
1390
1411
  export {
1391
- Ve as S,
1392
- Ge as a,
1393
- Ye as b,
1394
- Me as s
1412
+ je as S,
1413
+ Ue as a,
1414
+ We as b,
1415
+ He as s
1395
1416
  };
1396
- //# sourceMappingURL=chunk-AQP2D5EJ-D4G4syYu.js.map
1417
+ //# sourceMappingURL=chunk-5RXB4S5H-Ds3vF1Mv.js.map