@elmethis/core 1.0.0-alpha.135 → 1.0.0-alpha.136

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 (66) hide show
  1. package/dist/{Bash-5KqPZETT.js → Bash-BGUPOZp7.js} +1 -1
  2. package/dist/{Css-Br7IeFYI.js → Css-BCZOJ9TO.js} +1 -1
  3. package/dist/{Rust-TE1r2SD6.js → Rust-BwvKtYCc.js} +1 -1
  4. package/dist/_basePickBy-BjVOtBbf.js +152 -0
  5. package/dist/_baseUniq-DBXEmOed.js +583 -0
  6. package/dist/arc-CpOtc53l.js +83 -0
  7. package/dist/architecture-I3QFYML2-B3piHlUx.js +5 -0
  8. package/dist/architectureDiagram-UYN6MBPD-CIvqBNYd.js +4595 -0
  9. package/dist/blockDiagram-ZHA2E4KO-BJHIBwi6.js +2247 -0
  10. package/dist/c4Diagram-6F5ED5ID-DxXqw6e0.js +1581 -0
  11. package/dist/channel-BgZSmjvA.js +5 -0
  12. package/dist/chunk-5HRBRIJM-CvhBPtHu.js +24 -0
  13. package/dist/chunk-7U56Z5CX-CaWvnXle.js +1215 -0
  14. package/dist/chunk-ASOPGD6M-CQjrO8hd.js +64 -0
  15. package/dist/chunk-KFBOBJHC-DWru5GNu.js +15 -0
  16. package/dist/chunk-T2TOU4HS-DqpYO7rW.js +1303 -0
  17. package/dist/chunk-TMUBEWPD-LmMMNIqt.js +9 -0
  18. package/dist/classDiagram-LNE6IOMH-D5GoOZTJ.js +14 -0
  19. package/dist/classDiagram-v2-MQ7JQ4JX-D5GoOZTJ.js +14 -0
  20. package/dist/clone-DMQ2a__4.js +8 -0
  21. package/dist/{cobol-DZ3yq6J9.js → cobol-DMssKNmC.js} +1 -1
  22. package/dist/components/code/ElmMermaid.stories.d.ts +7 -0
  23. package/dist/components/code/ElmMermaid.vue.d.ts +8 -0
  24. package/dist/cytoscape.esm-CsRvAgYT.js +17639 -0
  25. package/dist/dagre-4EVJKHTY-C7YsHY3S.js +447 -0
  26. package/dist/diagram-QW4FP2JN-iDbrW_yI.js +126 -0
  27. package/dist/elmethis.js +36 -35
  28. package/dist/elmethis.umd.cjs +2272 -41
  29. package/dist/erDiagram-6RL3IURR-LYq0WEw3.js +937 -0
  30. package/dist/flowDiagram-7ASYPVHJ-DRPtjs2_.js +1484 -0
  31. package/dist/ganttDiagram-NTVNEXSI-C-hO_7Lp.js +2494 -0
  32. package/dist/gitGraph-YCYPL57B-BaVhg8eu.js +5 -0
  33. package/dist/gitGraphDiagram-NRZ2UAAF-u52k9qsq.js +712 -0
  34. package/dist/graph-CKV5wesZ.js +247 -0
  35. package/dist/{index-0D7NEPxZ.js → index-DQdUr-_f.js} +3548 -3436
  36. package/dist/index.d.ts +3 -2
  37. package/dist/info-46DW6VJ7-D5JUpHK_.js +5 -0
  38. package/dist/infoDiagram-A4XQUW5V-D5IcjWQu.js +22 -0
  39. package/dist/init-DjUOC4st.js +16 -0
  40. package/dist/journeyDiagram-G5WM74LC-XHcEaxXL.js +810 -0
  41. package/dist/kanban-definition-QRCXZQQD-BFgu8zXi.js +718 -0
  42. package/dist/layout-Cycesmdu.js +1324 -0
  43. package/dist/linear-CjRkwbhR.js +423 -0
  44. package/dist/mermaid-parser.core-CL_REaxY.js +12479 -0
  45. package/dist/mermaid.core-gtllNrzr.js +14852 -0
  46. package/dist/mindmap-definition-GWI6TPTV-yPOhYeCo.js +3220 -0
  47. package/dist/ordinal-DfAQgscy.js +61 -0
  48. package/dist/packet-W2GHVCYJ-D1drjM5q.js +5 -0
  49. package/dist/pie-BEWT4RHE-B2xFs62T.js +5 -0
  50. package/dist/pieDiagram-YF2LJOPJ-Cnvx0DvF.js +162 -0
  51. package/dist/quadrantDiagram-OS5C2QUG-DBWy6UVd.js +1024 -0
  52. package/dist/{razor-Dl6rcHmj.js → razor-CeqqNtyB.js} +1 -1
  53. package/dist/requirementDiagram-MIRIMTAZ-CfHcsBsO.js +768 -0
  54. package/dist/sankeyDiagram-Y46BX6SQ-C_60tCtv.js +805 -0
  55. package/dist/sass-eCUyDs9S.js +6 -0
  56. package/dist/scala-Cly-fENF.js +6 -0
  57. package/dist/sequenceDiagram-G6AWOVSC-XvgYpHvJ.js +2274 -0
  58. package/dist/stateDiagram-MAYHULR4-Bx48BKG3.js +268 -0
  59. package/dist/stateDiagram-v2-4JROLMXI-pDuBzVSZ.js +14 -0
  60. package/dist/swift-BAWqNR8A.js +6 -0
  61. package/dist/timeline-definition-U7ZMHBDA-EGhtku4S.js +804 -0
  62. package/dist/xychartDiagram-6QU3TZC5-B_OmutYz.js +1304 -0
  63. package/package.json +11 -10
  64. package/dist/sass-iCyS6eP9.js +0 -6
  65. package/dist/scala-BQHTnvwx.js +0 -6
  66. package/dist/swift-OL4r9IGP.js +0 -6
