@wandox/sdk 0.1.0
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.
- package/README.md +59 -0
- package/dist/arc-BJMRTG9S.cjs +1 -0
- package/dist/arc-Vdco0qfw.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BjEqcvey.js +4695 -0
- package/dist/architectureDiagram-3BPJPVTR-BvjJfAkh.cjs +36 -0
- package/dist/blockDiagram-GPEHLZMM-B1xf7RE9.js +2427 -0
- package/dist/blockDiagram-GPEHLZMM-B5VqovGY.cjs +132 -0
- package/dist/c4Diagram-AAUBKEIU-C4kjMRea.js +1578 -0
- package/dist/c4Diagram-AAUBKEIU-Ck5uEnJI.cjs +10 -0
- package/dist/channel-DlRtLuYv.js +5 -0
- package/dist/channel-Dm_yrRYJ.cjs +1 -0
- package/dist/chunk-2J33WTMH-CG2n_n4y.cjs +1 -0
- package/dist/chunk-2J33WTMH-CWvmGb4H.js +20 -0
- package/dist/chunk-4BX2VUAB-Bq3GzsD8.js +9 -0
- package/dist/chunk-4BX2VUAB-CdMctZeT.cjs +1 -0
- package/dist/chunk-55IACEB6-BdJhzL0d.js +8 -0
- package/dist/chunk-55IACEB6-sHyHtvg8.cjs +1 -0
- package/dist/chunk-727SXJPM-D-Vmam30.cjs +206 -0
- package/dist/chunk-727SXJPM-DmruCqjM.js +1529 -0
- package/dist/chunk-AQP2D5EJ-CWhKjcV3.cjs +231 -0
- package/dist/chunk-AQP2D5EJ-Ca0ak6w7.js +1399 -0
- package/dist/chunk-FMBD7UC4-CqV0NWQQ.js +19 -0
- package/dist/chunk-FMBD7UC4-DOxtd0OO.cjs +15 -0
- package/dist/chunk-ND2GUHAM-6EMX5Mu8.js +68 -0
- package/dist/chunk-ND2GUHAM-BXeDBtSC.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B7FSI55w.js +15 -0
- package/dist/chunk-QZHKN3VN-CbbdNKnD.cjs +1 -0
- package/dist/classDiagram-4FO5ZUOK-0Kaf7WfA.js +16 -0
- package/dist/classDiagram-4FO5ZUOK-C4it2xBI.cjs +1 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Byom5adL.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-C4it2xBI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CuUv9oIm.js +2606 -0
- package/dist/cose-bilkent-S5V4N54A-Dh6nTopA.cjs +1 -0
- package/dist/cytoscape.esm-Cp8cXbK2.js +18729 -0
- package/dist/cytoscape.esm-fcqEUasK.cjs +331 -0
- package/dist/dagre-BM42HDAG-CwxJjZ2n.cjs +4 -0
- package/dist/dagre-BM42HDAG-DMBidMxP.js +448 -0
- package/dist/defaultLocale-BDVPUiG2.js +171 -0
- package/dist/defaultLocale-k2G_58r6.cjs +1 -0
- package/dist/diagram-2AECGRRQ-B2a4nXgJ.js +221 -0
- package/dist/diagram-2AECGRRQ-r7De7taS.cjs +43 -0
- package/dist/diagram-5GNKFQAL-CDiO79WC.cjs +10 -0
- package/dist/diagram-5GNKFQAL-DrHBNZzF.js +123 -0
- package/dist/diagram-KO2AKTUF-BcjWCXZr.js +466 -0
- package/dist/diagram-KO2AKTUF-CDlJCxVO.cjs +3 -0
- package/dist/diagram-LMA3HP47-BXFSAyNV.cjs +24 -0
- package/dist/diagram-LMA3HP47-DJxmyqn0.js +143 -0
- package/dist/diagram-OG6HWLK6-ATK__ca8.js +531 -0
- package/dist/diagram-OG6HWLK6-CgIyEO8_.cjs +24 -0
- package/dist/erDiagram-TEJ5UH35-D4baWNzQ.js +900 -0
- package/dist/erDiagram-TEJ5UH35-Dyuc5EB6.cjs +85 -0
- package/dist/flowDiagram-I6XJVG4X-BMZOncyU.js +1635 -0
- package/dist/flowDiagram-I6XJVG4X-C45fICr4.cjs +162 -0
- package/dist/ganttDiagram-6RSMTGT7-CiYZmmke.js +2526 -0
- package/dist/ganttDiagram-6RSMTGT7-Cxoj6IK8.cjs +292 -0
- package/dist/gitGraphDiagram-PVQCEYII-CQ9bNuwN.js +828 -0
- package/dist/gitGraphDiagram-PVQCEYII-rlaY9dfj.cjs +106 -0
- package/dist/graph-CBizzZ7K.js +1545 -0
- package/dist/graph-V5BNIbHU.cjs +1 -0
- package/dist/index-jBRold1l.js +173159 -0
- package/dist/index-sFrjovbM.cjs +804 -0
- package/dist/index.d.ts +54 -0
- package/dist/infoDiagram-5YYISTIA-CAzYIvUX.js +24 -0
- package/dist/infoDiagram-5YYISTIA-zX5rQglQ.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-09prKBsn.cjs +70 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Co8BnN24.js +622 -0
- package/dist/journeyDiagram-JHISSGLW-DkdWRF_-.cjs +139 -0
- package/dist/journeyDiagram-JHISSGLW-riCLiMCC.js +836 -0
- package/dist/kanban-definition-UN3LZRKU-DWipOCsx.cjs +89 -0
- package/dist/kanban-definition-UN3LZRKU-SRyCSn2H.js +725 -0
- package/dist/katex-Cf_UVKIT.cjs +257 -0
- package/dist/katex-RNjvZ8pg.js +11681 -0
- package/dist/layout-CbksXFOD.js +1728 -0
- package/dist/layout-Dh52gsIJ.cjs +1 -0
- package/dist/linear-C3xSMJV8.cjs +1 -0
- package/dist/linear-CmUCzX9U.js +259 -0
- package/dist/mermaid.core-BzNKr-OJ.cjs +308 -0
- package/dist/mermaid.core-CdBIz6FY.js +15475 -0
- package/dist/mindmap-definition-RKZ34NQL-Cs63oyIX.cjs +96 -0
- package/dist/mindmap-definition-RKZ34NQL-Gcma5iTd.js +830 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pieDiagram-4H26LBE5-CBGkD8dp.cjs +30 -0
- package/dist/pieDiagram-4H26LBE5-DSL8cVK1.js +164 -0
- package/dist/quadrantDiagram-W4KKPZXB-D3nCWRjF.cjs +7 -0
- package/dist/quadrantDiagram-W4KKPZXB-uod6bhUy.js +1026 -0
- package/dist/requirementDiagram-4Y6WPE33-Bc_6y7SM.js +884 -0
- package/dist/requirementDiagram-4Y6WPE33-D2mHlh5i.cjs +84 -0
- package/dist/sankeyDiagram-5OEKKPKP-DL_kXejW.cjs +40 -0
- package/dist/sankeyDiagram-5OEKKPKP-DMsjY4G4.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-CBGalGOV.cjs +162 -0
- package/dist/sequenceDiagram-3UESZ5HK-CH2Z-Pis.js +2901 -0
- package/dist/stateDiagram-AJRCARHV-gEqlAI6t.js +263 -0
- package/dist/stateDiagram-AJRCARHV-rNMrAI-A.cjs +1 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CDj7L1wi.js +16 -0
- package/dist/stateDiagram-v2-BHNVJYJU-LLlFJ1GM.cjs +1 -0
- package/dist/timeline-definition-PNZ67QCA-Bbuv3uu-.cjs +120 -0
- package/dist/timeline-definition-PNZ67QCA-DrGFbQdC.js +1068 -0
- package/dist/types.d.ts +295 -0
- package/dist/vennDiagram-CIIHVFJN-CGcAwVxU.js +1564 -0
- package/dist/vennDiagram-CIIHVFJN-DsSjXluJ.cjs +34 -0
- package/dist/wandox.cjs +1 -0
- package/dist/wandox.css +1 -0
- package/dist/wandox.js +6 -0
- package/dist/wandox.umd.js +4172 -0
- package/dist/wardley-L42UT6IY-DUnkyH_z.js +22539 -0
- package/dist/wardley-L42UT6IY-tDp0NbFW.cjs +165 -0
- package/dist/wardleyDiagram-YWT4CUSO-CB_Qa4lR.js +684 -0
- package/dist/wardleyDiagram-YWT4CUSO-D0BUmvVW.cjs +78 -0
- package/dist/xychartDiagram-2RQKCTM6-Bcq-ACuw.js +1342 -0
- package/dist/xychartDiagram-2RQKCTM6-BjeAPKLo.cjs +7 -0
- package/package.json +42 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { b as R, s as W, S as N } from "./chunk-AQP2D5EJ-Ca0ak6w7.js";
|
|
2
|
+
import { b as f, a2 as t, aZ as H, aB as S, E as P, z, ay as C, K as U, ad as _, bj as $ } from "./mermaid.core-CdBIz6FY.js";
|
|
3
|
+
import { G as F } from "./graph-CBizzZ7K.js";
|
|
4
|
+
import { l as O } from "./layout-CbksXFOD.js";
|
|
5
|
+
var J = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), X = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), D = /* @__PURE__ */ f((e, i) => {
|
|
6
|
+
const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
|
|
7
|
+
return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
|
|
8
|
+
}, "drawSimpleState"), Y = /* @__PURE__ */ f((e, i) => {
|
|
9
|
+
const d = /* @__PURE__ */ f(function(o, m, y) {
|
|
10
|
+
const E = o.append("tspan").attr("x", 2 * t().state.padding).text(m);
|
|
11
|
+
y || E.attr("dy", t().state.textHeight);
|
|
12
|
+
}, "addTspan"), n = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 1.3 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), l = n.height, p = e.append("text").attr("x", t().state.padding).attr(
|
|
13
|
+
"y",
|
|
14
|
+
l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
|
|
15
|
+
).attr("class", "state-description");
|
|
16
|
+
let a = !0, s = !0;
|
|
17
|
+
i.descriptions.forEach(function(o) {
|
|
18
|
+
a || (d(p, o, s), s = !1), a = !1;
|
|
19
|
+
});
|
|
20
|
+
const B = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + l + t().state.dividerMargin / 2).attr("y2", t().state.padding + l + t().state.dividerMargin / 2).attr("class", "descr-divider"), x = p.node().getBBox(), g = Math.max(x.width, n.width);
|
|
21
|
+
return B.attr("x2", g + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", g + 2 * t().state.padding).attr("height", x.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;
|
|
22
|
+
}, "drawDescrState"), I = /* @__PURE__ */ f((e, i, d) => {
|
|
23
|
+
const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), p = l.width, a = l.x, s = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), x = s.node().getBBox().width + n;
|
|
24
|
+
let g = Math.max(x, p);
|
|
25
|
+
g === p && (g = g + n);
|
|
26
|
+
let o;
|
|
27
|
+
const m = e.node().getBBox();
|
|
28
|
+
i.doc, o = a - c, x > p && (o = (p - g) / 2 + c), Math.abs(a - m.x) < c && x > p && (o = a - (x - p) / 2);
|
|
29
|
+
const y = 1 - t().state.textHeight;
|
|
30
|
+
return e.insert("rect", ":first-child").attr("x", o).attr("y", y).attr("class", d ? "alt-composit" : "composit").attr("width", g).attr(
|
|
31
|
+
"height",
|
|
32
|
+
m.height + t().state.textHeight + t().state.titleShift + 1
|
|
33
|
+
).attr("rx", "0"), s.attr("x", o + c), x <= p && s.attr("x", a + (g - n) / 2 - x / 2 + c), e.insert("rect", ":first-child").attr("x", o).attr(
|
|
34
|
+
"y",
|
|
35
|
+
t().state.titleShift - t().state.textHeight - t().state.padding
|
|
36
|
+
).attr("width", g).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", o).attr(
|
|
37
|
+
"y",
|
|
38
|
+
t().state.titleShift - t().state.textHeight - t().state.padding
|
|
39
|
+
).attr("width", g).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
|
|
40
|
+
}, "addTitleAndBox"), Z = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
|
|
41
|
+
"cx",
|
|
42
|
+
t().state.padding + t().state.sizeUnit + t().state.miniPadding
|
|
43
|
+
).attr(
|
|
44
|
+
"cy",
|
|
45
|
+
t().state.padding + t().state.sizeUnit + t().state.miniPadding
|
|
46
|
+
), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), j = /* @__PURE__ */ f((e, i) => {
|
|
47
|
+
let d = t().state.forkWidth, c = t().state.forkHeight;
|
|
48
|
+
if (i.parentId) {
|
|
49
|
+
let n = d;
|
|
50
|
+
d = c, c = n;
|
|
51
|
+
}
|
|
52
|
+
return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
|
|
53
|
+
}, "drawForkJoinState"), q = /* @__PURE__ */ f((e, i, d, c) => {
|
|
54
|
+
let n = 0;
|
|
55
|
+
const l = c.append("text");
|
|
56
|
+
l.style("text-anchor", "start"), l.attr("class", "noteText");
|
|
57
|
+
let p = e.replace(/\r\n/g, "<br/>");
|
|
58
|
+
p = p.replace(/\n/g, "<br/>");
|
|
59
|
+
const a = p.split(z.lineBreakRegex);
|
|
60
|
+
let s = 1.25 * t().state.noteMargin;
|
|
61
|
+
for (const B of a) {
|
|
62
|
+
const x = B.trim();
|
|
63
|
+
if (x.length > 0) {
|
|
64
|
+
const g = l.append("tspan");
|
|
65
|
+
if (g.text(x), s === 0) {
|
|
66
|
+
const o = g.node().getBBox();
|
|
67
|
+
s += o.height;
|
|
68
|
+
}
|
|
69
|
+
n += s, g.attr("x", i + t().state.noteMargin), g.attr("y", d + n + 1.25 * t().state.noteMargin);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { textWidth: l.node().getBBox().width, textHeight: n };
|
|
73
|
+
}, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => {
|
|
74
|
+
i.attr("class", "state-note");
|
|
75
|
+
const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = q(e, 0, 0, c);
|
|
76
|
+
return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
|
|
77
|
+
}, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
|
|
78
|
+
const d = i.id, c = {
|
|
79
|
+
id: d,
|
|
80
|
+
label: i.id,
|
|
81
|
+
width: 0,
|
|
82
|
+
height: 0
|
|
83
|
+
}, n = e.append("g").attr("id", d).attr("class", "stateGroup");
|
|
84
|
+
i.type === "start" && J(n), i.type === "end" && Z(n), (i.type === "fork" || i.type === "join") && j(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && X(n), i.type === "default" && i.descriptions.length === 0 && D(n, i), i.type === "default" && i.descriptions.length > 0 && Y(n, i);
|
|
85
|
+
const l = n.node().getBBox();
|
|
86
|
+
return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
|
|
87
|
+
}, "drawState"), G = 0, Q = /* @__PURE__ */ f(function(e, i, d) {
|
|
88
|
+
const c = /* @__PURE__ */ f(function(s) {
|
|
89
|
+
switch (s) {
|
|
90
|
+
case N.relationType.AGGREGATION:
|
|
91
|
+
return "aggregation";
|
|
92
|
+
case N.relationType.EXTENSION:
|
|
93
|
+
return "extension";
|
|
94
|
+
case N.relationType.COMPOSITION:
|
|
95
|
+
return "composition";
|
|
96
|
+
case N.relationType.DEPENDENCY:
|
|
97
|
+
return "dependency";
|
|
98
|
+
}
|
|
99
|
+
}, "getRelationType");
|
|
100
|
+
i.points = i.points.filter((s) => !Number.isNaN(s.y));
|
|
101
|
+
const n = i.points, l = C().x(function(s) {
|
|
102
|
+
return s.x;
|
|
103
|
+
}).y(function(s) {
|
|
104
|
+
return s.y;
|
|
105
|
+
}).curve(U), p = e.append("path").attr("d", l(n)).attr("id", "edge" + G).attr("class", "transition");
|
|
106
|
+
let a = "";
|
|
107
|
+
if (t().state.arrowMarkerAbsolute && (a = _(!0)), p.attr(
|
|
108
|
+
"marker-end",
|
|
109
|
+
"url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
|
|
110
|
+
), d.title !== void 0) {
|
|
111
|
+
const s = e.append("g").attr("class", "stateLabel"), { x: B, y: x } = $.calcLabelPosition(i.points), g = z.getRows(d.title);
|
|
112
|
+
let o = 0;
|
|
113
|
+
const m = [];
|
|
114
|
+
let y = 0, E = 0;
|
|
115
|
+
for (let u = 0; u <= g.length; u++) {
|
|
116
|
+
const h = s.append("text").attr("text-anchor", "middle").text(g[u]).attr("x", B).attr("y", x + o), w = h.node().getBBox();
|
|
117
|
+
y = Math.max(y, w.width), E = Math.min(E, w.x), S.info(w.x, B, x + o), o === 0 && (o = h.node().getBBox().height, S.info("Title height", o, x)), m.push(h);
|
|
118
|
+
}
|
|
119
|
+
let k = o * g.length;
|
|
120
|
+
if (g.length > 1) {
|
|
121
|
+
const u = (g.length - 1) * o * 0.5;
|
|
122
|
+
m.forEach((h, w) => h.attr("y", x + w * o - u)), k = o * g.length;
|
|
123
|
+
}
|
|
124
|
+
const r = s.node().getBBox();
|
|
125
|
+
s.insert("rect", ":first-child").attr("class", "box").attr("x", B - y / 2 - t().state.padding / 2).attr("y", x - k / 2 - t().state.padding / 2 - 3.5).attr("width", y + t().state.padding).attr("height", k + t().state.padding), S.info(r);
|
|
126
|
+
}
|
|
127
|
+
G++;
|
|
128
|
+
}, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {
|
|
129
|
+
}, "setConf"), tt = /* @__PURE__ */ f(function(e) {
|
|
130
|
+
e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
131
|
+
}, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
|
|
132
|
+
b = t().state;
|
|
133
|
+
const n = t().securityLevel;
|
|
134
|
+
let l;
|
|
135
|
+
n === "sandbox" && (l = H("#i" + i));
|
|
136
|
+
const p = n === "sandbox" ? H(l.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document;
|
|
137
|
+
S.debug("Rendering diagram " + e);
|
|
138
|
+
const s = p.select(`[id='${i}']`);
|
|
139
|
+
tt(s);
|
|
140
|
+
const B = c.db.getRootDoc(), x = s.append("g").attr("id", i + "-root");
|
|
141
|
+
A(B, x, void 0, !1, p, a, c);
|
|
142
|
+
const g = b.padding, o = s.node().getBBox(), m = o.width + g * 2, y = o.height + g * 2, E = m * 1.75;
|
|
143
|
+
P(s, y, E, b.useMaxWidth), s.attr(
|
|
144
|
+
"viewBox",
|
|
145
|
+
`${o.x - b.padding} ${o.y - b.padding} ` + m + " " + y
|
|
146
|
+
);
|
|
147
|
+
}, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), A = /* @__PURE__ */ f((e, i, d, c, n, l, p) => {
|
|
148
|
+
const a = new F({
|
|
149
|
+
compound: !0,
|
|
150
|
+
multigraph: !0
|
|
151
|
+
});
|
|
152
|
+
let s, B = !0;
|
|
153
|
+
for (s = 0; s < e.length; s++)
|
|
154
|
+
if (e[s].stmt === "relation") {
|
|
155
|
+
B = !1;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
d ? a.setGraph({
|
|
159
|
+
rankdir: "LR",
|
|
160
|
+
multigraph: !0,
|
|
161
|
+
compound: !0,
|
|
162
|
+
// acyclicer: 'greedy',
|
|
163
|
+
ranker: "tight-tree",
|
|
164
|
+
ranksep: B ? 1 : b.edgeLengthFactor,
|
|
165
|
+
nodeSep: B ? 1 : 50,
|
|
166
|
+
isMultiGraph: !0
|
|
167
|
+
// ranksep: 5,
|
|
168
|
+
// nodesep: 1
|
|
169
|
+
}) : a.setGraph({
|
|
170
|
+
rankdir: "TB",
|
|
171
|
+
multigraph: !0,
|
|
172
|
+
compound: !0,
|
|
173
|
+
// isCompound: true,
|
|
174
|
+
// acyclicer: 'greedy',
|
|
175
|
+
// ranker: 'longest-path'
|
|
176
|
+
ranksep: B ? 1 : b.edgeLengthFactor,
|
|
177
|
+
nodeSep: B ? 1 : 50,
|
|
178
|
+
ranker: "tight-tree",
|
|
179
|
+
// ranker: 'network-simplex'
|
|
180
|
+
isMultiGraph: !0
|
|
181
|
+
}), a.setDefaultEdgeLabel(function() {
|
|
182
|
+
return {};
|
|
183
|
+
});
|
|
184
|
+
const x = p.db.getStates(), g = p.db.getRelations(), o = Object.keys(x);
|
|
185
|
+
for (const r of o) {
|
|
186
|
+
const u = x[r];
|
|
187
|
+
d && (u.parentId = d);
|
|
188
|
+
let h;
|
|
189
|
+
if (u.doc) {
|
|
190
|
+
let w = i.append("g").attr("id", u.id).attr("class", "stateGroup");
|
|
191
|
+
h = A(u.doc, w, u.id, !c, n, l, p);
|
|
192
|
+
{
|
|
193
|
+
w = I(w, u, c);
|
|
194
|
+
let v = w.node().getBBox();
|
|
195
|
+
h.width = v.width, h.height = v.height + b.padding / 2, T[u.id] = { y: b.compositTitleSize };
|
|
196
|
+
}
|
|
197
|
+
} else
|
|
198
|
+
h = L(i, u, a);
|
|
199
|
+
if (u.note) {
|
|
200
|
+
const w = {
|
|
201
|
+
descriptions: [],
|
|
202
|
+
id: u.id + "-note",
|
|
203
|
+
note: u.note,
|
|
204
|
+
type: "note"
|
|
205
|
+
}, v = L(i, w, a);
|
|
206
|
+
u.note.position === "left of" ? (a.setNode(h.id + "-note", v), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", v)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
|
|
207
|
+
} else
|
|
208
|
+
a.setNode(h.id, h);
|
|
209
|
+
}
|
|
210
|
+
S.debug("Count=", a.nodeCount(), a);
|
|
211
|
+
let m = 0;
|
|
212
|
+
g.forEach(function(r) {
|
|
213
|
+
m++, S.debug("Setting edge", r), a.setEdge(
|
|
214
|
+
r.id1,
|
|
215
|
+
r.id2,
|
|
216
|
+
{
|
|
217
|
+
relation: r,
|
|
218
|
+
width: at(r.title),
|
|
219
|
+
height: b.labelHeight * z.getRows(r.title).length,
|
|
220
|
+
labelpos: "c"
|
|
221
|
+
},
|
|
222
|
+
"id" + m
|
|
223
|
+
);
|
|
224
|
+
}), O(a), S.debug("Graph after layout", a.nodes());
|
|
225
|
+
const y = i.node();
|
|
226
|
+
a.nodes().forEach(function(r) {
|
|
227
|
+
r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + y.id + " #" + r).attr(
|
|
228
|
+
"transform",
|
|
229
|
+
"translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (T[r] ? T[r].y : 0) - a.node(r).height / 2) + " )"
|
|
230
|
+
), n.select("#" + y.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + y.id + " #" + r + " .divider").forEach((h) => {
|
|
231
|
+
const w = h.parentElement;
|
|
232
|
+
let v = 0, M = 0;
|
|
233
|
+
w && (w.parentElement && (v = w.parentElement.getBBox().width), M = parseInt(w.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", v - M - 8);
|
|
234
|
+
})) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
|
|
235
|
+
});
|
|
236
|
+
let E = y.getBBox();
|
|
237
|
+
a.edges().forEach(function(r) {
|
|
238
|
+
r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation));
|
|
239
|
+
}), E = y.getBBox();
|
|
240
|
+
const k = {
|
|
241
|
+
id: d || "root",
|
|
242
|
+
label: d || "root",
|
|
243
|
+
width: 0,
|
|
244
|
+
height: 0
|
|
245
|
+
};
|
|
246
|
+
return k.width = E.width + 2 * b.padding, k.height = E.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
|
|
247
|
+
}, "renderDoc"), it = {
|
|
248
|
+
setConf: V,
|
|
249
|
+
draw: et
|
|
250
|
+
}, ot = {
|
|
251
|
+
parser: W,
|
|
252
|
+
get db() {
|
|
253
|
+
return new N(1);
|
|
254
|
+
},
|
|
255
|
+
renderer: it,
|
|
256
|
+
styles: R,
|
|
257
|
+
init: /* @__PURE__ */ f((e) => {
|
|
258
|
+
e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
259
|
+
}, "init")
|
|
260
|
+
};
|
|
261
|
+
export {
|
|
262
|
+
ot as diagram
|
|
263
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./chunk-AQP2D5EJ-CWhKjcV3.cjs"),t=require("./mermaid.core-BzNKr-OJ.cjs"),T=require("./graph-V5BNIbHU.cjs"),H=require("./layout-Dh52gsIJ.cjs");var z=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),L=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),P=t.__name((e,n)=>{const d=t.__name(function(s,m,u){const B=s.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);u||B.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,h=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(s){i||(d(h,s,r),r=!1),i=!1});const y=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),p=h.node().getBBox(),c=Math.max(p.width,o.width);return y.attr("x2",c+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",c+2*t.getConfig2().state.padding).attr("height",p.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),G=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),h=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),p=r.node().getBBox().width+o;let c=Math.max(p,h);c===h&&(c=c+o);let s;const m=e.node().getBBox();n.doc,s=i-g,p>h&&(s=(h-c)/2+g),Math.abs(i-m.x)<g&&p>h&&(s=i-(p-h)/2);const u=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",s).attr("y",u).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",s+g),p<=h&&r.attr("x",i+(c-o)/2-p/2+g),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),R=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),W=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let h=e.replace(/\r\n/g,"<br/>");h=h.replace(/\n/g,"<br/>");const i=h.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const y of i){const p=y.trim();if(p.length>0){const c=l.append("tspan");if(c.text(p),r===0){const s=c.node().getBBox();r+=s.height}o+=r,c.attr("x",n+t.getConfig2().state.noteMargin),c.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),U=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),k=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&z(o),n.type==="end"&&R(o),(n.type==="fork"||n.type==="join")&&W(o,n),n.type==="note"&&U(n.note.text,o),n.type==="divider"&&L(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&P(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),N=0,$=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case S.StateDB.relationType.AGGREGATION:return"aggregation";case S.StateDB.relationType.EXTENSION:return"extension";case S.StateDB.relationType.COMPOSITION:return"composition";case S.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=t.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(t.curveBasis),h=e.append("path").attr("d",l(o)).attr("id","edge"+N).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),h.attr("marker-end","url("+i+"#"+g(S.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:y,y:p}=t.utils_default.calcLabelPosition(n.points),c=t.common_default.getRows(d.title);let s=0;const m=[];let u=0,B=0;for(let x=0;x<=c.length;x++){const f=r.append("text").attr("text-anchor","middle").text(c[x]).attr("x",y).attr("y",p+s),C=f.node().getBBox();u=Math.max(u,C.width),B=Math.min(B,C.x),t.log.info(C.x,y,p+s),s===0&&(s=f.node().getBBox().height,t.log.info("Title height",s,p)),m.push(f)}let _=s*c.length;if(c.length>1){const x=(c.length-1)*s*.5;m.forEach((f,C)=>f.attr("y",p+C*s-x)),_=s*c.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",y-u/2-t.getConfig2().state.padding/2).attr("y",p-_/2-t.getConfig2().state.padding/2-3.5).attr("width",u+t.getConfig2().state.padding).attr("height",_+t.getConfig2().state.padding),t.log.info(a)}N++},"drawEdge"),w,E={},F=t.__name(function(){},"setConf"),O=t.__name(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const h=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=h.select(`[id='${n}']`);O(r);const y=g.db.getRootDoc(),p=r.append("g").attr("id",n+"-root");M(y,p,void 0,!1,h,i,g);const c=w.padding,s=r.node().getBBox(),m=s.width+c*2,u=s.height+c*2,B=m*1.75;t.configureSvgSize(r,u,B,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+m+" "+u)},"draw"),q=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),M=t.__name((e,n,d,g,o,l,h)=>{const i=new T.Graph({compound:!0,multigraph:!0});let r,y=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){y=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const p=h.db.getStates(),c=h.db.getRelations(),s=Object.keys(p);for(const a of s){const x=p[a];d&&(x.parentId=d);let f;if(x.doc){let C=n.append("g").attr("id",x.id).attr("class","stateGroup");f=M(x.doc,C,x.id,!g,o,l,h);{C=G(C,x,g);let b=C.node().getBBox();f.width=b.width,f.height=b.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=k(n,x,i);if(x.note){const C={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},b=k(n,C,i);x.note.position==="left of"?(i.setNode(f.id+"-note",b),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",b)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;c.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:q(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),H.layout(i),t.log.debug("Graph after layout",i.nodes());const u=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+u.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+u.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+u.id+" #"+a+" .divider").forEach(f=>{const C=f.parentElement;let b=0,v=0;C&&(C.parentElement&&(b=C.parentElement.getBBox().width),v=parseInt(C.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",b-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let B=u.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),$(n,i.edge(a),i.edge(a).relation))}),B=u.getBBox();const _={id:d||"root",label:d||"root",width:0,height:0};return _.width=B.width+2*w.padding,_.height=B.height+2*w.padding,t.log.debug("Doc rendered",_,i),_},"renderDoc"),X={setConf:F,draw:J},Y={parser:S.stateDiagram_default,get db(){return new S.StateDB(1)},renderer:X,styles:S.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=Y;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { b as e, a as r, s as t, S as s } from "./chunk-AQP2D5EJ-Ca0ak6w7.js";
|
|
2
|
+
import { b as i } from "./mermaid.core-CdBIz6FY.js";
|
|
3
|
+
var m = {
|
|
4
|
+
parser: t,
|
|
5
|
+
get db() {
|
|
6
|
+
return new s(2);
|
|
7
|
+
},
|
|
8
|
+
renderer: r,
|
|
9
|
+
styles: e,
|
|
10
|
+
init: /* @__PURE__ */ i((a) => {
|
|
11
|
+
a.state || (a.state = {}), a.state.arrowMarkerAbsolute = a.arrowMarkerAbsolute;
|
|
12
|
+
}, "init")
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
m as diagram
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./chunk-AQP2D5EJ-CWhKjcV3.cjs"),t=require("./mermaid.core-BzNKr-OJ.cjs");var a={parser:r.stateDiagram_default,get db(){return new r.StateDB(2)},renderer:r.stateRenderer_v3_unified_default,styles:r.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=a;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./mermaid.core-BzNKr-OJ.cjs"),st=require("./arc-BJMRTG9S.cjs");var j=function(){var e=r.__name(function(x,s,h,d){for(h=h||{},d=x.length;d--;h[x[d]]=s);return h},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],a=[1,14],c=[1,15],o=[1,16],l=[1,19],g=[1,20],_={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:r.__name(function(s,h,d,p,m,u,w){var k=u.length-1;switch(m){case 1:return u[k-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[k-1].push(u[k]),this.$=u[k-1];break;case 7:case 8:this.$=u[k];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[k].substr(6)),this.$=u[k].substr(6);break;case 12:this.$=u[k].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[k].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[k].substr(8)),this.$=u[k].substr(8);break;case 18:p.addTask(u[k],0,""),this.$=u[k];break;case 19:p.addEvent(u[k].substr(2)),this.$=u[k];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:a,19:c,20:o,21:17,22:18,23:l,24:g},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:a,19:c,20:o,21:17,22:18,23:l,24:g},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:r.__name(function(s,h){if(h.recoverable)this.trace(s);else{var d=new Error(s);throw d.hash=h,d}},"parseError"),parse:r.__name(function(s){var h=this,d=[0],p=[],m=[null],u=[],w=this.table,k="",L=0,C=0,W=2,B=1,H=u.slice.call(arguments,1),b=Object.create(this.lexer),A={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(A.yy[V]=this.yy[V]);b.setInput(s,A.yy),A.yy.lexer=b,A.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var F=b.yylloc;u.push(F);var X=b.options&&b.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(M){d.length=d.length-2*M,m.length=m.length-M,u.length=u.length-M}r.__name(D,"popStack");function G(){var M;return M=p.pop()||b.lex()||B,typeof M!="number"&&(M instanceof Array&&(p=M,M=p.pop()),M=h.symbols_[M]||M),M}r.__name(G,"lex");for(var $,T,v,E,S={},I,N,P,O;;){if(T=d[d.length-1],this.defaultActions[T]?v=this.defaultActions[T]:(($===null||typeof $>"u")&&($=G()),v=w[T]&&w[T][$]),typeof v>"u"||!v.length||!v[0]){var q="";O=[];for(I in w[T])this.terminals_[I]&&I>W&&O.push("'"+this.terminals_[I]+"'");b.showPosition?q="Parse error on line "+(L+1)+`:
|
|
2
|
+
`+b.showPosition()+`
|
|
3
|
+
Expecting `+O.join(", ")+", got '"+(this.terminals_[$]||$)+"'":q="Parse error on line "+(L+1)+": Unexpected "+($==B?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[$]||$,line:b.yylineno,loc:F,expected:O})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+$);switch(v[0]){case 1:d.push($),m.push(b.yytext),u.push(b.yylloc),d.push(v[1]),$=null,C=b.yyleng,k=b.yytext,L=b.yylineno,F=b.yylloc;break;case 2:if(N=this.productions_[v[1]][1],S.$=m[m.length-N],S._$={first_line:u[u.length-(N||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(N||1)].first_column,last_column:u[u.length-1].last_column},X&&(S._$.range=[u[u.length-(N||1)].range[0],u[u.length-1].range[1]]),E=this.performAction.apply(S,[k,C,L,A.yy,v[1],m,u].concat(H)),typeof E<"u")return E;N&&(d=d.slice(0,-1*N*2),m=m.slice(0,-1*N),u=u.slice(0,-1*N)),d.push(this.productions_[v[1]][0]),m.push(S.$),u.push(S._$),P=w[d[d.length-2]][d[d.length-1]],d.push(P);break;case 3:return!0}}return!0},"parse")},y=function(){var x={EOF:1,parseError:r.__name(function(h,d){if(this.yy.parser)this.yy.parser.parseError(h,d);else throw new Error(h)},"parseError"),setInput:r.__name(function(s,h){return this.yy=h||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r.__name(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var h=s.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r.__name(function(s){var h=s.length,d=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===p.length?this.yylloc.first_column:0)+p[p.length-d.length].length-d[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:r.__name(function(){return this._more=!0,this},"more"),reject:r.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r.__name(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r.__name(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r.__name(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r.__name(function(){var s=this.pastInput(),h=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+h+"^"},"showPosition"),test_match:r.__name(function(s,h){var d,p,m;if(this.options.backtrack_lexer&&(m={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(m.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],d=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var u in m)this[u]=m[u];return!1}return!1},"test_match"),next:r.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,h,d,p;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),u=0;u<m.length;u++)if(d=this._input.match(this.rules[m[u]]),d&&(!h||d[0].length>h[0].length)){if(h=d,p=u,this.options.backtrack_lexer){if(s=this.test_match(d,m[u]),s!==!1)return s;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(s=this.test_match(h,m[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r.__name(function(){var h=this.next();return h||this.lex()},"lex"),begin:r.__name(function(h){this.conditionStack.push(h)},"begin"),popState:r.__name(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:r.__name(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:r.__name(function(h){this.begin(h)},"pushState"),stateStackSize:r.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r.__name(function(h,d,p,m){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return x}();_.lexer=y;function f(){this.yy={}}return r.__name(f,"Parser"),f.prototype=_,_.Parser=f,new f}();j.parser=j;var Lt=j,ht={};r.__export(ht,{addEvent:()=>vt,addSection:()=>mt,addTask:()=>kt,addTaskOrg:()=>bt,clear:()=>pt,default:()=>Mt,getCommonDb:()=>gt,getDirection:()=>_t,getSections:()=>yt,getTasks:()=>xt,setDirection:()=>ft});var K="",ut=0,tt="LR",et=[],Z=[],U=[],gt=r.__name(()=>r.commonDb_exports,"getCommonDb"),pt=r.__name(function(){et.length=0,Z.length=0,K="",U.length=0,tt="LR",r.clear()},"clear"),ft=r.__name(function(e){tt=e},"setDirection"),_t=r.__name(function(){return tt},"getDirection"),mt=r.__name(function(e){K=e,et.push(e)},"addSection"),yt=r.__name(function(){return et},"getSections"),xt=r.__name(function(){let e=it();const t=100;let n=0;for(;!e&&n<t;)e=it(),n++;return Z.push(...U),Z},"getTasks"),kt=r.__name(function(e,t,n){const i={id:ut++,section:K,type:K,task:e,score:t||0,events:n?[n]:[]};U.push(i)},"addTask"),vt=r.__name(function(e){U.find(n=>n.id===ut-1).events.push(e)},"addEvent"),bt=r.__name(function(e){const t={section:K,type:K,description:e,task:e,classes:[]};Z.push(t)},"addTaskOrg"),it=r.__name(function(){const e=r.__name(function(n){return U[n].processed},"compileTask");let t=!0;for(const[n,i]of U.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Mt={clear:pt,getCommonDb:gt,getDirection:_t,setDirection:ft,addSection:mt,getSections:yt,getTasks:xt,addTask:kt,addTaskOrg:bt,addEvent:vt},wt=0,J=r.__name(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),At=r.__name(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),a=e.append("g");a.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),a.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function c(g){const _=st.d3arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",_).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}r.__name(c,"smile");function o(g){const _=st.d3arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",_).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}r.__name(o,"sad");function l(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.__name(l,"ambivalent"),t.score>3?c(a):t.score<3?o(a):l(a),i},"drawFace"),Ct=r.__name(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),St=r.__name(function(e,t){const n=t.text.replace(/<br\s*\/?>/gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(n),i},"drawText"),Rt=r.__name(function(e,t){function n(a,c,o,l,g){return a+","+c+" "+(a+o)+","+c+" "+(a+o)+","+(c+l-g)+" "+(a+o-g*1.2)+","+(c+l)+" "+a+","+(c+l)}r.__name(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,St(e,t)},"drawLabel"),Wt=r.__name(function(e,t,n){const i=e.append("g"),a=nt();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="journey-section section-type-"+t.num,a.rx=3,a.ry=3,J(i,a),Et(n)(t.text,i,a.x,a.y,a.width,a.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),Y=-1,Pt=r.__name(function(e,t,n,i){const a=t.x+n.width/2,c=e.append("g");Y++;const o=300+5*30;c.append("line").attr("id",i+"-task"+Y).attr("x1",a).attr("y1",t.y).attr("x2",a).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),At(c,{cx:a,cy:300+(5-t.score)*30,score:t.score});const l=nt();l.x=t.x,l.y=t.y,l.fill=t.fill,l.width=n.width,l.height=n.height,l.class="task task-type-"+t.num,l.rx=3,l.ry=3,J(c,l),Et(n)(t.task,c,l.x,l.y,l.width,l.height,{class:"task"},n,t.colour)},"drawTask"),Bt=r.__name(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Vt=r.__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),nt=r.__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=function(){function e(a,c,o,l,g,_,y,f){const x=c.append("text").attr("x",o+g/2).attr("y",l+_/2+5).style("font-color",f).style("text-anchor","middle").text(a);i(x,y)}r.__name(e,"byText");function t(a,c,o,l,g,_,y,f,x){const{taskFontSize:s,taskFontFamily:h}=f,d=a.split(/<br\s*\/?>/gi);for(let p=0;p<d.length;p++){const m=p*s-s*(d.length-1)/2,u=c.append("text").attr("x",o+g/2).attr("y",l).attr("fill",x).style("text-anchor","middle").style("font-size",s).style("font-family",h);u.append("tspan").attr("x",o+g/2).attr("dy",m).text(d[p]),u.attr("y",l+_/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,y)}}r.__name(t,"byTspan");function n(a,c,o,l,g,_,y,f){const x=c.append("switch"),h=x.append("foreignObject").attr("x",o).attr("y",l).attr("width",g).attr("height",_).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),t(a,x,o,l,g,_,y,f),i(h,y)}r.__name(n,"byFo");function i(a,c){for(const o in c)o in c&&a.attr(o,c[o])}return r.__name(i,"_setTextAttrs"),function(a){return a.textPlacement==="fo"?n:a.textPlacement==="old"?e:t}}(),Ft=r.__name(function(e,t){wt=0,Y=-1,e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function rt(e,t){e.each(function(){var n=r.select(this),i=n.text().split(/(\s+|<br>)/).reverse(),a,c=[],o=1.1,l=n.attr("y"),g=parseFloat(n.attr("dy")),_=n.text(null).append("tspan").attr("x",0).attr("y",l).attr("dy",g+"em");for(let y=0;y<i.length;y++)a=i[i.length-1-y],c.push(a),_.text(c.join(" ").trim()),(_.node().getComputedTextLength()>t||a==="<br>")&&(c.pop(),_.text(c.join(" ").trim()),a==="<br>"?c=[""]:c=[a],_=n.append("tspan").attr("x",0).attr("y",l).attr("dy",o+"em").text(a))})}r.__name(rt,"wrap");var zt=r.__name(function(e,t,n,i,a,c=!1){var m,u,w;const{theme:o,look:l}=i,g=o==null?void 0:o.includes("redux"),_=((m=i==null?void 0:i.themeVariables)==null?void 0:m.THEME_COLOR_LIMIT)??12,y=n%_-1,f=e.append("g");t.section=y,f.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+y));const x=f.append("g"),s=f.append("g"),d=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(rt,t.width).node().getBBox(),p=(u=i.fontSize)!=null&&u.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=d.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),g&&s.attr("transform",`translate(${t.width/2}, ${c?t.padding/2+3:t.padding})`),Ot(x,t,y,a,i),l==="neo"&&(f.attr("data-look","neo"),g)){const k=o.includes("dark"),L=((w=e.node())==null?void 0:w.ownerSVGElement)??e.node(),C=r.select(L),W=C.attr("id")??"",B=W?`${W}-drop-shadow`:"drop-shadow";if(C.select(`#${B}`).empty()){const H=C.select("defs");(H.empty()?C.append("defs"):H).append("filter").attr("id",B).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",k?"0.2":"0.06").attr("flood-color",k?"#FFFFFF":"#000000")}}return t},"drawNode"),Gt=r.__name(function(e,t,n){var l;const i=e.append("g"),c=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(rt,t.width).node().getBBox(),o=(l=n.fontSize)!=null&&l.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),c.height+o*1.1*.5+t.padding},"getVirtualNodeHeight"),Ot=r.__name(function(e,t,n,i,a){const{theme:c}=a,o=c!=null&&c.includes("redux")?0:5,l=5,g=o>0?`M0 ${t.height-l} v${-t.height+2*l} q0,-${o},${o},-${o} h${t.width-2*l} q${o},0,${o},${o} v${t.height-l} H0 Z`:`M0 ${t.height-l} v${-(t.height-l)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+wt++).attr("class","node-bkg node-"+t.type).attr("d",g),c!=null&&c.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),R={drawRect:J,drawCircle:Ct,drawSection:Wt,drawText:St,drawLabel:Rt,drawTask:Pt,drawBackgroundRect:Bt,getTextObj:Vt,getNoteRect:nt,initGraphics:Ft,drawNode:zt,getVirtualNodeHeight:Gt},Dt=r.__name(function(e,t,n,i){var D,G,$;const a=r.getConfig2(),{look:c,theme:o,themeVariables:l}=a,{useGradient:g,gradientStart:_,gradientStop:y}=l,f=((D=a.timeline)==null?void 0:D.leftMargin)??50;r.log.debug("timeline",i.db);const x=a.securityLevel;let s;x==="sandbox"&&(s=r.select("#i"+t));const d=(x==="sandbox"?r.select(s.nodes()[0].contentDocument.body):r.select("body")).select("#"+t);d.append("g");const p=i.db.getTasks(),m=i.db.getCommonDb().getDiagramTitle();r.log.debug("task",p),R.initGraphics(d,t);const u=i.db.getSections();r.log.debug("sections",u);let w=0,k=0,L=0,C=0,W=50+f,B=50;C=50;let H=0,b=!0;u.forEach(function(T){const v={number:H,descr:T,section:H,width:150,padding:20,maxHeight:w},E=R.getVirtualNodeHeight(d,v,a);r.log.debug("sectionHeight before draw",E),w=Math.max(w,E+20)});let A=0,V=0;r.log.debug("tasks.length",p.length);for(const[T,v]of p.entries()){const E={number:T,descr:v,section:v.section,width:150,padding:20,maxHeight:k},S=R.getVirtualNodeHeight(d,E,a);r.log.debug("taskHeight before draw",S),k=Math.max(k,S+20),A=Math.max(A,v.events.length);let I=0;for(const N of v.events){const P={descr:N,section:v.section,number:v.section,width:150,padding:20,maxHeight:50};I+=R.getVirtualNodeHeight(d,P,a)}v.events.length>0&&(I+=(v.events.length-1)*10),V=Math.max(V,I)}r.log.debug("maxSectionHeight before draw",w),r.log.debug("maxTaskHeight before draw",k),u&&u.length>0?u.forEach(T=>{const v=p.filter(N=>N.section===T),E={number:H,descr:T,section:H,width:200*Math.max(v.length,1)-50,padding:20,maxHeight:w};r.log.debug("sectionNode",E);const S=d.append("g"),I=R.drawNode(S,E,H,a,t);r.log.debug("sectionNode output",I),S.attr("transform",`translate(${W}, ${C})`),B+=w+50,v.length>0&&ot(d,v,H,W,B,k,a,A,V,w,!1,t),W+=200*Math.max(v.length,1),B=C,H++}):(b=!1,ot(d,p,H,W,B,k,a,A,V,w,!0,t));const F=d.node().getBBox();if(r.log.debug("bounds",F),m&&d.append("text").text(m).attr("x",c==="neo"?F.x*2+f:F.width/2-f).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),L=b?w+k+150:k+100,d.append("g").attr("class","lineWrapper").append("line").attr("x1",f).attr("y1",L).attr("x2",F.width+3*f).attr("y2",L).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),c==="neo"&&g&&o!=="neutral"){const T=d.select("defs"),E=(T.empty()?d.append("defs"):T).append("linearGradient").attr("id",d.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");E.append("stop").attr("offset","0%").attr("stop-color",_).attr("stop-opacity",1),E.append("stop").attr("offset","100%").attr("stop-color",y).attr("stop-opacity",1)}r.setupGraphViewbox(void 0,d,((G=a.timeline)==null?void 0:G.padding)??50,(($=a.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),ot=r.__name(function(e,t,n,i,a,c,o,l,g,_,y,f){var x;for(const s of t){const h={descr:s.task,section:n,number:n,width:150,padding:20,maxHeight:c};r.log.debug("taskNode",h);const d=e.append("g").attr("class","taskWrapper"),m=R.drawNode(d,h,n,o,f).height;if(r.log.debug("taskHeight after draw",m),d.attr("transform",`translate(${i}, ${a})`),c=Math.max(c,m),s.events){const u=e.append("g").attr("class","lineWrapper");let w=c;a+=100,w=w+qt(e,s.events,n,i,a,o,f),a-=100,u.append("line").attr("x1",i+190/2).attr("y1",a+c).attr("x2",i+190/2).attr("y2",a+c+100+g+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${f}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,y&&!((x=o.timeline)!=null&&x.disableMulticolor)&&n++}a=a-10},"drawTasks"),qt=r.__name(function(e,t,n,i,a,c,o){let l=0;const g=a;a=a+100;for(const _ of t){const y={descr:_,section:n,number:n,width:150,padding:20,maxHeight:50};r.log.debug("eventNode",y);const f=e.append("g").attr("class","eventWrapper"),s=R.drawNode(f,y,n,c,o,!0).height;l=l+s,f.attr("transform",`translate(${i}, ${a})`),a=a+10+s}return a=g,l},"drawEvents"),Kt={setConf:r.__name(()=>{},"setConf"),draw:Dt},Q=200,z=5,Ut=Q+z*2,at=Q+100,Xt=at+z*2,$t=10,Zt=0,lt=20,Tt=20,ct=30,Nt=50,Jt=r.__name(function(e,t,n,i){var D,G,$,T,v;const a=r.getConfig2(),c=((D=a.timeline)==null?void 0:D.leftMargin)??50;r.log.debug("timeline",i.db);const o=r.selectSvgElement(t);o.append("g");const l=i.db.getTasks(),g=i.db.getCommonDb().getDiagramTitle();r.log.debug("task",l),R.initGraphics(o);const _=i.db.getSections();r.log.debug("sections",_);let y=0,f=0;const x=50+c;let s=50;const h=s,d=x,p=Ut+Tt,m=Xt+Nt,u=d+p;let w=0;const k=_&&_.length>0,L=k?u:x+p,C=Math.max(50,p+m-z*2);_.forEach(function(E){const S={number:w,descr:E,section:w,width:C,padding:z,maxHeight:y},I=R.getVirtualNodeHeight(o,S,a);r.log.debug("sectionHeight before draw",I),y=Math.max(y,I)});let W=0;r.log.debug("tasks.length",l.length);for(const[E,S]of l.entries()){const I={number:E,descr:S,section:S.section,width:Q,padding:z,maxHeight:f},N=R.getVirtualNodeHeight(o,I,a);r.log.debug("taskHeight before draw",N),f=Math.max(f,N);let P=0;for(const O of S.events){const q={descr:O,section:S.section,number:S.section,width:at,padding:z,maxHeight:50};P+=R.getVirtualNodeHeight(o,q,a)}S.events.length>0&&(P+=(S.events.length-1)*$t),W=Math.max(W,P)+Zt}r.log.debug("maxSectionHeight before draw",y),r.log.debug("maxTaskHeight before draw",f);const H=Math.max(f,W)+ct;k?_.forEach(E=>{const S=l.filter(Ht=>Ht.section===E),I={number:w,descr:E,section:w,width:C,padding:z,maxHeight:y};r.log.debug("sectionNode",I);const N=o.append("g"),P=R.drawNode(N,I,w,a);r.log.debug("sectionNode output",P);const O=L-p;N.attr("transform",`translate(${O}, ${s})`);const q=s+P.height+lt;S.length>0&&dt(o,S,w,L,q,f,a,H,!1);const M=S.length,It=P.height+lt+H*Math.max(M,1)-(M>0?ct*2:0);s+=It,w++}):dt(o,l,w,L,s,f,a,H,!0);let b=(G=o.node())==null?void 0:G.getBBox();if(!b)throw new Error("bbox not found");if(r.log.debug("bounds",b),g){if(o.append("text").text(g).attr("x",b.width/2-c).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=($=o.node())==null?void 0:$.getBBox(),!b)throw new Error("bbox not found");r.log.debug("bounds after title",b)}const[A]=r.parseFontSize(a.fontSize),V=(A??16)*2,F=(A??16)*.5+20,X=o.append("g").attr("class","lineWrapper");X.append("line").attr("x1",L).attr("y1",h-V).attr("x2",L).attr("y2",b.y+b.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),X.lower(),r.setupGraphViewbox(void 0,o,((T=a.timeline)==null?void 0:T.padding)??50,((v=a.timeline)==null?void 0:v.useMaxWidth)??!1)},"draw"),dt=r.__name(function(e,t,n,i,a,c,o,l,g){var _;for(const y of t){const f={descr:y.task,section:n,number:n,width:Q,padding:z,maxHeight:c};r.log.debug("taskNode",f);const x=e.append("g").attr("class","taskWrapper"),s=R.drawNode(x,f,n,o),h=s.height;r.log.debug("taskHeight after draw",h);const d=i-Tt-s.width;if(x.attr("transform",`translate(${d}, ${a})`),c=Math.max(c,h),y.events&&y.events.length>0){const p=a,m=i+Nt;Qt(e,y.events,n,i,m,p,o)}a=a+l,g&&!((_=o.timeline)!=null&&_.disableMulticolor)&&n++}},"drawTasks"),Qt=r.__name(function(e,t,n,i,a,c,o){let l=c;for(const g of t){const _={descr:g,section:n,number:n,width:at,padding:z,maxHeight:0};r.log.debug("eventNode",_);const y=e.append("g").attr("class","eventWrapper"),x=R.drawNode(y,_,n,o).height;y.attr("transform",`translate(${a}, ${l})`);const s=e.append("g").attr("class","lineWrapper"),h=l+x/2;s.append("line").attr("x1",i).attr("y1",h).attr("x2",a).attr("y2",h).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),l=l+x+$t}return l-c},"drawEvents"),jt={setConf:r.__name(()=>{},"setConf"),draw:Jt},Yt=r.__name(e=>{var l;const{theme:t}=r.getConfig(),n=t==null?void 0:t.includes("dark"),i=t==null?void 0:t.includes("color"),a=((l=e.svgId)==null?void 0:l.replace(/^#/,""))??"",c=a?`url(#${a}-drop-shadow)`:e.dropShadow??"none";let o="";for(let g=0;g<e.THEME_COLOR_LIMIT;g++){const _=`${17-3*g}`,y=i?e.borderColorArray[g]:e.mainBkg,f=i?e.borderColorArray[g]:e.nodeBorder;o+=`
|
|
7
|
+
.section-${g-1} rect,
|
|
8
|
+
.section-${g-1} path,
|
|
9
|
+
.section-${g-1} circle {
|
|
10
|
+
fill: ${n&&i?e.mainBkg:y};
|
|
11
|
+
stroke: ${f};
|
|
12
|
+
stroke-width: ${e.strokeWidth};
|
|
13
|
+
filter: ${c};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section-${g-1} text {
|
|
17
|
+
fill: ${e.nodeBorder};
|
|
18
|
+
font-weight: ${e.fontWeight}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.node-icon-${g-1} {
|
|
22
|
+
font-size: 40px;
|
|
23
|
+
color: ${e["cScaleLabel"+g]};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section-edge-${g-1} {
|
|
27
|
+
stroke: ${e["cScale"+g]};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edge-depth-${g-1} {
|
|
31
|
+
stroke-width: ${_};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.section-${g-1} line {
|
|
35
|
+
stroke: ${e["cScaleInv"+g]};
|
|
36
|
+
stroke-width: 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lineWrapper line {
|
|
40
|
+
stroke: ${e.nodeBorder};
|
|
41
|
+
stroke-width:${e.strokeWidth}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.disabled,
|
|
45
|
+
.disabled circle,
|
|
46
|
+
.disabled text {
|
|
47
|
+
fill: ${e.tertiaryColor??"lightgray"};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.disabled text {
|
|
51
|
+
fill: ${e.clusterBorder??"#efefef"};
|
|
52
|
+
}
|
|
53
|
+
`}return o},"genReduxSections"),te=r.__name(e=>{let t="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],r.isDark(e["lineColor"+n])?e["lineColor"+n]=r.lighten(e["lineColor"+n],20):e["lineColor"+n]=r.darken(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);t+=`
|
|
54
|
+
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {
|
|
55
|
+
fill: ${e["cScale"+n]};
|
|
56
|
+
}
|
|
57
|
+
.section-${n-1} text {
|
|
58
|
+
fill: ${e["cScaleLabel"+n]};
|
|
59
|
+
}
|
|
60
|
+
.node-icon-${n-1} {
|
|
61
|
+
font-size: 40px;
|
|
62
|
+
color: ${e["cScaleLabel"+n]};
|
|
63
|
+
}
|
|
64
|
+
.section-edge-${n-1}{
|
|
65
|
+
stroke: ${e["cScale"+n]};
|
|
66
|
+
}
|
|
67
|
+
.edge-depth-${n-1}{
|
|
68
|
+
stroke-width: ${i};
|
|
69
|
+
}
|
|
70
|
+
.section-${n-1} line {
|
|
71
|
+
stroke: ${e["cScaleInv"+n]} ;
|
|
72
|
+
stroke-width: 3;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.lineWrapper line{
|
|
76
|
+
stroke: ${e["cScaleLabel"+n]} ;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.disabled, .disabled circle, .disabled text {
|
|
80
|
+
fill: ${e.tertiaryColor??"lightgray"};
|
|
81
|
+
}
|
|
82
|
+
.disabled text {
|
|
83
|
+
fill: ${e.clusterBorder??"#efefef"};
|
|
84
|
+
}
|
|
85
|
+
`}return t},"genSections"),ee=r.__name(e=>{var o;const{theme:t}=r.getConfig(),n=t==null?void 0:t.includes("redux"),i=t==="neutral",a=((o=e.svgId)==null?void 0:o.replace(/^#/,""))??"";let c="";if(e.useGradient&&a&&e.THEME_COLOR_LIMIT&&!i)for(let l=0;l<e.THEME_COLOR_LIMIT;l++)c+=`
|
|
86
|
+
.section-${l-1}[data-look="neo"] rect,
|
|
87
|
+
.section-${l-1}[data-look="neo"] path,
|
|
88
|
+
.section-${l-1}[data-look="neo"] circle {
|
|
89
|
+
fill: ${e.mainBkg};
|
|
90
|
+
stroke: url(#${a}-gradient);
|
|
91
|
+
stroke-width: 2;
|
|
92
|
+
}
|
|
93
|
+
.section-${l-1}[data-look="neo"] line {
|
|
94
|
+
stroke: url(#${a}-gradient);
|
|
95
|
+
stroke-width: 2;
|
|
96
|
+
}`;return`
|
|
97
|
+
.edge {
|
|
98
|
+
stroke-width: 3;
|
|
99
|
+
}
|
|
100
|
+
${n?Yt(e):te(e)}
|
|
101
|
+
${c}
|
|
102
|
+
.section-root rect, .section-root path, .section-root circle {
|
|
103
|
+
fill: ${e.git0};
|
|
104
|
+
}
|
|
105
|
+
.section-root text {
|
|
106
|
+
fill: ${e.gitBranchLabel0};
|
|
107
|
+
}
|
|
108
|
+
.icon-container {
|
|
109
|
+
height:100%;
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
}
|
|
114
|
+
.edge {
|
|
115
|
+
fill: none;
|
|
116
|
+
}
|
|
117
|
+
.eventWrapper {
|
|
118
|
+
filter: brightness(120%);
|
|
119
|
+
}
|
|
120
|
+
`},"getStyles"),ne=ee,re={setConf:r.__name(()=>{},"setConf"),draw:r.__name((e,t,n,i)=>{var c,o;return(((o=(c=i==null?void 0:i.db)==null?void 0:c.getDirection)==null?void 0:o.call(c))??"LR")==="TD"?jt.draw(e,t,n,i):Kt.draw(e,t,n,i)},"draw")},ae={db:ht,renderer:re,parser:Lt,styles:ne};exports.diagram=ae;
|