1 | import { l as x, q as H, c as w, ax as O, j as v, d as Z, x as D, D as F } from "./mermaid-9357f3d0.js";
|
2 | import { c as P } from "./createText-8ca1146d.js";
|
3 | import { p as Q } from "./svgDraw-c2b80d25.js";
|
4 | import { l as et } from "./line-a77fdd5a.js";
|
5 | const st = (r, t, e, n) => {
|
6 | t.forEach((a) => {
|
7 | yt[a](r, e, n);
|
8 | });
|
9 | }, it = (r, t, e) => {
|
10 | x.trace("Making markers for ", e), r.append("defs").append("marker").attr("id", t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), r.append("defs").append("marker").attr("id", t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
11 | }, nt = (r, t) => {
|
12 | r.append("defs").append("marker").attr("id", t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
13 | }, lt = (r, t) => {
|
14 | r.append("defs").append("marker").attr("id", t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
15 | }, ct = (r, t) => {
|
16 | r.append("defs").append("marker").attr("id", t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
17 | }, ht = (r, t) => {
|
18 | r.append("defs").append("marker").attr("id", t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "white").attr("cx", 6).attr("cy", 7).attr("r", 6);
|
19 | }, ot = (r, t) => {
|
20 | r.append("marker").attr("id", t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 10).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 0).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
21 | }, ft = (r, t) => {
|
22 | r.append("marker").attr("id", t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
23 | }, dt = (r, t) => {
|
24 | r.append("marker").attr("id", t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
25 | }, pt = (r, t) => {
|
26 | r.append("defs").append("marker").attr("id", t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
27 | }, yt = {
|
28 | extension: it,
|
29 | composition: nt,
|
30 | aggregation: lt,
|
31 | dependency: ct,
|
32 | lollipop: ht,
|
33 | point: ot,
|
34 | circle: ft,
|
35 | cross: dt,
|
36 | barb: pt
|
37 | }, Kt = st;
|
38 | function bt(r, t) {
|
39 | t && r.attr("style", t);
|
40 | }
|
41 | function xt(r) {
|
42 | const t = v(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), e = t.append("xhtml:div"), n = r.label, a = r.isNode ? "nodeLabel" : "edgeLabel";
|
43 | return e.html(
|
44 | '<span class="' + a + '" ' + (r.labelStyle ? 'style="' + r.labelStyle + '"' : "") + ">" + n + "</span>"
|
45 | ), bt(e, r.labelStyle), e.style("display", "inline-block"), e.style("white-space", "nowrap"), e.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
|
46 | }
|
47 | const ut = (r, t, e, n) => {
|
48 | let a = r || "";
|
49 | if (typeof a == "object" && (a = a[0]), H(w().flowchart.htmlLabels)) {
|
50 | a = a.replace(/\\n|\n/g, "<br />"), x.info("vertexText" + a);
|
51 | const s = {
|
52 | isNode: n,
|
53 | label: O(a).replace(
|
54 | /fa[blrs]?:fa-[\w-]+/g,
|
55 | (l) => `<i class='${l.replace(":", " ")}'></i>`
|
56 | ),
|
57 | labelStyle: t.replace("fill:", "color:")
|
58 | };
|
59 | return xt(s);
|
60 | } else {
|
61 | const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
62 | s.setAttribute("style", t.replace("color:", "fill:"));
|
63 | let i = [];
|
64 | typeof a == "string" ? i = a.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(a) ? i = a : i = [];
|
65 | for (const l of i) {
|
66 | const c = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
67 | c.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), c.setAttribute("dy", "1em"), c.setAttribute("x", "0"), e ? c.setAttribute("class", "title-row") : c.setAttribute("class", "row"), c.textContent = l.trim(), s.appendChild(c);
|
68 | }
|
69 | return s;
|
70 | }
|
71 | }, T = ut, S = async (r, t, e, n) => {
|
72 | let a;
|
73 | const s = t.useHtmlLabels || H(w().flowchart.htmlLabels);
|
74 | e ? a = e : a = "node default";
|
75 | const i = r.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("g").attr("class", "label").attr("style", t.labelStyle);
|
76 | let c;
|
77 | t.labelText === void 0 ? c = "" : c = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
|
78 | const o = l.node();
|
79 | let h;
|
80 | t.labelType === "markdown" ? h = P(l, Z(O(c), w()), {
|
81 | useHtmlLabels: s,
|
82 | width: t.width || w().flowchart.wrappingWidth,
|
83 | classes: "markdown-node-label"
|
84 | }) : h = o.appendChild(
|
85 | T(
|
86 | Z(O(c), w()),
|
87 | t.labelStyle,
|
88 | !1,
|
89 | n
|
90 | )
|
91 | );
|
92 | let f = h.getBBox();
|
93 | const b = t.padding / 2;
|
94 | if (H(w().flowchart.htmlLabels)) {
|
95 | const d = h.children[0], p = v(h), y = d.getElementsByTagName("img");
|
96 | if (y) {
|
97 | const u = c.replace(/<img[^>]*>/g, "").trim() === "";
|
98 | await Promise.all(
|
99 | [...y].map(
|
100 | (g) => new Promise(
|
101 | (R) => g.addEventListener("load", function() {
|
102 | if (g.style.display = "flex", g.style.flexDirection = "column", u) {
|
103 | const I = w().fontSize ? w().fontSize : window.getComputedStyle(document.body).fontSize, E = 5;
|
104 | g.style.width = parseInt(I, 10) * E + "px";
|
105 | } else
|
106 | g.style.width = "100%";
|
107 | R(g);
|
108 | })
|
109 | )
|
110 | )
|
111 | );
|
112 | }
|
113 | f = d.getBoundingClientRect(), p.attr("width", f.width), p.attr("height", f.height);
|
114 | }
|
115 | return s ? l.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")") : l.attr("transform", "translate(0, " + -f.height / 2 + ")"), t.centerLabel && l.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), l.insert("rect", ":first-child"), { shapeSvg: i, bbox: f, halfPadding: b, label: l };
|
116 | }, k = (r, t) => {
|
117 | const e = t.node().getBBox();
|
118 | r.width = e.width, r.height = e.height;
|
119 | };
|
120 | function _(r, t, e, n) {
|
121 | return r.insert("polygon", ":first-child").attr(
|
122 | "points",
|
123 | n.map(function(a) {
|
124 | return a.x + "," + a.y;
|
125 | }).join(" ")
|
126 | ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + e / 2 + ")");
|
127 | }
|
128 | function gt(r, t) {
|
129 | return r.intersect(t);
|
130 | }
|
131 | function tt(r, t, e, n) {
|
132 | var a = r.x, s = r.y, i = a - n.x, l = s - n.y, c = Math.sqrt(t * t * l * l + e * e * i * i), o = Math.abs(t * e * i / c);
|
133 | n.x < a && (o = -o);
|
134 | var h = Math.abs(t * e * l / c);
|
135 | return n.y < s && (h = -h), { x: a + o, y: s + h };
|
136 | }
|
137 | function wt(r, t, e) {
|
138 | return tt(r, t, t, e);
|
139 | }
|
140 | function mt(r, t, e, n) {
|
141 | var a, s, i, l, c, o, h, f, b, d, p, y, u, g, R;
|
142 | if (a = t.y - r.y, i = r.x - t.x, c = t.x * r.y - r.x * t.y, b = a * e.x + i * e.y + c, d = a * n.x + i * n.y + c, !(b !== 0 && d !== 0 && V(b, d)) && (s = n.y - e.y, l = e.x - n.x, o = n.x * e.y - e.x * n.y, h = s * r.x + l * r.y + o, f = s * t.x + l * t.y + o, !(h !== 0 && f !== 0 && V(h, f)) && (p = a * l - s * i, p !== 0)))
|
143 | return y = Math.abs(p / 2), u = i * o - l * c, g = u < 0 ? (u - y) / p : (u + y) / p, u = s * c - a * o, R = u < 0 ? (u - y) / p : (u + y) / p, { x: g, y: R };
|
144 | }
|
145 | function V(r, t) {
|
146 | return r * t > 0;
|
147 | }
|
148 | function kt(r, t, e) {
|
149 | var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, l = Number.POSITIVE_INFINITY;
|
150 | typeof t.forEach == "function" ? t.forEach(function(p) {
|
151 | i = Math.min(i, p.x), l = Math.min(l, p.y);
|
152 | }) : (i = Math.min(i, t.x), l = Math.min(l, t.y));
|
153 | for (var c = n - r.width / 2 - i, o = a - r.height / 2 - l, h = 0; h < t.length; h++) {
|
154 | var f = t[h], b = t[h < t.length - 1 ? h + 1 : 0], d = mt(
|
155 | r,
|
156 | e,
|
157 | { x: c + f.x, y: o + f.y },
|
158 | { x: c + b.x, y: o + b.y }
|
159 | );
|
160 | d && s.push(d);
|
161 | }
|
162 | return s.length ? (s.length > 1 && s.sort(function(p, y) {
|
163 | var u = p.x - e.x, g = p.y - e.y, R = Math.sqrt(u * u + g * g), I = y.x - e.x, E = y.y - e.y, X = Math.sqrt(I * I + E * E);
|
164 | return R < X ? -1 : R === X ? 0 : 1;
|
165 | }), s[0]) : r;
|
166 | }
|
167 | const Lt = (r, t) => {
|
168 | var e = r.x, n = r.y, a = t.x - e, s = t.y - n, i = r.width / 2, l = r.height / 2, c, o;
|
169 | return Math.abs(s) * i > Math.abs(a) * l ? (s < 0 && (l = -l), c = s === 0 ? 0 : l * a / s, o = l) : (a < 0 && (i = -i), c = i, o = a === 0 ? 0 : i * s / a), { x: e + c, y: n + o };
|
170 | }, vt = Lt, m = {
|
171 | node: gt,
|
172 | circle: wt,
|
173 | ellipse: tt,
|
174 | polygon: kt,
|
175 | rect: vt
|
176 | }, St = async (r, t) => {
|
177 | t.useHtmlLabels || w().flowchart.htmlLabels || (t.centerLabel = !0);
|
178 | const { shapeSvg: n, bbox: a, halfPadding: s } = await S(
|
179 | r,
|
180 | t,
|
181 | "node " + t.classes,
|
182 | !0
|
183 | );
|
184 | x.info("Classes = ", t.classes);
|
185 | const i = n.insert("rect", ":first-child");
|
186 | return i.attr("rx", t.rx).attr("ry", t.ry).attr("x", -a.width / 2 - s).attr("y", -a.height / 2 - s).attr("width", a.width + t.padding).attr("height", a.height + t.padding), k(t, i), t.intersect = function(l) {
|
187 | return m.rect(t, l);
|
188 | }, n;
|
189 | }, Et = St, q = async (r, t) => {
|
190 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = a + s, l = [
|
191 | { x: i / 2, y: 0 },
|
192 | { x: i, y: -i / 2 },
|
193 | { x: i / 2, y: -i },
|
194 | { x: 0, y: -i / 2 }
|
195 | ];
|
196 | x.info("Question main (Circle)");
|
197 | const c = _(e, i, i, l);
|
198 | return c.attr("style", t.style), k(t, c), t.intersect = function(o) {
|
199 | return x.warn("Intersect called"), m.polygon(t, l, o);
|
200 | }, e;
|
201 | }, Bt = (r, t) => {
|
202 | const e = r.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = 28, a = [
|
203 | { x: 0, y: n / 2 },
|
204 | { x: n / 2, y: 0 },
|
205 | { x: 0, y: -n / 2 },
|
206 | { x: -n / 2, y: 0 }
|
207 | ];
|
208 | return e.insert("polygon", ":first-child").attr(
|
209 | "points",
|
210 | a.map(function(i) {
|
211 | return i.x + "," + i.y;
|
212 | }).join(" ")
|
213 | ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(i) {
|
214 | return m.circle(t, 14, i);
|
215 | }, e;
|
216 | }, Mt = async (r, t) => {
|
217 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = 4, s = n.height + t.padding, i = s / a, l = n.width + 2 * i + t.padding, c = [
|
218 | { x: i, y: 0 },
|
219 | { x: l - i, y: 0 },
|
220 | { x: l, y: -s / 2 },
|
221 | { x: l - i, y: -s },
|
222 | { x: i, y: -s },
|
223 | { x: 0, y: -s / 2 }
|
224 | ], o = _(e, l, s, c);
|
225 | return o.attr("style", t.style), k(t, o), t.intersect = function(h) {
|
226 | return m.polygon(t, c, h);
|
227 | }, e;
|
228 | }, Ct = async (r, t) => {
|
229 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
230 | { x: -s / 2, y: 0 },
|
231 | { x: a, y: 0 },
|
232 | { x: a, y: -s },
|
233 | { x: -s / 2, y: -s },
|
234 | { x: 0, y: -s / 2 }
|
235 | ];
|
236 | return _(e, a, s, i).attr("style", t.style), t.width = a + s, t.height = s, t.intersect = function(c) {
|
237 | return m.polygon(t, i, c);
|
238 | }, e;
|
239 | }, Tt = async (r, t) => {
|
240 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
241 | { x: -2 * s / 6, y: 0 },
|
242 | { x: a - s / 6, y: 0 },
|
243 | { x: a + 2 * s / 6, y: -s },
|
244 | { x: s / 6, y: -s }
|
245 | ], l = _(e, a, s, i);
|
246 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
247 | return m.polygon(t, i, c);
|
248 | }, e;
|
249 | }, Rt = async (r, t) => {
|
250 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
251 | { x: 2 * s / 6, y: 0 },
|
252 | { x: a + s / 6, y: 0 },
|
253 | { x: a - 2 * s / 6, y: -s },
|
254 | { x: -s / 6, y: -s }
|
255 | ], l = _(e, a, s, i);
|
256 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
257 | return m.polygon(t, i, c);
|
258 | }, e;
|
259 | }, It = async (r, t) => {
|
260 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
261 | { x: -2 * s / 6, y: 0 },
|
262 | { x: a + 2 * s / 6, y: 0 },
|
263 | { x: a - s / 6, y: -s },
|
264 | { x: s / 6, y: -s }
|
265 | ], l = _(e, a, s, i);
|
266 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
267 | return m.polygon(t, i, c);
|
268 | }, e;
|
269 | }, Ht = async (r, t) => {
|
270 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
271 | { x: s / 6, y: 0 },
|
272 | { x: a - s / 6, y: 0 },
|
273 | { x: a + 2 * s / 6, y: -s },
|
274 | { x: -2 * s / 6, y: -s }
|
275 | ], l = _(e, a, s, i);
|
276 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
277 | return m.polygon(t, i, c);
|
278 | }, e;
|
279 | }, Nt = async (r, t) => {
|
280 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
281 | { x: 0, y: 0 },
|
282 | { x: a + s / 2, y: 0 },
|
283 | { x: a, y: -s / 2 },
|
284 | { x: a + s / 2, y: -s },
|
285 | { x: 0, y: -s }
|
286 | ], l = _(e, a, s, i);
|
287 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
288 | return m.polygon(t, i, c);
|
289 | }, e;
|
290 | }, _t = async (r, t) => {
|
291 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = a / 2, i = s / (2.5 + a / 50), l = n.height + i + t.padding, c = "M 0," + i + " a " + s + "," + i + " 0,0,0 " + a + " 0 a " + s + "," + i + " 0,0,0 " + -a + " 0 l 0," + l + " a " + s + "," + i + " 0,0,0 " + a + " 0 l 0," + -l, o = e.attr("label-offset-y", i).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -a / 2 + "," + -(l / 2 + i) + ")");
|
292 | return k(t, o), t.intersect = function(h) {
|
293 | const f = m.rect(t, h), b = f.x - t.x;
|
294 | if (s != 0 && (Math.abs(b) < t.width / 2 || Math.abs(b) == t.width / 2 && Math.abs(f.y - t.y) > t.height / 2 - i)) {
|
295 | let d = i * i * (1 - b * b / (s * s));
|
296 | d != 0 && (d = Math.sqrt(d)), d = i - d, h.y - t.y > 0 && (d = -d), f.y += d;
|
297 | }
|
298 | return f;
|
299 | }, e;
|
300 | }, $t = async (r, t) => {
|
301 | const { shapeSvg: e, bbox: n, halfPadding: a } = await S(
|
302 | r,
|
303 | t,
|
304 | "node " + t.classes,
|
305 | !0
|
306 | ), s = e.insert("rect", ":first-child"), i = n.width + t.padding, l = n.height + t.padding;
|
307 | if (s.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", -n.width / 2 - a).attr("y", -n.height / 2 - a).attr("width", i).attr("height", l), t.props) {
|
308 | const c = new Set(Object.keys(t.props));
|
309 | t.props.borders && (rt(s, t.props.borders, i, l), c.delete("borders")), c.forEach((o) => {
|
310 | x.warn(`Unknown node property ${o}`);
|
311 | });
|
312 | }
|
313 | return k(t, s), t.intersect = function(c) {
|
314 | return m.rect(t, c);
|
315 | }, e;
|
316 | }, Wt = async (r, t) => {
|
317 | const { shapeSvg: e } = await S(r, t, "label", !0);
|
318 | x.trace("Classes = ", t.classes);
|
319 | const n = e.insert("rect", ":first-child"), a = 0, s = 0;
|
320 | if (n.attr("width", a).attr("height", s), e.attr("class", "label edgeLabel"), t.props) {
|
321 | const i = new Set(Object.keys(t.props));
|
322 | t.props.borders && (rt(n, t.props.borders, a, s), i.delete("borders")), i.forEach((l) => {
|
323 | x.warn(`Unknown node property ${l}`);
|
324 | });
|
325 | }
|
326 | return k(t, n), t.intersect = function(i) {
|
327 | return m.rect(t, i);
|
328 | }, e;
|
329 | };
|
330 | function rt(r, t, e, n) {
|
331 | const a = [], s = (l) => {
|
332 | a.push(l, 0);
|
333 | }, i = (l) => {
|
334 | a.push(0, l);
|
335 | };
|
336 | t.includes("t") ? (x.debug("add top border"), s(e)) : i(e), t.includes("r") ? (x.debug("add right border"), s(n)) : i(n), t.includes("b") ? (x.debug("add bottom border"), s(e)) : i(e), t.includes("l") ? (x.debug("add left border"), s(n)) : i(n), r.attr("stroke-dasharray", a.join(" "));
|
337 | }
|
338 | const Xt = (r, t) => {
|
339 | let e;
|
340 | t.classes ? e = "node " + t.classes : e = "node default";
|
341 | const n = r.insert("g").attr("class", e).attr("id", t.domId || t.id), a = n.insert("rect", ":first-child"), s = n.insert("line"), i = n.insert("g").attr("class", "label"), l = t.labelText.flat ? t.labelText.flat() : t.labelText;
|
342 | let c = "";
|
343 | typeof l == "object" ? c = l[0] : c = l, x.info("Label text abc79", c, l, typeof l == "object");
|
344 | const o = i.node().appendChild(T(c, t.labelStyle, !0, !0));
|
345 | let h = { width: 0, height: 0 };
|
346 | if (H(w().flowchart.htmlLabels)) {
|
347 | const y = o.children[0], u = v(o);
|
348 | h = y.getBoundingClientRect(), u.attr("width", h.width), u.attr("height", h.height);
|
349 | }
|
350 | x.info("Text 2", l);
|
351 | const f = l.slice(1, l.length);
|
352 | let b = o.getBBox();
|
353 | const d = i.node().appendChild(
|
354 | T(f.join ? f.join("<br/>") : f, t.labelStyle, !0, !0)
|
355 | );
|
356 | if (H(w().flowchart.htmlLabels)) {
|
357 | const y = d.children[0], u = v(d);
|
358 | h = y.getBoundingClientRect(), u.attr("width", h.width), u.attr("height", h.height);
|
359 | }
|
360 | const p = t.padding / 2;
|
361 | return v(d).attr(
|
362 | "transform",
|
363 | "translate( " +
|
364 | (h.width > b.width ? 0 : (b.width - h.width) / 2) + ", " + (b.height + p + 5) + ")"
|
365 | ), v(o).attr(
|
366 | "transform",
|
367 | "translate( " +
|
368 | (h.width < b.width ? 0 : -(b.width - h.width) / 2) + ", 0)"
|
369 | ), h = i.node().getBBox(), i.attr(
|
370 | "transform",
|
371 | "translate(" + -h.width / 2 + ", " + (-h.height / 2 - p + 3) + ")"
|
372 | ), a.attr("class", "outer title-state").attr("x", -h.width / 2 - p).attr("y", -h.height / 2 - p).attr("width", h.width + t.padding).attr("height", h.height + t.padding), s.attr("class", "divider").attr("x1", -h.width / 2 - p).attr("x2", h.width / 2 + p).attr("y1", -h.height / 2 - p + b.height + p).attr("y2", -h.height / 2 - p + b.height + p), k(t, a), t.intersect = function(y) {
|
373 | return m.rect(t, y);
|
374 | }, n;
|
375 | }, Yt = async (r, t) => {
|
376 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.height + t.padding, s = n.width + a / 4 + t.padding, i = e.insert("rect", ":first-child").attr("style", t.style).attr("rx", a / 2).attr("ry", a / 2).attr("x", -s / 2).attr("y", -a / 2).attr("width", s).attr("height", a);
|
377 | return k(t, i), t.intersect = function(l) {
|
378 | return m.rect(t, l);
|
379 | }, e;
|
380 | }, Dt = async (r, t) => {
|
381 | const { shapeSvg: e, bbox: n, halfPadding: a } = await S(r, t, void 0, !0), s = e.insert("circle", ":first-child");
|
382 | return s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + a).attr("width", n.width + t.padding).attr("height", n.height + t.padding), x.info("Circle main"), k(t, s), t.intersect = function(i) {
|
383 | return x.info("Circle intersect", t, n.width / 2 + a, i), m.circle(t, n.width / 2 + a, i);
|
384 | }, e;
|
385 | }, Ut = async (r, t) => {
|
386 | const { shapeSvg: e, bbox: n, halfPadding: a } = await S(r, t, void 0, !0), s = 5, i = e.insert("g", ":first-child"), l = i.insert("circle"), c = i.insert("circle");
|
387 | return l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + a + s).attr("width", n.width + t.padding + s * 2).attr("height", n.height + t.padding + s * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + a).attr("width", n.width + t.padding).attr("height", n.height + t.padding), x.info("DoubleCircle main"), k(t, l), t.intersect = function(o) {
|
388 | return x.info("DoubleCircle intersect", t, n.width / 2 + a + s, o), m.circle(t, n.width / 2 + a + s, o);
|
389 | }, e;
|
390 | }, jt = async (r, t) => {
|
391 | const { shapeSvg: e, bbox: n } = await S(r, t, void 0, !0), a = n.width + t.padding, s = n.height + t.padding, i = [
|
392 | { x: 0, y: 0 },
|
393 | { x: a, y: 0 },
|
394 | { x: a, y: -s },
|
395 | { x: 0, y: -s },
|
396 | { x: 0, y: 0 },
|
397 | { x: -8, y: 0 },
|
398 | { x: a + 8, y: 0 },
|
399 | { x: a + 8, y: -s },
|
400 | { x: -8, y: -s },
|
401 | { x: -8, y: 0 }
|
402 | ], l = _(e, a, s, i);
|
403 | return l.attr("style", t.style), k(t, l), t.intersect = function(c) {
|
404 | return m.polygon(t, i, c);
|
405 | }, e;
|
406 | }, At = (r, t) => {
|
407 | const e = r.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = e.insert("circle", ":first-child");
|
408 | return n.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), k(t, n), t.intersect = function(a) {
|
409 | return m.circle(t, 7, a);
|
410 | }, e;
|
411 | }, J = (r, t, e) => {
|
412 | const n = r.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
|
413 | let a = 70, s = 10;
|
414 | e === "LR" && (a = 10, s = 70);
|
415 | const i = n.append("rect").attr("x", -1 * a / 2).attr("y", -1 * s / 2).attr("width", a).attr("height", s).attr("class", "fork-join");
|
416 | return k(t, i), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(l) {
|
417 | return m.rect(t, l);
|
418 | }, n;
|
419 | }, Ot = (r, t) => {
|
420 | const e = r.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = e.insert("circle", ":first-child"), a = e.insert("circle", ":first-child");
|
421 | return a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), n.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), k(t, a), t.intersect = function(s) {
|
422 | return m.circle(t, 7, s);
|
423 | }, e;
|
424 | }, zt = (r, t) => {
|
425 | const e = t.padding / 2, n = 4, a = 8;
|
426 | let s;
|
427 | t.classes ? s = "node " + t.classes : s = "node default";
|
428 | const i = r.insert("g").attr("class", s).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), c = i.insert("line"), o = i.insert("line");
|
429 | let h = 0, f = n;
|
430 | const b = i.insert("g").attr("class", "label");
|
431 | let d = 0;
|
432 | const p = t.classData.annotations && t.classData.annotations[0], y = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", u = b.node().appendChild(T(y, t.labelStyle, !0, !0));
|
433 | let g = u.getBBox();
|
434 | if (H(w().flowchart.htmlLabels)) {
|
435 | const B = u.children[0], M = v(u);
|
436 | g = B.getBoundingClientRect(), M.attr("width", g.width), M.attr("height", g.height);
|
437 | }
|
438 | t.classData.annotations[0] && (f += g.height + n, h += g.width);
|
439 | let R = t.classData.label;
|
440 | t.classData.type !== void 0 && t.classData.type !== "" && (w().flowchart.htmlLabels ? R += "<" + t.classData.type + ">" : R += "<" + t.classData.type + ">");
|
441 | const I = b.node().appendChild(T(R, t.labelStyle, !0, !0));
|
442 | v(I).attr("class", "classTitle");
|
443 | let E = I.getBBox();
|
444 | if (H(w().flowchart.htmlLabels)) {
|
445 | const B = I.children[0], M = v(I);
|
446 | E = B.getBoundingClientRect(), M.attr("width", E.width), M.attr("height", E.height);
|
447 | }
|
448 | f += E.height + n, E.width > h && (h = E.width);
|
449 | const X = [];
|
450 | t.classData.members.forEach((B) => {
|
451 | const M = Q(B);
|
452 | let $ = M.displayText;
|
453 | w().flowchart.htmlLabels && ($ = $.replace(/</g, "<").replace(/>/g, ">"));
|
454 | const N = b.node().appendChild(
|
455 | T(
|
456 | $,
|
457 | M.cssStyle ? M.cssStyle : t.labelStyle,
|
458 | !0,
|
459 | !0
|
460 | )
|
461 | );
|
462 | let C = N.getBBox();
|
463 | if (H(w().flowchart.htmlLabels)) {
|
464 | const A = N.children[0], Y = v(N);
|
465 | C = A.getBoundingClientRect(), Y.attr("width", C.width), Y.attr("height", C.height);
|
466 | }
|
467 | C.width > h && (h = C.width), f += C.height + n, X.push(N);
|
468 | }), f += a;
|
469 | const z = [];
|
470 | if (t.classData.methods.forEach((B) => {
|
471 | const M = Q(B);
|
472 | let $ = M.displayText;
|
473 | w().flowchart.htmlLabels && ($ = $.replace(/</g, "<").replace(/>/g, ">"));
|
474 | const N = b.node().appendChild(
|
475 | T(
|
476 | $,
|
477 | M.cssStyle ? M.cssStyle : t.labelStyle,
|
478 | !0,
|
479 | !0
|
480 | )
|
481 | );
|
482 | let C = N.getBBox();
|
483 | if (H(w().flowchart.htmlLabels)) {
|
484 | const A = N.children[0], Y = v(N);
|
485 | C = A.getBoundingClientRect(), Y.attr("width", C.width), Y.attr("height", C.height);
|
486 | }
|
487 | C.width > h && (h = C.width), f += C.height + n, z.push(N);
|
488 | }), f += a, p) {
|
489 | let B = (h - g.width) / 2;
|
490 | v(u).attr(
|
491 | "transform",
|
492 | "translate( " + (-1 * h / 2 + B) + ", " + -1 * f / 2 + ")"
|
493 | ), d = g.height + n;
|
494 | }
|
495 | let at = (h - E.width) / 2;
|
496 | return v(I).attr(
|
497 | "transform",
|
498 | "translate( " + (-1 * h / 2 + at) + ", " + (-1 * f / 2 + d) + ")"
|
499 | ), d += E.height + n, c.attr("class", "divider").attr("x1", -h / 2 - e).attr("x2", h / 2 + e).attr("y1", -f / 2 - e + a + d).attr("y2", -f / 2 - e + a + d), d += a, X.forEach((B) => {
|
500 | v(B).attr(
|
501 | "transform",
|
502 | "translate( " + -h / 2 + ", " + (-1 * f / 2 + d + a / 2) + ")"
|
503 | ), d += E.height + n;
|
504 | }), d += a, o.attr("class", "divider").attr("x1", -h / 2 - e).attr("x2", h / 2 + e).attr("y1", -f / 2 - e + a + d).attr("y2", -f / 2 - e + a + d), d += a, z.forEach((B) => {
|
505 | v(B).attr(
|
506 | "transform",
|
507 | "translate( " + -h / 2 + ", " + (-1 * f / 2 + d) + ")"
|
508 | ), d += E.height + n;
|
509 | }), l.attr("class", "outer title-state").attr("x", -h / 2 - e).attr("y", -(f / 2) - e).attr("width", h + t.padding).attr("height", f + t.padding), k(t, l), t.intersect = function(B) {
|
510 | return m.rect(t, B);
|
511 | }, i;
|
512 | }, K = {
|
513 | rhombus: q,
|
514 | question: q,
|
515 | rect: $t,
|
516 | labelRect: Wt,
|
517 | rectWithTitle: Xt,
|
518 | choice: Bt,
|
519 | circle: Dt,
|
520 | doublecircle: Ut,
|
521 | stadium: Yt,
|
522 | hexagon: Mt,
|
523 | rect_left_inv_arrow: Ct,
|
524 | lean_right: Tt,
|
525 | lean_left: Rt,
|
526 | trapezoid: It,
|
527 | inv_trapezoid: Ht,
|
528 | rect_right_inv_arrow: Nt,
|
529 | cylinder: _t,
|
530 | start: At,
|
531 | end: Ot,
|
532 | note: Et,
|
533 | subroutine: jt,
|
534 | fork: J,
|
535 | join: J,
|
536 | class_box: zt
|
537 | };
|
538 | let W = {};
|
539 | const Gt = async (r, t, e) => {
|
540 | let n, a;
|
541 | if (t.link) {
|
542 | let s;
|
543 | w().securityLevel === "sandbox" ? s = "_top" : t.linkTarget && (s = t.linkTarget || "_blank"), n = r.insert("svg:a").attr("xlink:href", t.link).attr("target", s), a = await K[t.shape](n, t, e);
|
544 | } else
|
545 | a = await K[t.shape](r, t, e), n = a;
|
546 | return t.tooltip && a.attr("title", t.tooltip), t.class && a.attr("class", "node default " + t.class), W[t.id] = n, t.haveCallback && W[t.id].attr("class", W[t.id].attr("class") + " clickable"), n;
|
547 | }, Pt = (r, t) => {
|
548 | W[t.id] = r;
|
549 | }, tr = () => {
|
550 | W = {};
|
551 | }, rr = (r) => {
|
552 | const t = W[r.id];
|
553 | x.trace(
|
554 | "Transforming node",
|
555 | r.diff,
|
556 | r,
|
557 | "translate(" + (r.x - r.width / 2 - 5) + ", " + r.width / 2 + ")"
|
558 | );
|
559 | const e = 8, n = r.diff || 0;
|
560 | return r.clusterNode ? t.attr(
|
561 | "transform",
|
562 | "translate(" + (r.x + n - r.width / 2) + ", " + (r.y - r.height / 2 - e) + ")"
|
563 | ) : t.attr("transform", "translate(" + r.x + ", " + r.y + ")"), n;
|
564 | };
|
565 | let j = {}, L = {};
|
566 | const ar = () => {
|
567 | j = {}, L = {};
|
568 | }, er = (r, t) => {
|
569 | const e = H(w().flowchart.htmlLabels), n = t.labelType === "markdown" ? P(r, t.label, {
|
570 | style: t.labelStyle,
|
571 | useHtmlLabels: e,
|
572 | addSvgBackground: !0
|
573 | }) : T(t.label, t.labelStyle);
|
574 | x.info("abc82", t, t.labelType);
|
575 | const a = r.insert("g").attr("class", "edgeLabel"), s = a.insert("g").attr("class", "label");
|
576 | s.node().appendChild(n);
|
577 | let i = n.getBBox();
|
578 | if (e) {
|
579 | const c = n.children[0], o = v(n);
|
580 | i = c.getBoundingClientRect(), o.attr("width", i.width), o.attr("height", i.height);
|
581 | }
|
582 | s.attr("transform", "translate(" + -i.width / 2 + ", " + -i.height / 2 + ")"), j[t.id] = a, t.width = i.width, t.height = i.height;
|
583 | let l;
|
584 | if (t.startLabelLeft) {
|
585 | const c = T(t.startLabelLeft, t.labelStyle), o = r.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
586 | l = h.node().appendChild(c);
|
587 | const f = c.getBBox();
|
588 | h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), L[t.id] || (L[t.id] = {}), L[t.id].startLeft = o, U(l, t.startLabelLeft);
|
589 | }
|
590 | if (t.startLabelRight) {
|
591 | const c = T(t.startLabelRight, t.labelStyle), o = r.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
592 | l = o.node().appendChild(c), h.node().appendChild(c);
|
593 | const f = c.getBBox();
|
594 | h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), L[t.id] || (L[t.id] = {}), L[t.id].startRight = o, U(l, t.startLabelRight);
|
595 | }
|
596 | if (t.endLabelLeft) {
|
597 | const c = T(t.endLabelLeft, t.labelStyle), o = r.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
598 | l = h.node().appendChild(c);
|
599 | const f = c.getBBox();
|
600 | h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), o.node().appendChild(c), L[t.id] || (L[t.id] = {}), L[t.id].endLeft = o, U(l, t.endLabelLeft);
|
601 | }
|
602 | if (t.endLabelRight) {
|
603 | const c = T(t.endLabelRight, t.labelStyle), o = r.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
604 | l = h.node().appendChild(c);
|
605 | const f = c.getBBox();
|
606 | h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), o.node().appendChild(c), L[t.id] || (L[t.id] = {}), L[t.id].endRight = o, U(l, t.endLabelRight);
|
607 | }
|
608 | return n;
|
609 | };
|
610 | function U(r, t) {
|
611 | w().flowchart.htmlLabels && r && (r.style.width = t.length * 9 + "px", r.style.height = "12px");
|
612 | }
|
613 | const sr = (r, t) => {
|
614 | x.info("Moving label abc78 ", r.id, r.label, j[r.id]);
|
615 | let e = t.updatedPath ? t.updatedPath : t.originalPath;
|
616 | if (r.label) {
|
617 | const n = j[r.id];
|
618 | let a = r.x, s = r.y;
|
619 | if (e) {
|
620 | const i = D.calcLabelPosition(e);
|
621 | x.info(
|
622 | "Moving label " + r.label + " from (",
|
623 | a,
|
624 | ",",
|
625 | s,
|
626 | ") to (",
|
627 | i.x,
|
628 | ",",
|
629 | i.y,
|
630 | ") abc78"
|
631 | ), t.updatedPath && (a = i.x, s = i.y);
|
632 | }
|
633 | n.attr("transform", "translate(" + a + ", " + s + ")");
|
634 | }
|
635 | if (r.startLabelLeft) {
|
636 | const n = L[r.id].startLeft;
|
637 | let a = r.x, s = r.y;
|
638 | if (e) {
|
639 | const i = D.calcTerminalLabelPosition(r.arrowTypeStart ? 10 : 0, "start_left", e);
|
640 | a = i.x, s = i.y;
|
641 | }
|
642 | n.attr("transform", "translate(" + a + ", " + s + ")");
|
643 | }
|
644 | if (r.startLabelRight) {
|
645 | const n = L[r.id].startRight;
|
646 | let a = r.x, s = r.y;
|
647 | if (e) {
|
648 | const i = D.calcTerminalLabelPosition(
|
649 | r.arrowTypeStart ? 10 : 0,
|
650 | "start_right",
|
651 | e
|
652 | );
|
653 | a = i.x, s = i.y;
|
654 | }
|
655 | n.attr("transform", "translate(" + a + ", " + s + ")");
|
656 | }
|
657 | if (r.endLabelLeft) {
|
658 | const n = L[r.id].endLeft;
|
659 | let a = r.x, s = r.y;
|
660 | if (e) {
|
661 | const i = D.calcTerminalLabelPosition(r.arrowTypeEnd ? 10 : 0, "end_left", e);
|
662 | a = i.x, s = i.y;
|
663 | }
|
664 | n.attr("transform", "translate(" + a + ", " + s + ")");
|
665 | }
|
666 | if (r.endLabelRight) {
|
667 | const n = L[r.id].endRight;
|
668 | let a = r.x, s = r.y;
|
669 | if (e) {
|
670 | const i = D.calcTerminalLabelPosition(r.arrowTypeEnd ? 10 : 0, "end_right", e);
|
671 | a = i.x, s = i.y;
|
672 | }
|
673 | n.attr("transform", "translate(" + a + ", " + s + ")");
|
674 | }
|
675 | }, Zt = (r, t) => {
|
676 | const e = r.x, n = r.y, a = Math.abs(t.x - e), s = Math.abs(t.y - n), i = r.width / 2, l = r.height / 2;
|
677 | return a >= i || s >= l;
|
678 | }, Ft = (r, t, e) => {
|
679 | x.warn(`intersection calc abc89:
|
680 | outsidePoint: ${JSON.stringify(t)}
|
681 | insidePoint : ${JSON.stringify(e)}
|
682 | node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);
|
683 | const n = r.x, a = r.y, s = Math.abs(n - e.x), i = r.width / 2;
|
684 | let l = e.x < t.x ? i - s : i + s;
|
685 | const c = r.height / 2, o = Math.abs(t.y - e.y), h = Math.abs(t.x - e.x);
|
686 | if (Math.abs(a - t.y) * i > Math.abs(n - t.x) * c) {
|
687 | let f = e.y < t.y ? t.y - c - a : a - c - t.y;
|
688 | l = h * f / o;
|
689 | const b = {
|
690 | x: e.x < t.x ? e.x + l : e.x - h + l,
|
691 | y: e.y < t.y ? e.y + o - f : e.y - o + f
|
692 | };
|
693 | return l === 0 && (b.x = t.x, b.y = t.y), h === 0 && (b.x = t.x), o === 0 && (b.y = t.y), x.warn(`abc89 topp/bott calc, Q ${o}, q ${f}, R ${h}, r ${l}`, b), b;
|
694 | } else {
|
695 | e.x < t.x ? l = t.x - i - n : l = n - i - t.x;
|
696 | let f = o * l / h, b = e.x < t.x ? e.x + h - l : e.x - h + l, d = e.y < t.y ? e.y + f : e.y - f;
|
697 | return x.warn(`sides calc abc89, Q ${o}, q ${f}, R ${h}, r ${l}`, { _x: b, _y: d }), l === 0 && (b = t.x, d = t.y), h === 0 && (b = t.x), o === 0 && (d = t.y), { x: b, y: d };
|
698 | }
|
699 | }, G = (r, t) => {
|
700 | x.warn("abc88 cutPathAtIntersect", r, t);
|
701 | let e = [], n = r[0], a = !1;
|
702 | return r.forEach((s) => {
|
703 | if (x.info("abc88 checking point", s, t), !Zt(t, s) && !a) {
|
704 | const i = Ft(t, n, s);
|
705 | x.warn("abc88 inside", s, n, i), x.warn("abc88 intersection", i);
|
706 | let l = !1;
|
707 | e.forEach((c) => {
|
708 | l = l || c.x === i.x && c.y === i.y;
|
709 | }), e.some((c) => c.x === i.x && c.y === i.y) ? x.warn("abc88 no intersect", i, e) : e.push(i), a = !0;
|
710 | } else
|
711 | x.warn("abc88 outside", s, n), n = s, a || e.push(s);
|
712 | }), x.warn("abc88 returning points", e), e;
|
713 | }, ir = function(r, t, e, n, a, s) {
|
714 | let i = e.points, l = !1;
|
715 | const c = s.node(t.v);
|
716 | var o = s.node(t.w);
|
717 | x.info("abc88 InsertEdge: ", e), o.intersect && c.intersect && (i = i.slice(1, e.points.length - 1), i.unshift(c.intersect(i[0])), x.info(
|
718 | "Last point",
|
719 | i[i.length - 1],
|
720 | o,
|
721 | o.intersect(i[i.length - 1])
|
722 | ), i.push(o.intersect(i[i.length - 1]))), e.toCluster && (x.info("to cluster abc88", n[e.toCluster]), i = G(e.points, n[e.toCluster].node), l = !0), e.fromCluster && (x.info("from cluster abc88", n[e.fromCluster]), i = G(i.reverse(), n[e.fromCluster].node).reverse(), l = !0);
|
723 | const h = i.filter((g) => !Number.isNaN(g.y));
|
724 | let f;
|
725 | a === "graph" || a === "flowchart" ? f = e.curve || F : f = F;
|
726 | const b = et().x(function(g) {
|
727 | return g.x;
|
728 | }).y(function(g) {
|
729 | return g.y;
|
730 | }).curve(f);
|
731 | let d;
|
732 | switch (e.thickness) {
|
733 | case "normal":
|
734 | d = "edge-thickness-normal";
|
735 | break;
|
736 | case "thick":
|
737 | d = "edge-thickness-thick";
|
738 | break;
|
739 | case "invisible":
|
740 | d = "edge-thickness-thick";
|
741 | break;
|
742 | default:
|
743 | d = "";
|
744 | }
|
745 | switch (e.pattern) {
|
746 | case "solid":
|
747 | d += " edge-pattern-solid";
|
748 | break;
|
749 | case "dotted":
|
750 | d += " edge-pattern-dotted";
|
751 | break;
|
752 | case "dashed":
|
753 | d += " edge-pattern-dashed";
|
754 | break;
|
755 | }
|
756 | const p = r.append("path").attr("d", b(h)).attr("id", e.id).attr("class", " " + d + (e.classes ? " " + e.classes : "")).attr("style", e.style);
|
757 | let y = "";
|
758 | switch ((w().flowchart.arrowMarkerAbsolute || w().state.arrowMarkerAbsolute) && (y = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, y = y.replace(/\(/g, "\\("), y = y.replace(/\)/g, "\\)")), x.info("arrowTypeStart", e.arrowTypeStart), x.info("arrowTypeEnd", e.arrowTypeEnd), e.arrowTypeStart) {
|
759 | case "arrow_cross":
|
760 | p.attr("marker-start", "url(" + y + "#" + a + "-crossStart)");
|
761 | break;
|
762 | case "arrow_point":
|
763 | p.attr("marker-start", "url(" + y + "#" + a + "-pointStart)");
|
764 | break;
|
765 | case "arrow_barb":
|
766 | p.attr("marker-start", "url(" + y + "#" + a + "-barbStart)");
|
767 | break;
|
768 | case "arrow_circle":
|
769 | p.attr("marker-start", "url(" + y + "#" + a + "-circleStart)");
|
770 | break;
|
771 | case "aggregation":
|
772 | p.attr("marker-start", "url(" + y + "#" + a + "-aggregationStart)");
|
773 | break;
|
774 | case "extension":
|
775 | p.attr("marker-start", "url(" + y + "#" + a + "-extensionStart)");
|
776 | break;
|
777 | case "composition":
|
778 | p.attr("marker-start", "url(" + y + "#" + a + "-compositionStart)");
|
779 | break;
|
780 | case "dependency":
|
781 | p.attr("marker-start", "url(" + y + "#" + a + "-dependencyStart)");
|
782 | break;
|
783 | case "lollipop":
|
784 | p.attr("marker-start", "url(" + y + "#" + a + "-lollipopStart)");
|
785 | break;
|
786 | }
|
787 | switch (e.arrowTypeEnd) {
|
788 | case "arrow_cross":
|
789 | p.attr("marker-end", "url(" + y + "#" + a + "-crossEnd)");
|
790 | break;
|
791 | case "arrow_point":
|
792 | p.attr("marker-end", "url(" + y + "#" + a + "-pointEnd)");
|
793 | break;
|
794 | case "arrow_barb":
|
795 | p.attr("marker-end", "url(" + y + "#" + a + "-barbEnd)");
|
796 | break;
|
797 | case "arrow_circle":
|
798 | p.attr("marker-end", "url(" + y + "#" + a + "-circleEnd)");
|
799 | break;
|
800 | case "aggregation":
|
801 | p.attr("marker-end", "url(" + y + "#" + a + "-aggregationEnd)");
|
802 | break;
|
803 | case "extension":
|
804 | p.attr("marker-end", "url(" + y + "#" + a + "-extensionEnd)");
|
805 | break;
|
806 | case "composition":
|
807 | p.attr("marker-end", "url(" + y + "#" + a + "-compositionEnd)");
|
808 | break;
|
809 | case "dependency":
|
810 | p.attr("marker-end", "url(" + y + "#" + a + "-dependencyEnd)");
|
811 | break;
|
812 | case "lollipop":
|
813 | p.attr("marker-end", "url(" + y + "#" + a + "-lollipopEnd)");
|
814 | break;
|
815 | }
|
816 | let u = {};
|
817 | return l && (u.updatedPath = i), u.originalPath = e.points, u;
|
818 | };
|
819 | export {
|
820 | Kt as a,
|
821 | tr as b,
|
822 | T as c,
|
823 | ar as d,
|
824 | Gt as e,
|
825 | er as f,
|
826 | ir as g,
|
827 | sr as h,
|
828 | vt as i,
|
829 | S as l,
|
830 | rr as p,
|
831 | Pt as s,
|
832 | k as u
|
833 | };
|