@@ -0,0 +1,768 @@
1
+ import { _ as r, d as ve, s as Fe, g as De, c as Pe, b as Ye, l as xe, x as Ue, j as ce, k as Be, a1 as Qe, e as Te } from "./mermaid.core-gtllNrzr.js";
2
+ import { G as He } from "./graph-CKV5wesZ.js";
3
+ import { l as We } from "./layout-Cycesmdu.js";
4
+ var he = function() {
5
+ var e = /* @__PURE__ */ r(function($, i, a, l) {
6
+ for (a = a || {}, l = $.length; l--; a[$[l]] = i) ;
7
+ return a;
8
+ }, "o"), t = [1, 3], c = [1, 4], d = [1, 5], u = [1, 6], p = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], y = [1, 18], h = [2, 7], o = [1, 22], g = [1, 23], R = [1, 24], I = [1, 25], b = [1, 26], w = [1, 27], q = [1, 20], v = [1, 28], A = [1, 29], F = [62, 63], pe = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], fe = [1, 47], ye = [1, 48], _e = [1, 49], ge = [1, 50], Ee = [1, 51], Re = [1, 52], me = [1, 53], O = [53, 54], D = [1, 64], P = [1, 60], Y = [1, 61], U = [1, 62], B = [1, 63], Q = [1, 65], j = [1, 69], X = [1, 70], J = [1, 67], Z = [1, 68], S = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], ne = {
9
+ trace: /* @__PURE__ */ r(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ symbols_: { error: 2, start: 3, directive: 4, NEWLINE: 5, RD: 6, diagram: 7, EOF: 8, acc_title: 9, acc_title_value: 10, acc_descr: 11, acc_descr_value: 12, acc_descr_multiline_value: 13, requirementDef: 14, elementDef: 15, relationshipDef: 16, requirementType: 17, requirementName: 18, STRUCT_START: 19, requirementBody: 20, ID: 21, COLONSEP: 22, id: 23, TEXT: 24, text: 25, RISK: 26, riskLevel: 27, VERIFYMTHD: 28, verifyType: 29, STRUCT_STOP: 30, REQUIREMENT: 31, FUNCTIONAL_REQUIREMENT: 32, INTERFACE_REQUIREMENT: 33, PERFORMANCE_REQUIREMENT: 34, PHYSICAL_REQUIREMENT: 35, DESIGN_CONSTRAINT: 36, LOW_RISK: 37, MED_RISK: 38, HIGH_RISK: 39, VERIFY_ANALYSIS: 40, VERIFY_DEMONSTRATION: 41, VERIFY_INSPECTION: 42, VERIFY_TEST: 43, ELEMENT: 44, elementName: 45, elementBody: 46, TYPE: 47, type: 48, DOCREF: 49, ref: 50, END_ARROW_L: 51, relationship: 52, LINE: 53, END_ARROW_R: 54, CONTAINS: 55, COPIES: 56, DERIVES: 57, SATISFIES: 58, VERIFIES: 59, REFINES: 60, TRACES: 61, unqString: 62, qString: 63, $accept: 0, $end: 1 },
13
+ terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 19: "STRUCT_START", 21: "ID", 22: "COLONSEP", 24: "TEXT", 26: "RISK", 28: "VERIFYMTHD", 30: "STRUCT_STOP", 31: "REQUIREMENT", 32: "FUNCTIONAL_REQUIREMENT", 33: "INTERFACE_REQUIREMENT", 34: "PERFORMANCE_REQUIREMENT", 35: "PHYSICAL_REQUIREMENT", 36: "DESIGN_CONSTRAINT", 37: "LOW_RISK", 38: "MED_RISK", 39: "HIGH_RISK", 40: "VERIFY_ANALYSIS", 41: "VERIFY_DEMONSTRATION", 42: "VERIFY_INSPECTION", 43: "VERIFY_TEST", 44: "ELEMENT", 47: "TYPE", 49: "DOCREF", 51: "END_ARROW_L", 53: "LINE", 54: "END_ARROW_R", 55: "CONTAINS", 56: "COPIES", 57: "DERIVES", 58: "SATISFIES", 59: "VERIFIES", 60: "REFINES", 61: "TRACES", 62: "unqString", 63: "qString" },
14
+ productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [14, 5], [20, 5], [20, 5], [20, 5], [20, 5], [20, 2], [20, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [27, 1], [27, 1], [27, 1], [29, 1], [29, 1], [29, 1], [29, 1], [15, 5], [46, 5], [46, 5], [46, 2], [46, 1], [16, 5], [16, 5], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [18, 1], [18, 1], [23, 1], [23, 1], [25, 1], [25, 1], [45, 1], [45, 1], [48, 1], [48, 1], [50, 1], [50, 1]],
15
+ performAction: /* @__PURE__ */ r(function(i, a, l, n, f, s, K) {
16
+ var E = s.length - 1;
17
+ switch (f) {
18
+ case 4:
19
+ this.$ = s[E].trim(), n.setAccTitle(this.$);
20
+ break;
21
+ case 5:
22
+ case 6:
23
+ this.$ = s[E].trim(), n.setAccDescription(this.$);
24
+ break;
25
+ case 7:
26
+ this.$ = [];
27
+ break;
28
+ case 13:
29
+ n.addRequirement(s[E - 3], s[E - 4]);
30
+ break;
31
+ case 14:
32
+ n.setNewReqId(s[E - 2]);
33
+ break;
34
+ case 15:
35
+ n.setNewReqText(s[E - 2]);
36
+ break;
37
+ case 16:
38
+ n.setNewReqRisk(s[E - 2]);
39
+ break;
40
+ case 17:
41
+ n.setNewReqVerifyMethod(s[E - 2]);
42
+ break;
43
+ case 20:
44
+ this.$ = n.RequirementType.REQUIREMENT;
45
+ break;
46
+ case 21:
47
+ this.$ = n.RequirementType.FUNCTIONAL_REQUIREMENT;
48
+ break;
49
+ case 22:
50
+ this.$ = n.RequirementType.INTERFACE_REQUIREMENT;
51
+ break;
52
+ case 23:
53
+ this.$ = n.RequirementType.PERFORMANCE_REQUIREMENT;
54
+ break;
55
+ case 24:
56
+ this.$ = n.RequirementType.PHYSICAL_REQUIREMENT;
57
+ break;
58
+ case 25:
59
+ this.$ = n.RequirementType.DESIGN_CONSTRAINT;
60
+ break;
61
+ case 26:
62
+ this.$ = n.RiskLevel.LOW_RISK;
63
+ break;
64
+ case 27:
65
+ this.$ = n.RiskLevel.MED_RISK;
66
+ break;
67
+ case 28:
68
+ this.$ = n.RiskLevel.HIGH_RISK;
69
+ break;
70
+ case 29:
71
+ this.$ = n.VerifyType.VERIFY_ANALYSIS;
72
+ break;
73
+ case 30:
74
+ this.$ = n.VerifyType.VERIFY_DEMONSTRATION;
75
+ break;
76
+ case 31:
77
+ this.$ = n.VerifyType.VERIFY_INSPECTION;
78
+ break;
79
+ case 32:
80
+ this.$ = n.VerifyType.VERIFY_TEST;
81
+ break;
82
+ case 33:
83
+ n.addElement(s[E - 3]);
84
+ break;
85
+ case 34:
86
+ n.setNewElementType(s[E - 2]);
87
+ break;
88
+ case 35:
89
+ n.setNewElementDocRef(s[E - 2]);
90
+ break;
91
+ case 38:
92
+ n.addRelationship(s[E - 2], s[E], s[E - 4]);
93
+ break;
94
+ case 39:
95
+ n.addRelationship(s[E - 2], s[E - 4], s[E]);
96
+ break;
97
+ case 40:
98
+ this.$ = n.Relationships.CONTAINS;
99
+ break;
100
+ case 41:
101
+ this.$ = n.Relationships.COPIES;
102
+ break;
103
+ case 42:
104
+ this.$ = n.Relationships.DERIVES;
105
+ break;
106
+ case 43:
107
+ this.$ = n.Relationships.SATISFIES;
108
+ break;
109
+ case 44:
110
+ this.$ = n.Relationships.VERIFIES;
111
+ break;
112
+ case 45:
113
+ this.$ = n.Relationships.REFINES;
114
+ break;
115
+ case 46:
116
+ this.$ = n.Relationships.TRACES;
117
+ break;
118
+ }
119
+ }, "anonymous"),
120
+ table: [{ 3: 1, 4: 2, 6: t, 9: c, 11: d, 13: u }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: t, 9: c, 11: d, 13: u }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, e(p, [2, 6]), { 3: 12, 4: 2, 6: t, 9: c, 11: d, 13: u }, { 1: [2, 2] }, { 4: 17, 5: y, 7: 13, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, e(p, [2, 4]), e(p, [2, 5]), { 1: [2, 1] }, { 8: [1, 30] }, { 4: 17, 5: y, 7: 31, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, { 4: 17, 5: y, 7: 32, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, { 4: 17, 5: y, 7: 33, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, { 4: 17, 5: y, 7: 34, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, { 4: 17, 5: y, 7: 35, 8: h, 9: c, 11: d, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: g, 33: R, 34: I, 35: b, 36: w, 44: q, 62: v, 63: A }, { 18: 36, 62: [1, 37], 63: [1, 38] }, { 45: 39, 62: [1, 40], 63: [1, 41] }, { 51: [1, 42], 53: [1, 43] }, e(F, [2, 20]), e(F, [2, 21]), e(F, [2, 22]), e(F, [2, 23]), e(F, [2, 24]), e(F, [2, 25]), e(pe, [2, 49]), e(pe, [2, 50]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 19: [1, 44] }, { 19: [2, 47] }, { 19: [2, 48] }, { 19: [1, 45] }, { 19: [2, 53] }, { 19: [2, 54] }, { 52: 46, 55: fe, 56: ye, 57: _e, 58: ge, 59: Ee, 60: Re, 61: me }, { 52: 54, 55: fe, 56: ye, 57: _e, 58: ge, 59: Ee, 60: Re, 61: me }, { 5: [1, 55] }, { 5: [1, 56] }, { 53: [1, 57] }, e(O, [2, 40]), e(O, [2, 41]), e(O, [2, 42]), e(O, [2, 43]), e(O, [2, 44]), e(O, [2, 45]), e(O, [2, 46]), { 54: [1, 58] }, { 5: D, 20: 59, 21: P, 24: Y, 26: U, 28: B, 30: Q }, { 5: j, 30: X, 46: 66, 47: J, 49: Z }, { 23: 71, 62: v, 63: A }, { 23: 72, 62: v, 63: A }, e(S, [2, 13]), { 22: [1, 73] }, { 22: [1, 74] }, { 22: [1, 75] }, { 22: [1, 76] }, { 5: D, 20: 77, 21: P, 24: Y, 26: U, 28: B, 30: Q }, e(S, [2, 19]), e(S, [2, 33]), { 22: [1, 78] }, { 22: [1, 79] }, { 5: j, 30: X, 46: 80, 47: J, 49: Z }, e(S, [2, 37]), e(S, [2, 38]), e(S, [2, 39]), { 23: 81, 62: v, 63: A }, { 25: 82, 62: [1, 83], 63: [1, 84] }, { 27: 85, 37: [1, 86], 38: [1, 87], 39: [1, 88] }, { 29: 89, 40: [1, 90], 41: [1, 91], 42: [1, 92], 43: [1, 93] }, e(S, [2, 18]), { 48: 94, 62: [1, 95], 63: [1, 96] }, { 50: 97, 62: [1, 98], 63: [1, 99] }, e(S, [2, 36]), { 5: [1, 100] }, { 5: [1, 101] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 102] }, { 5: [2, 26] }, { 5: [2, 27] }, { 5: [2, 28] }, { 5: [1, 103] }, { 5: [2, 29] }, { 5: [2, 30] }, { 5: [2, 31] }, { 5: [2, 32] }, { 5: [1, 104] }, { 5: [2, 55] }, { 5: [2, 56] }, { 5: [1, 105] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: D, 20: 106, 21: P, 24: Y, 26: U, 28: B, 30: Q }, { 5: D, 20: 107, 21: P, 24: Y, 26: U, 28: B, 30: Q }, { 5: D, 20: 108, 21: P, 24: Y, 26: U, 28: B, 30: Q }, { 5: D, 20: 109, 21: P, 24: Y, 26: U, 28: B, 30: Q }, { 5: j, 30: X, 46: 110, 47: J, 49: Z }, { 5: j, 30: X, 46: 111, 47: J, 49: Z }, e(S, [2, 14]), e(S, [2, 15]), e(S, [2, 16]), e(S, [2, 17]), e(S, [2, 34]), e(S, [2, 35])],
121
+ defaultActions: { 8: [2, 2], 12: [2, 1], 30: [2, 3], 31: [2, 8], 32: [2, 9], 33: [2, 10], 34: [2, 11], 35: [2, 12], 37: [2, 47], 38: [2, 48], 40: [2, 53], 41: [2, 54], 83: [2, 51], 84: [2, 52], 86: [2, 26], 87: [2, 27], 88: [2, 28], 90: [2, 29], 91: [2, 30], 92: [2, 31], 93: [2, 32], 95: [2, 55], 96: [2, 56], 98: [2, 57], 99: [2, 58] },
122
+ parseError: /* @__PURE__ */ r(function(i, a) {
123
+ if (a.recoverable)
124
+ this.trace(i);
125
+ else {
126
+ var l = new Error(i);
127
+ throw l.hash = a, l;
128
+ }
129
+ }, "parseError"),
130
+ parse: /* @__PURE__ */ r(function(i) {
131
+ var a = this, l = [0], n = [], f = [null], s = [], K = this.table, E = "", te = 0, Ie = 0, Le = 2, be = 1, Oe = s.slice.call(arguments, 1), m = Object.create(this.lexer), C = { yy: {} };
132
+ for (var se in this.yy)
133
+ Object.prototype.hasOwnProperty.call(this.yy, se) && (C.yy[se] = this.yy[se]);
134
+ m.setInput(i, C.yy), C.yy.lexer = m, C.yy.parser = this, typeof m.yylloc > "u" && (m.yylloc = {});
135
+ var ae = m.yylloc;
136
+ s.push(ae);
137
+ var Ce = m.options && m.options.ranges;
138
+ typeof C.yy.parseError == "function" ? this.parseError = C.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
139
+ function Me(N) {
140
+ l.length = l.length - 2 * N, f.length = f.length - N, s.length = s.length - N;
141
+ }
142
+ r(Me, "popStack");
143
+ function Se() {
144
+ var N;
145
+ return N = n.pop() || m.lex() || be, typeof N != "number" && (N instanceof Array && (n = N, N = n.pop()), N = a.symbols_[N] || N), N;
146
+ }
147
+ r(Se, "lex");
148
+ for (var k, M, x, le, H = {}, ie, V, ke, re; ; ) {
149
+ if (M = l[l.length - 1], this.defaultActions[M] ? x = this.defaultActions[M] : ((k === null || typeof k > "u") && (k = Se()), x = K[M] && K[M][k]), typeof x > "u" || !x.length || !x[0]) {
150
+ var oe = "";
151
+ re = [];
152
+ for (ie in K[M])
153
+ this.terminals_[ie] && ie > Le && re.push("'" + this.terminals_[ie] + "'");
154
+ m.showPosition ? oe = "Parse error on line " + (te + 1) + `:
155
+ ` + m.showPosition() + `
156
+ Expecting ` + re.join(", ") + ", got '" + (this.terminals_[k] || k) + "'" : oe = "Parse error on line " + (te + 1) + ": Unexpected " + (k == be ? "end of input" : "'" + (this.terminals_[k] || k) + "'"), this.parseError(oe, {
157
+ text: m.match,
158
+ token: this.terminals_[k] || k,
159
+ line: m.yylineno,
160
+ loc: ae,
161
+ expected: re
162
+ });
163
+ }
164
+ if (x[0] instanceof Array && x.length > 1)
165
+ throw new Error("Parse Error: multiple actions possible at state: " + M + ", token: " + k);
166
+ switch (x[0]) {
167
+ case 1:
168
+ l.push(k), f.push(m.yytext), s.push(m.yylloc), l.push(x[1]), k = null, Ie = m.yyleng, E = m.yytext, te = m.yylineno, ae = m.yylloc;
169
+ break;
170
+ case 2:
171
+ if (V = this.productions_[x[1]][1], H.$ = f[f.length - V], H._$ = {
172
+ first_line: s[s.length - (V || 1)].first_line,
173
+ last_line: s[s.length - 1].last_line,
174
+ first_column: s[s.length - (V || 1)].first_column,
175
+ last_column: s[s.length - 1].last_column
176
+ }, Ce && (H._$.range = [
177
+ s[s.length - (V || 1)].range[0],
178
+ s[s.length - 1].range[1]
179
+ ]), le = this.performAction.apply(H, [
180
+ E,
181
+ Ie,
182
+ te,
183
+ C.yy,
184
+ x[1],
185
+ f,
186
+ s
187
+ ].concat(Oe)), typeof le < "u")
188
+ return le;
189
+ V && (l = l.slice(0, -1 * V * 2), f = f.slice(0, -1 * V), s = s.slice(0, -1 * V)), l.push(this.productions_[x[1]][0]), f.push(H.$), s.push(H._$), ke = K[l[l.length - 2]][l[l.length - 1]], l.push(ke);
190
+ break;
191
+ case 3:
192
+ return !0;
193
+ }
194
+ }
195
+ return !0;
196
+ }, "parse")
197
+ }, $e = /* @__PURE__ */ function() {
198
+ var $ = {
199
+ EOF: 1,
200
+ parseError: /* @__PURE__ */ r(function(a, l) {
201
+ if (this.yy.parser)
202
+ this.yy.parser.parseError(a, l);
203
+ else
204
+ throw new Error(a);
205
+ }, "parseError"),
206
+ // resets the lexer, sets new input
207
+ setInput: /* @__PURE__ */ r(function(i, a) {
208
+ return this.yy = a || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
209
+ first_line: 1,
210
+ first_column: 0,
211
+ last_line: 1,
212
+ last_column: 0
213
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
214
+ }, "setInput"),
215
+ // consumes and returns one char from the input
216
+ input: /* @__PURE__ */ r(function() {
217
+ var i = this._input[0];
218
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
219
+ var a = i.match(/(?:\r\n?|\n).*/g);
220
+ return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
221
+ }, "input"),
222
+ // unshifts one char (or a string) into the input
223
+ unput: /* @__PURE__ */ r(function(i) {
224
+ var a = i.length, l = i.split(/(?:\r\n?|\n)/g);
225
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
226
+ var n = this.match.split(/(?:\r\n?|\n)/g);
227
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
228
+ var f = this.yylloc.range;
229
+ return this.yylloc = {
230
+ first_line: this.yylloc.first_line,
231
+ last_line: this.yylineno + 1,
232
+ first_column: this.yylloc.first_column,
233
+ last_column: l ? (l.length === n.length ? this.yylloc.first_column : 0) + n[n.length - l.length].length - l[0].length : this.yylloc.first_column - a
234
+ }, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
235
+ }, "unput"),
236
+ // When called from action, caches matched text and appends it on next action
237
+ more: /* @__PURE__ */ r(function() {
238
+ return this._more = !0, this;
239
+ }, "more"),
240
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
241
+ reject: /* @__PURE__ */ r(function() {
242
+ if (this.options.backtrack_lexer)
243
+ this._backtrack = !0;
244
+ else
245
+ 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).
246
+ ` + this.showPosition(), {
247
+ text: "",
248
+ token: null,
249
+ line: this.yylineno
250
+ });
251
+ return this;
252
+ }, "reject"),
253
+ // retain first n characters of the match
254
+ less: /* @__PURE__ */ r(function(i) {
255
+ this.unput(this.match.slice(i));
256
+ }, "less"),
257
+ // displays already matched input, i.e. for error messages
258
+ pastInput: /* @__PURE__ */ r(function() {
259
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
260
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
261
+ }, "pastInput"),
262
+ // displays upcoming input, i.e. for error messages
263
+ upcomingInput: /* @__PURE__ */ r(function() {
264
+ var i = this.match;
265
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
266
+ }, "upcomingInput"),
267
+ // displays the character position where the lexing error occurred, i.e. for error messages
268
+ showPosition: /* @__PURE__ */ r(function() {
269
+ var i = this.pastInput(), a = new Array(i.length + 1).join("-");
270
+ return i + this.upcomingInput() + `
271
+ ` + a + "^";
272
+ }, "showPosition"),
273
+ // test the lexed token: return FALSE when not a match, otherwise return token
274
+ test_match: /* @__PURE__ */ r(function(i, a) {
275
+ var l, n, f;
276
+ if (this.options.backtrack_lexer && (f = {
277
+ yylineno: this.yylineno,
278
+ yylloc: {
279
+ first_line: this.yylloc.first_line,
280
+ last_line: this.last_line,
281
+ first_column: this.yylloc.first_column,
282
+ last_column: this.yylloc.last_column
283
+ },
284
+ yytext: this.yytext,
285
+ match: this.match,
286
+ matches: this.matches,
287
+ matched: this.matched,
288
+ yyleng: this.yyleng,
289
+ offset: this.offset,
290
+ _more: this._more,
291
+ _input: this._input,
292
+ yy: this.yy,
293
+ conditionStack: this.conditionStack.slice(0),
294
+ done: this.done
295
+ }, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), n = i[0].match(/(?:\r\n?|\n).*/g), n && (this.yylineno += n.length), this.yylloc = {
296
+ first_line: this.yylloc.last_line,
297
+ last_line: this.yylineno + 1,
298
+ first_column: this.yylloc.last_column,
299
+ last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
300
+ }, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], l = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
301
+ return l;
302
+ if (this._backtrack) {
303
+ for (var s in f)
304
+ this[s] = f[s];
305
+ return !1;
306
+ }
307
+ return !1;
308
+ }, "test_match"),
309
+ // return next match in input
310
+ next: /* @__PURE__ */ r(function() {
311
+ if (this.done)
312
+ return this.EOF;
313
+ this._input || (this.done = !0);
314
+ var i, a, l, n;
315
+ this._more || (this.yytext = "", this.match = "");
316
+ for (var f = this._currentRules(), s = 0; s < f.length; s++)
317
+ if (l = this._input.match(this.rules[f[s]]), l && (!a || l[0].length > a[0].length)) {
318
+ if (a = l, n = s, this.options.backtrack_lexer) {
319
+ if (i = this.test_match(l, f[s]), i !== !1)
320
+ return i;
321
+ if (this._backtrack) {
322
+ a = !1;
323
+ continue;
324
+ } else
325
+ return !1;
326
+ } else if (!this.options.flex)
327
+ break;
328
+ }
329
+ return a ? (i = this.test_match(a, f[n]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
330
+ ` + this.showPosition(), {
331
+ text: "",
332
+ token: null,
333
+ line: this.yylineno
334
+ });
335
+ }, "next"),
336
+ // return next match that has a token
337
+ lex: /* @__PURE__ */ r(function() {
338
+ var a = this.next();
339
+ return a || this.lex();
340
+ }, "lex"),
341
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
342
+ begin: /* @__PURE__ */ r(function(a) {
343
+ this.conditionStack.push(a);
344
+ }, "begin"),
345
+ // pop the previously active lexer condition state off the condition stack
346
+ popState: /* @__PURE__ */ r(function() {
347
+ var a = this.conditionStack.length - 1;
348
+ return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
349
+ }, "popState"),
350
+ // produce the lexer rule set which is active for the currently active lexer condition state
351
+ _currentRules: /* @__PURE__ */ r(function() {
352
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
353
+ }, "_currentRules"),
354
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
355
+ topState: /* @__PURE__ */ r(function(a) {
356
+ return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
357
+ }, "topState"),
358
+ // alias for begin(condition)
359
+ pushState: /* @__PURE__ */ r(function(a) {
360
+ this.begin(a);
361
+ }, "pushState"),
362
+ // return the number of states currently on the stack
363
+ stateStackSize: /* @__PURE__ */ r(function() {
364
+ return this.conditionStack.length;
365
+ }, "stateStackSize"),
366
+ options: { "case-insensitive": !0 },
367
+ performAction: /* @__PURE__ */ r(function(a, l, n, f) {
368
+ switch (n) {
369
+ case 0:
370
+ return "title";
371
+ case 1:
372
+ return this.begin("acc_title"), 9;
373
+ case 2:
374
+ return this.popState(), "acc_title_value";
375
+ case 3:
376
+ return this.begin("acc_descr"), 11;
377
+ case 4:
378
+ return this.popState(), "acc_descr_value";
379
+ case 5:
380
+ this.begin("acc_descr_multiline");
381
+ break;
382
+ case 6:
383
+ this.popState();
384
+ break;
385
+ case 7:
386
+ return "acc_descr_multiline_value";
387
+ case 8:
388
+ return 5;
389
+ case 9:
390
+ break;
391
+ case 10:
392
+ break;
393
+ case 11:
394
+ break;
395
+ case 12:
396
+ return 8;
397
+ case 13:
398
+ return 6;
399
+ case 14:
400
+ return 19;
401
+ case 15:
402
+ return 30;
403
+ case 16:
404
+ return 22;
405
+ case 17:
406
+ return 21;
407
+ case 18:
408
+ return 24;
409
+ case 19:
410
+ return 26;
411
+ case 20:
412
+ return 28;
413
+ case 21:
414
+ return 31;
415
+ case 22:
416
+ return 32;
417
+ case 23:
418
+ return 33;
419
+ case 24:
420
+ return 34;
421
+ case 25:
422
+ return 35;
423
+ case 26:
424
+ return 36;
425
+ case 27:
426
+ return 37;
427
+ case 28:
428
+ return 38;
429
+ case 29:
430
+ return 39;
431
+ case 30:
432
+ return 40;
433
+ case 31:
434
+ return 41;
435
+ case 32:
436
+ return 42;
437
+ case 33:
438
+ return 43;
439
+ case 34:
440
+ return 44;
441
+ case 35:
442
+ return 55;
443
+ case 36:
444
+ return 56;
445
+ case 37:
446
+ return 57;
447
+ case 38:
448
+ return 58;
449
+ case 39:
450
+ return 59;
451
+ case 40:
452
+ return 60;
453
+ case 41:
454
+ return 61;
455
+ case 42:
456
+ return 47;
457
+ case 43:
458
+ return 49;
459
+ case 44:
460
+ return 51;
461
+ case 45:
462
+ return 54;
463
+ case 46:
464
+ return 53;
465
+ case 47:
466
+ this.begin("string");
467
+ break;
468
+ case 48:
469
+ this.popState();
470
+ break;
471
+ case 49:
472
+ return "qString";
473
+ case 50:
474
+ return l.yytext = l.yytext.trim(), 62;
475
+ }
476
+ }, "anonymous"),
477
+ rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i],
478
+ conditions: { acc_descr_multiline: { rules: [6, 7], inclusive: !1 }, acc_descr: { rules: [4], inclusive: !1 }, acc_title: { rules: [2], inclusive: !1 }, unqString: { rules: [], inclusive: !1 }, token: { rules: [], inclusive: !1 }, string: { rules: [48, 49], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50], inclusive: !0 } }
479
+ };
480
+ return $;
481
+ }();
482
+ ne.lexer = $e;
483
+ function ee() {
484
+ this.yy = {};
485
+ }
486
+ return r(ee, "Parser"), ee.prototype = ne, ne.Parser = ee, new ee();
487
+ }();
488
+ he.parser = he;
489
+ var Ke = he, de = [], T = {}, G = /* @__PURE__ */ new Map(), L = {}, z = /* @__PURE__ */ new Map(), Ge = {
490
+ REQUIREMENT: "Requirement",
491
+ FUNCTIONAL_REQUIREMENT: "Functional Requirement",
492
+ INTERFACE_REQUIREMENT: "Interface Requirement",
493
+ PERFORMANCE_REQUIREMENT: "Performance Requirement",
494
+ PHYSICAL_REQUIREMENT: "Physical Requirement",
495
+ DESIGN_CONSTRAINT: "Design Constraint"
496
+ }, ze = {
497
+ LOW_RISK: "Low",
498
+ MED_RISK: "Medium",
499
+ HIGH_RISK: "High"
500
+ }, je = {
501
+ VERIFY_ANALYSIS: "Analysis",
502
+ VERIFY_DEMONSTRATION: "Demonstration",
503
+ VERIFY_INSPECTION: "Inspection",
504
+ VERIFY_TEST: "Test"
505
+ }, Xe = {
506
+ CONTAINS: "contains",
507
+ COPIES: "copies",
508
+ DERIVES: "derives",
509
+ SATISFIES: "satisfies",
510
+ VERIFIES: "verifies",
511
+ REFINES: "refines",
512
+ TRACES: "traces"
513
+ }, Je = /* @__PURE__ */ r((e, t) => (G.has(e) || G.set(e, {
514
+ name: e,
515
+ type: t,
516
+ id: T.id,
517
+ text: T.text,
518
+ risk: T.risk,
519
+ verifyMethod: T.verifyMethod
520
+ }), T = {}, G.get(e)), "addRequirement"), Ze = /* @__PURE__ */ r(() => G, "getRequirements"), et = /* @__PURE__ */ r((e) => {
521
+ T !== void 0 && (T.id = e);
522
+ }, "setNewReqId"), tt = /* @__PURE__ */ r((e) => {
523
+ T !== void 0 && (T.text = e);
524
+ }, "setNewReqText"), it = /* @__PURE__ */ r((e) => {
525
+ T !== void 0 && (T.risk = e);
526
+ }, "setNewReqRisk"), rt = /* @__PURE__ */ r((e) => {
527
+ T !== void 0 && (T.verifyMethod = e);
528
+ }, "setNewReqVerifyMethod"), nt = /* @__PURE__ */ r((e) => (z.has(e) || (z.set(e, {
529
+ name: e,
530
+ type: L.type,
531
+ docRef: L.docRef
532
+ }), xe.info("Added new requirement: ", e)), L = {}, z.get(e)), "addElement"), st = /* @__PURE__ */ r(() => z, "getElements"), at = /* @__PURE__ */ r((e) => {
533
+ L !== void 0 && (L.type = e);
534
+ }, "setNewElementType"), lt = /* @__PURE__ */ r((e) => {
535
+ L !== void 0 && (L.docRef = e);
536
+ }, "setNewElementDocRef"), ot = /* @__PURE__ */ r((e, t, c) => {
537
+ de.push({
538
+ type: e,
539
+ src: t,
540
+ dst: c
541
+ });
542
+ }, "addRelationship"), ct = /* @__PURE__ */ r(() => de, "getRelationships"), ht = /* @__PURE__ */ r(() => {
543
+ de = [], T = {}, G = /* @__PURE__ */ new Map(), L = {}, z = /* @__PURE__ */ new Map(), Ue();
544
+ }, "clear"), ut = {
545
+ RequirementType: Ge,
546
+ RiskLevel: ze,
547
+ VerifyType: je,
548
+ Relationships: Xe,
549
+ getConfig: /* @__PURE__ */ r(() => ve().req, "getConfig"),
550
+ addRequirement: Je,
551
+ getRequirements: Ze,
552
+ setNewReqId: et,
553
+ setNewReqText: tt,
554
+ setNewReqRisk: it,
555
+ setNewReqVerifyMethod: rt,
556
+ setAccTitle: Fe,
557
+ getAccTitle: De,
558
+ setAccDescription: Pe,
559
+ getAccDescription: Ye,
560
+ addElement: nt,
561
+ getElements: st,
562
+ setNewElementType: at,
563
+ setNewElementDocRef: lt,
564
+ addRelationship: ot,
565
+ getRelationships: ct,
566
+ clear: ht
567
+ }, dt = /* @__PURE__ */ r((e) => `
568
+
569
+ marker {
570
+ fill: ${e.relationColor};
571
+ stroke: ${e.relationColor};
572
+ }
573
+
574
+ marker.cross {
575
+ stroke: ${e.lineColor};
576
+ }
577
+
578
+ svg {
579
+ font-family: ${e.fontFamily};
580
+ font-size: ${e.fontSize};
581
+ }
582
+
583
+ .reqBox {
584
+ fill: ${e.requirementBackground};
585
+ fill-opacity: 1.0;
586
+ stroke: ${e.requirementBorderColor};
587
+ stroke-width: ${e.requirementBorderSize};
588
+ }
589
+
590
+ .reqTitle, .reqLabel{
591
+ fill: ${e.requirementTextColor};
592
+ }
593
+ .reqLabelBox {
594
+ fill: ${e.relationLabelBackground};
595
+ fill-opacity: 1.0;
596
+ }
597
+
598
+ .req-title-line {
599
+ stroke: ${e.requirementBorderColor};
600
+ stroke-width: ${e.requirementBorderSize};
601
+ }
602
+ .relationshipLine {
603
+ stroke: ${e.relationColor};
604
+ stroke-width: 1;
605
+ }
606
+ .relationshipLabel {
607
+ fill: ${e.relationLabelColor};
608
+ }
609
+
610
+ `, "getStyles"), pt = dt, ue = {
611
+ CONTAINS: "contains",
612
+ ARROW: "arrow"
613
+ }, ft = /* @__PURE__ */ r((e, t) => {
614
+ let c = e.append("defs").append("marker").attr("id", ue.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", t.line_height / 2).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("g");
615
+ c.append("circle").attr("cx", t.line_height / 2).attr("cy", t.line_height / 2).attr("r", t.line_height / 2).attr("fill", "none"), c.append("line").attr("x1", 0).attr("x2", t.line_height).attr("y1", t.line_height / 2).attr("y2", t.line_height / 2).attr("stroke-width", 1), c.append("line").attr("y1", 0).attr("y2", t.line_height).attr("x1", t.line_height / 2).attr("x2", t.line_height / 2).attr("stroke-width", 1), e.append("defs").append("marker").attr("id", ue.ARROW + "_line_ending").attr("refX", t.line_height).attr("refY", 0.5 * t.line_height).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("path").attr(
616
+ "d",
617
+ `M0,0
618
+ L${t.line_height},${t.line_height / 2}
619
+ M${t.line_height},${t.line_height / 2}
620
+ L0,${t.line_height}`
621
+ ).attr("stroke-width", 1);
622
+ }, "insertLineEndings"), we = {
623
+ ReqMarkers: ue,
624
+ insertLineEndings: ft
625
+ }, _ = {}, Ne = 0, Ae = /* @__PURE__ */ r((e, t) => e.insert("rect", "#" + t).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", _.rect_min_width + "px").attr("height", _.rect_min_height + "px"), "newRectNode"), qe = /* @__PURE__ */ r((e, t, c) => {
626
+ let d = _.rect_min_width / 2, u = e.append("text").attr("class", "req reqLabel reqTitle").attr("id", t).attr("x", d).attr("y", _.rect_padding).attr("dominant-baseline", "hanging"), p = 0;
627
+ c.forEach((g) => {
628
+ p == 0 ? u.append("tspan").attr("text-anchor", "middle").attr("x", _.rect_min_width / 2).attr("dy", 0).text(g) : u.append("tspan").attr("text-anchor", "middle").attr("x", _.rect_min_width / 2).attr("dy", _.line_height * 0.75).text(g), p++;
629
+ });
630
+ let y = 1.5 * _.rect_padding, h = p * _.line_height * 0.75, o = y + h;
631
+ return e.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", _.rect_min_width).attr("y1", o).attr("y2", o), {
632
+ titleNode: u,
633
+ y: o
634
+ };
635
+ }, "newTitleNode"), Ve = /* @__PURE__ */ r((e, t, c, d) => {
636
+ let u = e.append("text").attr("class", "req reqLabel").attr("id", t).attr("x", _.rect_padding).attr("y", d).attr("dominant-baseline", "hanging"), p = 0;
637
+ const y = 30;
638
+ let h = [];
639
+ return c.forEach((o) => {
640
+ let g = o.length;
641
+ for (; g > y && p < 3; ) {
642
+ let R = o.substring(0, y);
643
+ o = o.substring(y, o.length), g = o.length, h[h.length] = R, p++;
644
+ }
645
+ if (p == 3) {
646
+ let R = h[h.length - 1];
647
+ h[h.length - 1] = R.substring(0, R.length - 4) + "...";
648
+ } else
649
+ h[h.length] = o;
650
+ p = 0;
651
+ }), h.forEach((o) => {
652
+ u.append("tspan").attr("x", _.rect_padding).attr("dy", _.line_height).text(o);
653
+ }), u;
654
+ }, "newBodyNode"), yt = /* @__PURE__ */ r((e, t, c, d) => {
655
+ const u = t.node().getTotalLength(), p = t.node().getPointAtLength(u * 0.5), y = "rel" + Ne;
656
+ Ne++;
657
+ const o = e.append("text").attr("class", "req relationshipLabel").attr("id", y).attr("x", p.x).attr("y", p.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(d).node().getBBox();
658
+ e.insert("rect", "#" + y).attr("class", "req reqLabelBox").attr("x", p.x - o.width / 2).attr("y", p.y - o.height / 2).attr("width", o.width).attr("height", o.height).attr("fill", "white").attr("fill-opacity", "85%");
659
+ }, "addEdgeLabel"), _t = /* @__PURE__ */ r(function(e, t, c, d, u) {
660
+ const p = c.edge(W(t.src), W(t.dst)), y = Qe().x(function(o) {
661
+ return o.x;
662
+ }).y(function(o) {
663
+ return o.y;
664
+ }), h = e.insert("path", "#" + d).attr("class", "er relationshipLine").attr("d", y(p.points)).attr("fill", "none");
665
+ t.type == u.db.Relationships.CONTAINS ? h.attr(
666
+ "marker-start",
667
+ "url(" + Te.getUrl(_.arrowMarkerAbsolute) + "#" + t.type + "_line_ending)"
668
+ ) : (h.attr("stroke-dasharray", "10,7"), h.attr(
669
+ "marker-end",
670
+ "url(" + Te.getUrl(_.arrowMarkerAbsolute) + "#" + we.ReqMarkers.ARROW + "_line_ending)"
671
+ )), yt(e, h, _, `<<${t.type}>>`);
672
+ }, "drawRelationshipFromLayout"), gt = /* @__PURE__ */ r((e, t, c) => {
673
+ e.forEach((d, u) => {
674
+ u = W(u), xe.info("Added new requirement: ", u);
675
+ const p = c.append("g").attr("id", u), y = "req-" + u, h = Ae(p, y);
676
+ let o = [], g = qe(p, u + "_title", [
677
+ `<<${d.type}>>`,
678
+ `${d.name}`
679
+ ]);
680
+ o.push(g.titleNode);
681
+ let R = Ve(
682
+ p,
683
+ u + "_body",
684
+ [
685
+ `Id: ${d.id}`,
686
+ `Text: ${d.text}`,
687
+ `Risk: ${d.risk}`,
688
+ `Verification: ${d.verifyMethod}`
689
+ ],
690
+ g.y
691
+ );
692
+ o.push(R);
693
+ const I = h.node().getBBox();
694
+ t.setNode(u, {
695
+ width: I.width,
696
+ height: I.height,
697
+ shape: "rect",
698
+ id: u
699
+ });
700
+ });
701
+ }, "drawReqs"), Et = /* @__PURE__ */ r((e, t, c) => {
702
+ e.forEach((d, u) => {
703
+ const p = W(u), y = c.append("g").attr("id", p), h = "element-" + p, o = Ae(y, h);
704
+ let g = [], R = qe(y, h + "_title", ["<<Element>>", `${u}`]);
705
+ g.push(R.titleNode);
706
+ let I = Ve(
707
+ y,
708
+ h + "_body",
709
+ [`Type: ${d.type || "Not Specified"}`, `Doc Ref: ${d.docRef || "None"}`],
710
+ R.y
711
+ );
712
+ g.push(I);
713
+ const b = o.node().getBBox();
714
+ t.setNode(p, {
715
+ width: b.width,
716
+ height: b.height,
717
+ shape: "rect",
718
+ id: p
719
+ });
720
+ });
721
+ }, "drawElements"), Rt = /* @__PURE__ */ r((e, t) => (e.forEach(function(c) {
722
+ let d = W(c.src), u = W(c.dst);
723
+ t.setEdge(d, u, { relationship: c });
724
+ }), e), "addRelationships"), mt = /* @__PURE__ */ r(function(e, t) {
725
+ t.nodes().forEach(function(c) {
726
+ c !== void 0 && t.node(c) !== void 0 && (e.select("#" + c), e.select("#" + c).attr(
727
+ "transform",
728
+ "translate(" + (t.node(c).x - t.node(c).width / 2) + "," + (t.node(c).y - t.node(c).height / 2) + " )"
729
+ ));
730
+ });
731
+ }, "adjustEntities"), W = /* @__PURE__ */ r((e) => e.replace(/\s/g, "").replace(/\./g, "_"), "elementString"), It = /* @__PURE__ */ r((e, t, c, d) => {
732
+ _ = ve().requirement;
733
+ const u = _.securityLevel;
734
+ let p;
735
+ u === "sandbox" && (p = ce("#i" + t));
736
+ const h = (u === "sandbox" ? ce(p.nodes()[0].contentDocument.body) : ce("body")).select(`[id='${t}']`);
737
+ we.insertLineEndings(h, _);
738
+ const o = new He({
739
+ multigraph: !1,
740
+ compound: !1,
741
+ directed: !0
742
+ }).setGraph({
743
+ rankdir: _.layoutDirection,
744
+ marginx: 20,
745
+ marginy: 20,
746
+ nodesep: 100,
747
+ edgesep: 100,
748
+ ranksep: 100
749
+ }).setDefaultEdgeLabel(function() {
750
+ return {};
751
+ });
752
+ let g = d.db.getRequirements(), R = d.db.getElements(), I = d.db.getRelationships();
753
+ gt(g, o, h), Et(R, o, h), Rt(I, o), We(o), mt(h, o), I.forEach(function(A) {
754
+ _t(h, A, o, t, d);
755
+ });
756
+ const b = _.rect_padding, w = h.node().getBBox(), q = w.width + b * 2, v = w.height + b * 2;
757
+ Be(h, v, q, _.useMaxWidth), h.attr("viewBox", `${w.x - b} ${w.y - b} ${q} ${v}`);
758
+ }, "draw"), bt = {
759
+ draw: It
760
+ }, Nt = {
761
+ parser: Ke,
762
+ db: ut,
763
+ renderer: bt,
764
+ styles: pt
765
+ };
766
+ export {
767
+ Nt as diagram
768
+ };