@blueking/ai-blueking 2.1.4-beta.7 → 2.1.4-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/standalone/_baseFor-DZ1vnh4H.js +393 -0
  2. package/dist/standalone/arc-WNacHY26.js +80 -0
  3. package/dist/standalone/architecture-YZFGNWBL-pIa_tKdA.js +3 -0
  4. package/dist/standalone/architectureDiagram-Q4EWVU46-Bfam8Fg3.js +4057 -0
  5. package/dist/standalone/array-CWNufkl9.js +6 -0
  6. package/dist/standalone/blockDiagram-DXYQGD6D-vAb9uyF5.js +3033 -0
  7. package/dist/standalone/c4Diagram-AHTNJAMY-BWACU0ER.js +2961 -0
  8. package/dist/standalone/channel-Br5ChI8U.js +5 -0
  9. package/dist/standalone/chunk-2KRD3SAO-Deh6AASy.js +23 -0
  10. package/dist/standalone/chunk-336JU56O-CFKWNcxR.js +49 -0
  11. package/dist/standalone/chunk-426QAEUC-D_wKNd3w.js +9 -0
  12. package/dist/standalone/chunk-4BX2VUAB-DKC_OBWg.js +8 -0
  13. package/dist/standalone/chunk-4TB4RGXK-HiVG7T1A.js +3254 -0
  14. package/dist/standalone/chunk-55IACEB6-DBivnNb2.js +8 -0
  15. package/dist/standalone/chunk-5FUZZQ4R-tiEjqlP4.js +3638 -0
  16. package/dist/standalone/chunk-5PVQY5BW-BCjrVrWB.js +1299 -0
  17. package/dist/standalone/chunk-67CJDMHE-BX09W6oy.js +23 -0
  18. package/dist/standalone/chunk-7N4EOEYR-G144j5Vc.js +35 -0
  19. package/dist/standalone/chunk-AA7GKIK3-Dx9YCoJ-.js +30 -0
  20. package/dist/standalone/chunk-BSJP7CBP-DE8WR0MI.js +82 -0
  21. package/dist/standalone/chunk-CIAEETIT-Bv86XVLB.js +23 -0
  22. package/dist/standalone/chunk-EDXVE4YY-DE9KzYM-.js +25 -0
  23. package/dist/standalone/chunk-ENJZ2VHE-DlxIC-A3.js +560 -0
  24. package/dist/standalone/chunk-FMBD7UC4-DCkBrKFO.js +5 -0
  25. package/dist/standalone/chunk-FOC6F5B3-C7hwrEZJ.js +23 -0
  26. package/dist/standalone/chunk-ICPOFSXX-B9JXAgJU.js +2772 -0
  27. package/dist/standalone/chunk-K5T4RW27-T6hJxJM0.js +16070 -0
  28. package/dist/standalone/chunk-KGLVRYIC-C0JPhrjn.js +23 -0
  29. package/dist/standalone/chunk-LIHQZDEY-CiavnvWh.js +64 -0
  30. package/dist/standalone/chunk-ORNJ4GCN-BtJ79bik.js +31 -0
  31. package/dist/standalone/chunk-OYMX7WX6-D2UHnmfD.js +2014 -0
  32. package/dist/standalone/chunk-QZHKN3VN-DhzThSvb.js +15 -0
  33. package/dist/standalone/chunk-U2HBQHQK-75Isf1R4.js +1896 -0
  34. package/dist/standalone/chunk-WQLz0Won.js +20 -0
  35. package/dist/standalone/chunk-X2U36JSP-DSzducJI.js +67 -0
  36. package/dist/standalone/chunk-XPW4576I-BFhmu0d4.js +1146 -0
  37. package/dist/standalone/chunk-YZCP3GAM-90EaSO-2.js +60 -0
  38. package/dist/standalone/chunk-ZZ45TVLE-DUagTZ9d.js +32 -0
  39. package/dist/standalone/classDiagram-6PBFFD2Q-Bwt78q4N.js +29 -0
  40. package/dist/standalone/classDiagram-v2-HSJHXN6E-B2qI9-xf.js +29 -0
  41. package/dist/standalone/clone-CBw-BHXl.js +8 -0
  42. package/dist/standalone/cose-bilkent-S5V4N54A-DFJ1nlog.js +2250 -0
  43. package/dist/standalone/cytoscape.esm-DdhenceR.js +18103 -0
  44. package/dist/standalone/dagre-KV5264BT-CXTBtAae.js +293 -0
  45. package/dist/standalone/dagre-kfvGmNUa.js +1606 -0
  46. package/dist/standalone/defaultLocale-bckJcYh1.js +201 -0
  47. package/dist/standalone/diagram-5BDNPKRD--gLHDKg-.js +101 -0
  48. package/dist/standalone/diagram-G4DWMVQ6-BwLE9Hsf.js +524 -0
  49. package/dist/standalone/diagram-MMDJMWI5-CoilYxa0.js +213 -0
  50. package/dist/standalone/diagram-TYMM5635-BupwRdr6.js +133 -0
  51. package/dist/standalone/dist-Dlj1jr8W.js +59 -0
  52. package/dist/standalone/erDiagram-SMLLAGMA-tIdn6ZCM.js +1700 -0
  53. package/dist/standalone/flatten-CXxC4cn2.js +40 -0
  54. package/dist/standalone/flowDiagram-DWJPFMVM-C86bLTAY.js +4146 -0
  55. package/dist/standalone/ganttDiagram-T4ZO3ILL-BT23lv_X.js +3077 -0
  56. package/dist/standalone/gitGraph-7Q5UKJZL-C-7nG8PF.js +3 -0
  57. package/dist/standalone/gitGraphDiagram-UUTBAWPF-DT1BGQsP.js +728 -0
  58. package/dist/standalone/graphlib-DrXiQBFg.js +373 -0
  59. package/dist/standalone/index.es.min.js +59705 -0
  60. package/dist/standalone/index.iife.min.js +3502 -0
  61. package/dist/standalone/index.umd.min.js +3502 -0
  62. package/dist/standalone/info-OMHHGYJF-BOS7mrON.js +3 -0
  63. package/dist/standalone/infoDiagram-42DDH7IO-Dx7LFK0B.js +19 -0
  64. package/dist/standalone/init-B75p2clj.js +15 -0
  65. package/dist/standalone/isEmpty-CVG4Bj-P.js +35 -0
  66. package/dist/standalone/ishikawaDiagram-UXIWVN3A-CX4cX3qb.js +718 -0
  67. package/dist/standalone/journeyDiagram-VCZTEJTY-BCvxmmFn.js +883 -0
  68. package/dist/standalone/kanban-definition-6JOO6SKY-SVINWaiM.js +973 -0
  69. package/dist/standalone/katex-CKrw0rbA.js +22016 -0
  70. package/dist/standalone/line-BF1XS-Ng.js +34 -0
  71. package/dist/standalone/linear-DGQDIL28.js +289 -0
  72. package/dist/standalone/mermaid-parser.core-Blz-Qy2h.js +69 -0
  73. package/dist/standalone/mermaid.core-CHTh1JGx.js +944 -0
  74. package/dist/standalone/mindmap-definition-QFDTVHPH-1Trzro3y.js +1009 -0
  75. package/dist/standalone/ordinal-F3U6aXtP.js +65 -0
  76. package/dist/standalone/packet-4T2RLAQJ-ai5Omp1h.js +3 -0
  77. package/dist/standalone/path-Dm3C8WEs.js +85 -0
  78. package/dist/standalone/pie-ZZUOXDRM-Df1rG6QC.js +3 -0
  79. package/dist/standalone/pieDiagram-DEJITSTG-D5Omb898.js +165 -0
  80. package/dist/standalone/purify.es-CZ_RvYUu.js +549 -0
  81. package/dist/standalone/quadrantDiagram-34T5L4WZ-Ct4g9T4o.js +1974 -0
  82. package/dist/standalone/radar-PYXPWWZC-B2t6k6Fg.js +3 -0
  83. package/dist/standalone/reduce-DbMsJ4nx.js +532 -0
  84. package/dist/standalone/requirementDiagram-MS252O5E-CP0BUgnz.js +2221 -0
  85. package/dist/standalone/rough.esm-UCEI3PYn.js +1352 -0
  86. package/dist/standalone/sankeyDiagram-XADWPNL6-D6C7yZ3k.js +920 -0
  87. package/dist/standalone/sequenceDiagram-FGHM5R23-KeodespT.js +4157 -0
  88. package/dist/standalone/src-CFVe5TPD.js +2146 -0
  89. package/dist/standalone/stateDiagram-FHFEXIEX-DAupoS9U.js +217 -0
  90. package/dist/standalone/stateDiagram-v2-QKLJ7IA2-C1Lw_i_z.js +27 -0
  91. package/dist/standalone/style.css +1 -0
  92. package/dist/standalone/timeline-definition-GMOUNBTQ-Cwhj84lX.js +1068 -0
  93. package/dist/standalone/treeView-SZITEDCU-BnoMeJSb.js +3 -0
  94. package/dist/standalone/treemap-W4RFUUIX-B38XFBZF.js +3 -0
  95. package/dist/standalone/vennDiagram-DHZGUBPP-_1PHloeO.js +1858 -0
  96. package/dist/standalone/wardley-RL74JXVD-bB8BBy_Y.js +3 -0
  97. package/dist/standalone/wardleyDiagram-NUSXRM2D-DRLCx-qh.js +578 -0
  98. package/dist/standalone/xychartDiagram-5P7HB3ND-Bz2-4Ufi.js +2044 -0
  99. package/dist/standalone-mount-core.d.ts +34 -0
  100. package/dist/standalone-mount-core.d.ts.map +1 -0
  101. package/dist/standalone-mount.d.ts +14 -0
  102. package/dist/standalone-mount.d.ts.map +1 -0
  103. package/dist/standalone.d.ts +8 -0
  104. package/dist/standalone.d.ts.map +1 -0
  105. package/package.json +12 -3
@@ -0,0 +1,3638 @@
1
+ import { g as e, h as t, p as n } from "./src-CFVe5TPD.js";
2
+ import { L as r, R as i, b as a, h as o, j as s, k as c, w as l, y as u } from "./chunk-ICPOFSXX-B9JXAgJU.js";
3
+ import { i as d, l as f, n as p } from "./chunk-5PVQY5BW-BCjrVrWB.js";
4
+ import { n as m, r as h } from "./chunk-U2HBQHQK-75Isf1R4.js";
5
+ import { n as g, t as _ } from "./chunk-ZZ45TVLE-DUagTZ9d.js";
6
+ import { a as v, i as y, r as b, t as x } from "./chunk-X2U36JSP-DSzducJI.js";
7
+ import { t as S } from "./rough.esm-UCEI3PYn.js";
8
+ //#region ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.mjs
9
+ var C = /* @__PURE__ */ t(async (e, t, i) => {
10
+ let s, c = t.useHtmlLabels || o(a()?.htmlLabels);
11
+ s = i || "node default";
12
+ let l = e.insert("g").attr("class", s).attr("id", t.domId || t.id), u = l.insert("g").attr("class", "label").attr("style", f(t.labelStyle)), p;
13
+ p = t.label === void 0 ? "" : typeof t.label == "string" ? t.label : t.label[0];
14
+ let h = !!t.icon || !!t.img, g = t.labelType === "markdown", v = await m(u, r(d(p), a()), {
15
+ useHtmlLabels: c,
16
+ width: t.width || a().flowchart?.wrappingWidth,
17
+ classes: g ? "markdown-node-label" : "",
18
+ style: t.labelStyle,
19
+ addSvgBackground: h,
20
+ markdown: g
21
+ }, a()), y = v.getBBox(), b = (t?.padding ?? 0) / 2;
22
+ if (c) {
23
+ let e = v.children[0], t = n(v);
24
+ await _(e, p), y = e.getBoundingClientRect(), t.attr("width", y.width), t.attr("height", y.height);
25
+ }
26
+ return c ? u.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : u.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && u.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), u.insert("rect", ":first-child"), {
27
+ shapeSvg: l,
28
+ bbox: y,
29
+ halfPadding: b,
30
+ label: u
31
+ };
32
+ }, "labelHelper"), w = /* @__PURE__ */ t(async (e, t, i) => {
33
+ let o = i.useHtmlLabels ?? l(a()), s = e.insert("g").attr("class", "label").attr("style", i.labelStyle || ""), c = await m(s, r(d(t), a()), {
34
+ useHtmlLabels: o,
35
+ width: i.width || a()?.flowchart?.wrappingWidth,
36
+ style: i.labelStyle,
37
+ addSvgBackground: !!i.icon || !!i.img
38
+ }), u = c.getBBox(), f = i.padding / 2;
39
+ if (l(a())) {
40
+ let e = c.children[0], t = n(c);
41
+ u = e.getBoundingClientRect(), t.attr("width", u.width), t.attr("height", u.height);
42
+ }
43
+ return o ? s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")") : s.attr("transform", "translate(0, " + -u.height / 2 + ")"), i.centerLabel && s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")"), s.insert("rect", ":first-child"), {
44
+ shapeSvg: e,
45
+ bbox: u,
46
+ halfPadding: f,
47
+ label: s
48
+ };
49
+ }, "insertLabel"), T = /* @__PURE__ */ t((e, t) => {
50
+ let n = t.node().getBBox();
51
+ e.width = n.width, e.height = n.height;
52
+ }, "updateNodeBounds"), E = /* @__PURE__ */ t((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
53
+ function D(e) {
54
+ let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
55
+ return t.push("Z"), t.join(" ");
56
+ }
57
+ t(D, "createPathFromPoints");
58
+ function O(e, t, n, r, i, a) {
59
+ let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
60
+ for (let t = 0; t <= 50; t++) {
61
+ let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
62
+ o.push({
63
+ x: n,
64
+ y: r
65
+ });
66
+ }
67
+ return o;
68
+ }
69
+ t(O, "generateFullSineWavePoints");
70
+ function k(e, t, n, r, i, a) {
71
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
72
+ for (let i = 0; i < r; i++) {
73
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
74
+ o.push({
75
+ x: -a,
76
+ y: -l
77
+ });
78
+ }
79
+ return o;
80
+ }
81
+ t(k, "generateCirclePoints");
82
+ function A(e) {
83
+ let n = Array.from(e.childNodes).filter((e) => e.tagName === "path"), r = document.createElementNS("http://www.w3.org/2000/svg", "path"), i = n.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
84
+ r.setAttribute("d", i);
85
+ let a = n.find((e) => e.getAttribute("fill") !== "none"), o = n.find((e) => e.getAttribute("stroke") !== "none"), s = /* @__PURE__ */ t((e, t) => e?.getAttribute(t) ?? void 0, "getAttr");
86
+ if (a) {
87
+ let e = {
88
+ fill: s(a, "fill"),
89
+ "fill-opacity": s(a, "fill-opacity") ?? "1"
90
+ };
91
+ Object.entries(e).forEach(([e, t]) => {
92
+ t && r.setAttribute(e, t);
93
+ });
94
+ }
95
+ if (o) {
96
+ let e = {
97
+ stroke: s(o, "stroke"),
98
+ "stroke-width": s(o, "stroke-width") ?? "1",
99
+ "stroke-opacity": s(o, "stroke-opacity") ?? "1"
100
+ };
101
+ Object.entries(e).forEach(([e, t]) => {
102
+ t && r.setAttribute(e, t);
103
+ });
104
+ }
105
+ let c = document.createElementNS("http://www.w3.org/2000/svg", "g");
106
+ return c.appendChild(r), c;
107
+ }
108
+ t(A, "mergePaths");
109
+ var j = /* @__PURE__ */ t((e, t) => {
110
+ var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
111
+ return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
112
+ x: n + c,
113
+ y: r + l
114
+ };
115
+ }, "intersectRect"), M = /* @__PURE__ */ t(async (e, t, n, r = !1, i = !1) => {
116
+ let o = t || "";
117
+ typeof o == "object" && (o = o[0]);
118
+ let s = a(), c = l(s);
119
+ return await m(e, o, {
120
+ style: n,
121
+ isTitle: r,
122
+ useHtmlLabels: c,
123
+ markdown: !1,
124
+ isNode: i,
125
+ width: Infinity
126
+ }, s);
127
+ }, "createLabel"), N = /* @__PURE__ */ t((e, t, n, r, i) => [
128
+ "M",
129
+ e + i,
130
+ t,
131
+ "H",
132
+ e + n - i,
133
+ "A",
134
+ i,
135
+ i,
136
+ 0,
137
+ 0,
138
+ 1,
139
+ e + n,
140
+ t + i,
141
+ "V",
142
+ t + r - i,
143
+ "A",
144
+ i,
145
+ i,
146
+ 0,
147
+ 0,
148
+ 1,
149
+ e + n - i,
150
+ t + r,
151
+ "H",
152
+ e + i,
153
+ "A",
154
+ i,
155
+ i,
156
+ 0,
157
+ 0,
158
+ 1,
159
+ e,
160
+ t + r - i,
161
+ "V",
162
+ t + i,
163
+ "A",
164
+ i,
165
+ i,
166
+ 0,
167
+ 0,
168
+ 1,
169
+ e + i,
170
+ t,
171
+ "Z"
172
+ ].join(" "), "createRoundedRectPathD"), P = /* @__PURE__ */ t(async (t, r) => {
173
+ e.info("Creating subgraph rect for ", r.id, r);
174
+ let i = a(), { themeVariables: o, handDrawnSeed: s } = i, { clusterBkg: c, clusterBorder: u } = o, { labelStyles: d, nodeStyles: f, borderStyles: p, backgroundStyles: h } = y(r), _ = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.domId).attr("data-look", r.look), b = l(i), x = _.insert("g").attr("class", "cluster-label "), C;
175
+ C = r.labelType === "markdown" ? await m(x, r.label, {
176
+ style: r.labelStyle,
177
+ useHtmlLabels: b,
178
+ isNode: !0,
179
+ width: r.width
180
+ }) : await M(x, r.label, r.labelStyle || "", !1, !0);
181
+ let w = C.getBBox();
182
+ if (l(i)) {
183
+ let e = C.children[0], t = n(C);
184
+ w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
185
+ }
186
+ let T = r.width <= w.width + r.padding ? w.width + r.padding : r.width;
187
+ r.width <= w.width + r.padding ? r.diff = (T - r.width) / 2 - r.padding : r.diff = -r.padding;
188
+ let E = r.height, D = r.x - T / 2, O = r.y - E / 2;
189
+ e.trace("Data ", r, JSON.stringify(r));
190
+ let k;
191
+ if (r.look === "handDrawn") {
192
+ let t = S.svg(_), n = v(r, {
193
+ roughness: .7,
194
+ fill: c,
195
+ stroke: u,
196
+ fillWeight: 3,
197
+ seed: s
198
+ }), i = t.path(N(D, O, T, E, 0), n);
199
+ k = _.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
200
+ } else k = _.insert("rect", ":first-child"), k.attr("style", f).attr("rx", r.rx).attr("ry", r.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
201
+ let { subGraphTitleTopMargin: A } = g(i);
202
+ if (x.attr("transform", `translate(${r.x - w.width / 2}, ${r.y - r.height / 2 + A})`), d) {
203
+ let e = x.select("span");
204
+ e && e.attr("style", d);
205
+ }
206
+ let P = k.node().getBBox();
207
+ return r.offsetX = 0, r.width = P.width, r.height = P.height, r.offsetY = w.height - r.padding / 2, r.intersect = function(e) {
208
+ return j(r, e);
209
+ }, {
210
+ cluster: _,
211
+ labelBBox: w
212
+ };
213
+ }, "rect"), F = {
214
+ rect: P,
215
+ squareRect: P,
216
+ roundedWithTitle: /* @__PURE__ */ t(async (e, t) => {
217
+ let r = a(), { themeVariables: i, handDrawnSeed: o } = r, { altBackground: s, compositeBackground: c, compositeTitleBackground: u, nodeBorder: d } = i, f = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-id", t.id).attr("data-look", t.look), p = f.insert("g", ":first-child"), m = f.insert("g").attr("class", "cluster-label"), h = f.append("rect"), g = await M(m, t.label, t.labelStyle, void 0, !0), _ = g.getBBox();
218
+ if (l(r)) {
219
+ let e = g.children[0], t = n(g);
220
+ _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
221
+ }
222
+ let v = 0 * t.padding, y = v / 2, b = (t.width <= _.width + t.padding ? _.width + t.padding : t.width) + v;
223
+ t.width <= _.width + t.padding ? t.diff = (b - t.width) / 2 - t.padding : t.diff = -t.padding;
224
+ let x = t.height + v, C = t.height + v - _.height - 6, w = t.x - b / 2, T = t.y - x / 2;
225
+ t.width = b;
226
+ let E = t.y - t.height / 2 - y + _.height + 2, D;
227
+ if (t.look === "handDrawn") {
228
+ let e = t.cssClasses.includes("statediagram-cluster-alt"), n = S.svg(f), r = t.rx || t.ry ? n.path(N(w, T, b, x, 10), {
229
+ roughness: .7,
230
+ fill: u,
231
+ fillStyle: "solid",
232
+ stroke: d,
233
+ seed: o
234
+ }) : n.rectangle(w, T, b, x, { seed: o });
235
+ D = f.insert(() => r, ":first-child");
236
+ let i = n.rectangle(w, E, b, C, {
237
+ fill: e ? s : c,
238
+ fillStyle: e ? "hachure" : "solid",
239
+ stroke: d,
240
+ seed: o
241
+ });
242
+ D = f.insert(() => r, ":first-child"), h = f.insert(() => i);
243
+ } else D = p.insert("rect", ":first-child"), D.attr("class", "outer").attr("x", w).attr("y", T).attr("width", b).attr("height", x).attr("data-look", t.look), h.attr("class", "inner").attr("x", w).attr("y", E).attr("width", b).attr("height", C);
244
+ return m.attr("transform", `translate(${t.x - _.width / 2}, ${T + 1 - (l(r) ? 0 : 3)})`), t.height = D.node().getBBox().height, t.offsetX = 0, t.offsetY = _.height - t.padding / 2, t.labelBBox = _, t.intersect = function(e) {
245
+ return j(t, e);
246
+ }, {
247
+ cluster: f,
248
+ labelBBox: _
249
+ };
250
+ }, "roundedWithTitle"),
251
+ noteGroup: /* @__PURE__ */ t((e, t) => {
252
+ let n = e.insert("g").attr("class", "note-cluster").attr("id", t.domId), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
253
+ r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
254
+ let o = r.node().getBBox();
255
+ return t.width = o.width, t.height = o.height, t.intersect = function(e) {
256
+ return j(t, e);
257
+ }, {
258
+ cluster: n,
259
+ labelBBox: {
260
+ width: 0,
261
+ height: 0
262
+ }
263
+ };
264
+ }, "noteGroup"),
265
+ divider: /* @__PURE__ */ t((e, t) => {
266
+ let { themeVariables: n, handDrawnSeed: r } = a(), { nodeBorder: i } = n, o = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look), s = o.insert("g", ":first-child"), c = 0 * t.padding, l = t.width + c;
267
+ t.diff = -t.padding;
268
+ let u = t.height + c, d = t.x - l / 2, f = t.y - u / 2;
269
+ t.width = l;
270
+ let p;
271
+ if (t.look === "handDrawn") {
272
+ let e = S.svg(o).rectangle(d, f, l, u, {
273
+ fill: "lightgrey",
274
+ roughness: .5,
275
+ strokeLineDash: [5],
276
+ stroke: i,
277
+ seed: r
278
+ });
279
+ p = o.insert(() => e, ":first-child");
280
+ } else {
281
+ p = s.insert("rect", ":first-child");
282
+ let e = "outer";
283
+ e = (t.look, "divider"), p.attr("class", e).attr("x", d).attr("y", f).attr("width", l).attr("height", u).attr("data-look", t.look);
284
+ }
285
+ return t.height = p.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
286
+ return j(t, e);
287
+ }, {
288
+ cluster: o,
289
+ labelBBox: {}
290
+ };
291
+ }, "divider"),
292
+ kanbanSection: /* @__PURE__ */ t(async (t, r) => {
293
+ e.info("Creating subgraph rect for ", r.id, r);
294
+ let i = a(), { themeVariables: o, handDrawnSeed: s } = i, { clusterBkg: c, clusterBorder: u } = o, { labelStyles: d, nodeStyles: f, borderStyles: p, backgroundStyles: h } = y(r), _ = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.domId).attr("data-look", r.look), b = l(i), x = _.insert("g").attr("class", "cluster-label "), C = await m(x, r.label, {
295
+ style: r.labelStyle,
296
+ useHtmlLabels: b,
297
+ isNode: !0,
298
+ width: r.width
299
+ }), w = C.getBBox();
300
+ if (l(i)) {
301
+ let e = C.children[0], t = n(C);
302
+ w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
303
+ }
304
+ let T = r.width <= w.width + r.padding ? w.width + r.padding : r.width;
305
+ r.width <= w.width + r.padding ? r.diff = (T - r.width) / 2 - r.padding : r.diff = -r.padding;
306
+ let E = r.height, D = r.x - T / 2, O = r.y - E / 2;
307
+ e.trace("Data ", r, JSON.stringify(r));
308
+ let k;
309
+ if (r.look === "handDrawn") {
310
+ let t = S.svg(_), n = v(r, {
311
+ roughness: .7,
312
+ fill: c,
313
+ stroke: u,
314
+ fillWeight: 4,
315
+ seed: s
316
+ }), i = t.path(N(D, O, T, E, r.rx), n);
317
+ k = _.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
318
+ } else k = _.insert("rect", ":first-child"), k.attr("style", f).attr("rx", r.rx).attr("ry", r.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
319
+ let { subGraphTitleTopMargin: A } = g(i);
320
+ if (x.attr("transform", `translate(${r.x - w.width / 2}, ${r.y - r.height / 2 + A})`), d) {
321
+ let e = x.select("span");
322
+ e && e.attr("style", d);
323
+ }
324
+ let M = k.node().getBBox();
325
+ return r.offsetX = 0, r.width = M.width, r.height = M.height, r.offsetY = w.height - r.padding / 2, r.intersect = function(e) {
326
+ return j(r, e);
327
+ }, {
328
+ cluster: _,
329
+ labelBBox: w
330
+ };
331
+ }, "kanbanSection")
332
+ }, I = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ t(async (e, t) => {
333
+ let n = await F[t.shape || "rect"](e, t);
334
+ return I.set(t.id, n), n;
335
+ }, "insertCluster"), te = /* @__PURE__ */ t(() => {
336
+ I = /* @__PURE__ */ new Map();
337
+ }, "clear");
338
+ function L(e, t) {
339
+ return e.intersect(t);
340
+ }
341
+ t(L, "intersectNode");
342
+ var R = L;
343
+ function ne(e, t, n, r) {
344
+ var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
345
+ r.x < i && (l = -l);
346
+ var u = Math.abs(t * n * s / c);
347
+ return r.y < a && (u = -u), {
348
+ x: i + l,
349
+ y: a + u
350
+ };
351
+ }
352
+ t(ne, "intersectEllipse");
353
+ var z = ne;
354
+ function B(e, t, n) {
355
+ return z(e, t, t, n);
356
+ }
357
+ t(B, "intersectCircle");
358
+ var V = B;
359
+ function H(e, t, n, r) {
360
+ {
361
+ let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o, l = 1e-6;
362
+ if (s !== 0 && c !== 0 && re(s, c)) return;
363
+ let u = r.y - n.y, d = n.x - r.x, f = r.x * n.y - n.x * r.y, p = u * e.x + d * e.y + f, m = u * t.x + d * t.y + f;
364
+ if (Math.abs(p) < l && Math.abs(m) < l && re(p, m)) return;
365
+ let h = i * d - u * a;
366
+ if (h === 0) return;
367
+ let g = Math.abs(h / 2), _ = a * f - d * o, v = _ < 0 ? (_ - g) / h : (_ + g) / h;
368
+ return _ = u * o - i * f, {
369
+ x: v,
370
+ y: _ < 0 ? (_ - g) / h : (_ + g) / h
371
+ };
372
+ }
373
+ }
374
+ t(H, "intersectLine");
375
+ function re(e, t) {
376
+ return e * t > 0;
377
+ }
378
+ t(re, "sameSign");
379
+ var ie = H;
380
+ function U(e, t, n) {
381
+ let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
382
+ typeof t.forEach == "function" ? t.forEach(function(e) {
383
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
384
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
385
+ let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
386
+ for (let r = 0; r < t.length; r++) {
387
+ let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = ie(e, n, {
388
+ x: c + i.x,
389
+ y: l + i.y
390
+ }, {
391
+ x: c + o.x,
392
+ y: l + o.y
393
+ });
394
+ s && a.push(s);
395
+ }
396
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
397
+ let r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
398
+ return a < c ? -1 : a === c ? 0 : 1;
399
+ }), a[0]) : e;
400
+ }
401
+ t(U, "intersectPolygon");
402
+ var W = {
403
+ node: R,
404
+ circle: V,
405
+ ellipse: z,
406
+ polygon: U,
407
+ rect: j
408
+ };
409
+ function G(t, n) {
410
+ let { labelStyles: r } = y(n);
411
+ n.labelStyle = r;
412
+ let i = E(n), a = i;
413
+ i || (a = "anchor");
414
+ let o = t.insert("g").attr("class", a).attr("id", n.domId || n.id), { cssStyles: s } = n, c = S.svg(o), l = v(n, {
415
+ fill: "black",
416
+ stroke: "none",
417
+ fillStyle: "solid"
418
+ });
419
+ n.look !== "handDrawn" && (l.roughness = 0);
420
+ let u = c.circle(0, 0, 2, l), d = o.insert(() => u, ":first-child");
421
+ return d.attr("class", "anchor").attr("style", f(s)), T(n, d), n.intersect = function(t) {
422
+ return e.info("Circle intersect", n, 1, t), W.circle(n, 1, t);
423
+ }, o;
424
+ }
425
+ t(G, "anchor");
426
+ function K(e, t, n, r, i, a, o) {
427
+ let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
428
+ if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
429
+ let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
430
+ o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
431
+ let b = [];
432
+ for (let e = 0; e < 20; e++) {
433
+ let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
434
+ b.push({
435
+ x: n,
436
+ y: r
437
+ });
438
+ }
439
+ return b;
440
+ }
441
+ t(K, "generateArcPoints");
442
+ function ae(e, t, n) {
443
+ let [r, i] = [t, n].sort((e, t) => t - e);
444
+ return i * (1 - Math.sqrt(1 - (e / r / 2) ** 2));
445
+ }
446
+ t(ae, "calculateArcSagitta");
447
+ async function oe(e, n) {
448
+ let { labelStyles: r, nodeStyles: i } = y(n);
449
+ n.labelStyle = r;
450
+ let a = n.padding ?? 0, o = n.look === "neo" ? 16 : a, s = n.look === "neo" ? 12 : a, c = /* @__PURE__ */ t((e) => e + s, "calcTotalHeight"), l = /* @__PURE__ */ t((e) => {
451
+ let t = e / 2;
452
+ return [t / (2.5 + e / 50), t];
453
+ }, "calcEllipseRadius"), { shapeSvg: u, bbox: d } = await C(e, n, E(n)), f = c(n?.height ? n?.height : d.height), [p, m] = l(f), h = ae(f, p, m), g = (n?.width ? n?.width : d.width) + o * 2 + h - h, _ = f, { cssStyles: b } = n, x = [
454
+ {
455
+ x: g / 2,
456
+ y: -_ / 2
457
+ },
458
+ {
459
+ x: -g / 2,
460
+ y: -_ / 2
461
+ },
462
+ ...K(-g / 2, -_ / 2, -g / 2, _ / 2, p, m, !1),
463
+ {
464
+ x: g / 2,
465
+ y: _ / 2
466
+ },
467
+ ...K(g / 2, _ / 2, g / 2, -_ / 2, p, m, !0)
468
+ ], w = S.svg(u), O = v(n, {});
469
+ n.look !== "handDrawn" && (O.roughness = 0, O.fillStyle = "solid");
470
+ let k = D(x), A = w.path(k, O), j = u.insert(() => A, ":first-child");
471
+ return j.attr("class", "basic label-container outer-path"), b && n.look !== "handDrawn" && j.selectAll("path").attr("style", b), i && n.look !== "handDrawn" && j.selectAll("path").attr("style", i), j.attr("transform", `translate(${p / 2}, 0)`), T(n, j), n.intersect = function(e) {
472
+ return W.polygon(n, x, e);
473
+ }, u;
474
+ }
475
+ t(oe, "bowTieRect");
476
+ function q(e, t, n, r) {
477
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
478
+ return e.x + "," + e.y;
479
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
480
+ }
481
+ t(q, "insertPolygonShape");
482
+ var se = 12;
483
+ async function ce(e, t) {
484
+ let { labelStyles: n, nodeStyles: r } = y(t);
485
+ t.labelStyle = n;
486
+ let i = t.padding ?? 0, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a + se), u = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), d = l, f = -u, p = [
487
+ {
488
+ x: 0 + se,
489
+ y: f
490
+ },
491
+ {
492
+ x: d,
493
+ y: f
494
+ },
495
+ {
496
+ x: d,
497
+ y: 0
498
+ },
499
+ {
500
+ x: 0,
501
+ y: 0
502
+ },
503
+ {
504
+ x: 0,
505
+ y: f + se
506
+ },
507
+ {
508
+ x: 0 + se,
509
+ y: f
510
+ }
511
+ ], m, { cssStyles: h } = t;
512
+ if (t.look === "handDrawn") {
513
+ let e = S.svg(s), n = v(t, {}), r = D(p), i = e.path(r, n);
514
+ m = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), h && m.attr("style", h);
515
+ } else m = q(s, l, u, p);
516
+ return r && m.attr("style", r), T(t, m), t.intersect = function(e) {
517
+ return W.polygon(t, p, e);
518
+ }, s;
519
+ }
520
+ t(ce, "card");
521
+ function le(e, t) {
522
+ let { nodeStyles: n } = y(t);
523
+ t.label = "";
524
+ let r = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
525
+ {
526
+ x: 0,
527
+ y: a / 2
528
+ },
529
+ {
530
+ x: a / 2,
531
+ y: 0
532
+ },
533
+ {
534
+ x: 0,
535
+ y: -a / 2
536
+ },
537
+ {
538
+ x: -a / 2,
539
+ y: 0
540
+ }
541
+ ], s = S.svg(r), c = v(t, {});
542
+ t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
543
+ let l = D(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
544
+ return i && t.look !== "handDrawn" && d.selectAll("path").attr("style", i), n && t.look !== "handDrawn" && d.selectAll("path").attr("style", n), t.width = 28, t.height = 28, t.intersect = function(e) {
545
+ return W.polygon(t, o, e);
546
+ }, r;
547
+ }
548
+ t(le, "choice");
549
+ async function ue(t, n, r) {
550
+ let { labelStyles: i, nodeStyles: a } = y(n);
551
+ n.labelStyle = i;
552
+ let { shapeSvg: o, bbox: s, halfPadding: c } = await C(t, n, E(n)), l = r?.padding ?? c, u = n.look === "neo" ? s.width / 2 + 32 : s.width / 2 + l, d, { cssStyles: p } = n;
553
+ if (n.look === "handDrawn") {
554
+ let e = S.svg(o), t = v(n, {}), r = e.circle(0, 0, u * 2, t);
555
+ d = o.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", f(p));
556
+ } else d = o.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", a).attr("r", u).attr("cx", 0).attr("cy", 0);
557
+ return T(n, d), n.calcIntersect = function(e, t) {
558
+ let n = e.width / 2;
559
+ return W.circle(e, n, t);
560
+ }, n.intersect = function(t) {
561
+ return e.info("Circle intersect", n, u, t), W.circle(n, u, t);
562
+ }, o;
563
+ }
564
+ t(ue, "circle");
565
+ function de(e) {
566
+ let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
567
+ x: r / 2 * t,
568
+ y: r / 2 * n
569
+ }, a = {
570
+ x: -(r / 2) * t,
571
+ y: r / 2 * n
572
+ }, o = {
573
+ x: -(r / 2) * t,
574
+ y: -(r / 2) * n
575
+ }, s = {
576
+ x: r / 2 * t,
577
+ y: -(r / 2) * n
578
+ };
579
+ return `M ${a.x},${a.y} L ${s.x},${s.y}
580
+ M ${i.x},${i.y} L ${o.x},${o.y}`;
581
+ }
582
+ t(de, "createLine");
583
+ function fe(t, n) {
584
+ let { labelStyles: r, nodeStyles: i } = y(n);
585
+ n.labelStyle = r, n.label = "";
586
+ let a = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = S.svg(a), l = v(n, {});
587
+ n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
588
+ let u = c.circle(0, 0, o * 2, l), d = de(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
589
+ return p.insert(() => f), p.attr("class", "outer-path"), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), T(n, p), n.intersect = function(t) {
590
+ return e.info("crossedCircle intersect", n, {
591
+ radius: o,
592
+ point: t
593
+ }), W.circle(n, o, t);
594
+ }, a;
595
+ }
596
+ t(fe, "crossedCircle");
597
+ function J(e, t, n, r = 100, i = 0, a = 180) {
598
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
599
+ for (let i = 0; i < r; i++) {
600
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
601
+ o.push({
602
+ x: -a,
603
+ y: -l
604
+ });
605
+ }
606
+ return o;
607
+ }
608
+ t(J, "generateCirclePoints");
609
+ async function pe(e, t) {
610
+ let { labelStyles: n, nodeStyles: r } = y(t);
611
+ t.labelStyle = n;
612
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + s, u = a.height + c, d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
613
+ ...J(l / 2, -u / 2, d, 30, -90, 0),
614
+ {
615
+ x: -l / 2 - d,
616
+ y: d
617
+ },
618
+ ...J(l / 2 + d * 2, -d, d, 20, -180, -270),
619
+ ...J(l / 2 + d * 2, d, d, 20, -90, -180),
620
+ {
621
+ x: -l / 2 - d,
622
+ y: -u / 2
623
+ },
624
+ ...J(l / 2, u / 2, d, 20, 0, 90)
625
+ ], m = [
626
+ {
627
+ x: l / 2,
628
+ y: -u / 2 - d
629
+ },
630
+ {
631
+ x: -l / 2,
632
+ y: -u / 2 - d
633
+ },
634
+ ...J(l / 2, -u / 2, d, 20, -90, 0),
635
+ {
636
+ x: -l / 2 - d,
637
+ y: -d
638
+ },
639
+ ...J(l / 2 + l * .1, -d, d, 20, -180, -270),
640
+ ...J(l / 2 + l * .1, d, d, 20, -90, -180),
641
+ {
642
+ x: -l / 2 - d,
643
+ y: u / 2
644
+ },
645
+ ...J(l / 2, u / 2, d, 20, 0, 90),
646
+ {
647
+ x: -l / 2,
648
+ y: u / 2 + d
649
+ },
650
+ {
651
+ x: l / 2,
652
+ y: u / 2 + d
653
+ }
654
+ ], h = S.svg(i), g = v(t, { fill: "none" });
655
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
656
+ let _ = D(p).replace("Z", ""), b = h.path(_, g), x = D(m), w = h.path(x, { ...g }), O = i.insert("g", ":first-child");
657
+ return O.insert(() => w, ":first-child").attr("stroke-opacity", 0), O.insert(() => b, ":first-child"), O.attr("class", "text"), f && t.look !== "handDrawn" && O.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), O.attr("transform", `translate(${d}, 0)`), o.attr("transform", `translate(${-l / 2 + d - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, O), t.intersect = function(e) {
658
+ return W.polygon(t, m, e);
659
+ }, i;
660
+ }
661
+ t(pe, "curlyBraceLeft");
662
+ function Y(e, t, n, r = 100, i = 0, a = 180) {
663
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
664
+ for (let i = 0; i < r; i++) {
665
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
666
+ o.push({
667
+ x: a,
668
+ y: l
669
+ });
670
+ }
671
+ return o;
672
+ }
673
+ t(Y, "generateCirclePoints");
674
+ async function me(e, t) {
675
+ let { labelStyles: n, nodeStyles: r } = y(t);
676
+ t.labelStyle = n;
677
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
678
+ ...Y(l / 2, -u / 2, d, 20, -90, 0),
679
+ {
680
+ x: l / 2 + d,
681
+ y: -d
682
+ },
683
+ ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
684
+ ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
685
+ {
686
+ x: l / 2 + d,
687
+ y: u / 2
688
+ },
689
+ ...Y(l / 2, u / 2, d, 20, 0, 90)
690
+ ], m = [
691
+ {
692
+ x: -l / 2,
693
+ y: -u / 2 - d
694
+ },
695
+ {
696
+ x: l / 2,
697
+ y: -u / 2 - d
698
+ },
699
+ ...Y(l / 2, -u / 2, d, 20, -90, 0),
700
+ {
701
+ x: l / 2 + d,
702
+ y: -d
703
+ },
704
+ ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
705
+ ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
706
+ {
707
+ x: l / 2 + d,
708
+ y: u / 2
709
+ },
710
+ ...Y(l / 2, u / 2, d, 20, 0, 90),
711
+ {
712
+ x: l / 2,
713
+ y: u / 2 + d
714
+ },
715
+ {
716
+ x: -l / 2,
717
+ y: u / 2 + d
718
+ }
719
+ ], h = S.svg(i), g = v(t, { fill: "none" });
720
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
721
+ let _ = D(p).replace("Z", ""), b = h.path(_, g), x = D(m), w = h.path(x, { ...g }), O = i.insert("g", ":first-child");
722
+ return O.insert(() => w, ":first-child").attr("stroke-opacity", 0), O.insert(() => b, ":first-child"), O.attr("class", "text"), f && t.look !== "handDrawn" && O.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), O.attr("transform", `translate(${-d}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, O), t.intersect = function(e) {
723
+ return W.polygon(t, m, e);
724
+ }, i;
725
+ }
726
+ t(me, "curlyBraceRight");
727
+ function X(e, t, n, r = 100, i = 0, a = 180) {
728
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
729
+ for (let i = 0; i < r; i++) {
730
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
731
+ o.push({
732
+ x: -a,
733
+ y: -l
734
+ });
735
+ }
736
+ return o;
737
+ }
738
+ t(X, "generateCirclePoints");
739
+ async function he(e, t) {
740
+ let { labelStyles: n, nodeStyles: r } = y(t);
741
+ t.labelStyle = n;
742
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
743
+ ...X(l / 2, -u / 2, d, 30, -90, 0),
744
+ {
745
+ x: -l / 2 - d,
746
+ y: d
747
+ },
748
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
749
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
750
+ {
751
+ x: -l / 2 - d,
752
+ y: -u / 2
753
+ },
754
+ ...X(l / 2, u / 2, d, 20, 0, 90)
755
+ ], m = [
756
+ ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
757
+ {
758
+ x: l / 2 - d / 2,
759
+ y: d
760
+ },
761
+ ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
762
+ ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
763
+ {
764
+ x: l / 2 - d / 2,
765
+ y: -d
766
+ },
767
+ ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
768
+ ], h = [
769
+ {
770
+ x: l / 2,
771
+ y: -u / 2 - d
772
+ },
773
+ {
774
+ x: -l / 2,
775
+ y: -u / 2 - d
776
+ },
777
+ ...X(l / 2, -u / 2, d, 20, -90, 0),
778
+ {
779
+ x: -l / 2 - d,
780
+ y: -d
781
+ },
782
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
783
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
784
+ {
785
+ x: -l / 2 - d,
786
+ y: u / 2
787
+ },
788
+ ...X(l / 2, u / 2, d, 20, 0, 90),
789
+ {
790
+ x: -l / 2,
791
+ y: u / 2 + d
792
+ },
793
+ {
794
+ x: l / 2 - d - d / 2,
795
+ y: u / 2 + d
796
+ },
797
+ ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
798
+ {
799
+ x: l / 2 - d / 2,
800
+ y: d
801
+ },
802
+ ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
803
+ ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
804
+ {
805
+ x: l / 2 - d / 2,
806
+ y: -d
807
+ },
808
+ ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
809
+ ], g = S.svg(i), _ = v(t, { fill: "none" });
810
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
811
+ let b = D(p).replace("Z", ""), x = g.path(b, _), w = D(m).replace("Z", ""), O = g.path(w, _), k = D(h), A = g.path(k, { ..._ }), j = i.insert("g", ":first-child");
812
+ return j.insert(() => A, ":first-child").attr("stroke-opacity", 0), j.insert(() => x, ":first-child"), j.insert(() => O, ":first-child"), j.attr("class", "text"), f && t.look !== "handDrawn" && j.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.attr("transform", `translate(${d - d / 4}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, j), t.intersect = function(e) {
813
+ return W.polygon(t, h, e);
814
+ }, i;
815
+ }
816
+ t(he, "curlyBraces");
817
+ async function ge(e, t) {
818
+ let { labelStyles: n, nodeStyles: r } = y(t);
819
+ t.labelStyle = n;
820
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = Math.max(20, (c.width + a * 2) * 1.25, t?.width ?? 0), u = Math.max(5, c.height + o * 2, t?.height ?? 0), d = u / 2, { cssStyles: f } = t, p = S.svg(s), m = v(t, {});
821
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
822
+ let h = l, g = u, _ = h - d, b = g / 4, x = [
823
+ {
824
+ x: _,
825
+ y: 0
826
+ },
827
+ {
828
+ x: b,
829
+ y: 0
830
+ },
831
+ {
832
+ x: 0,
833
+ y: g / 2
834
+ },
835
+ {
836
+ x: b,
837
+ y: g
838
+ },
839
+ {
840
+ x: _,
841
+ y: g
842
+ },
843
+ ...k(-_, -g / 2, d, 50, 270, 90)
844
+ ], w = D(x), O = p.path(w, m), A = s.insert(() => O, ":first-child");
845
+ return A.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && A.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && A.selectChildren("path").attr("style", r), A.attr("transform", `translate(${-l / 2}, ${-u / 2})`), T(t, A), t.intersect = function(e) {
846
+ return W.polygon(t, x, e);
847
+ }, s;
848
+ }
849
+ t(ge, "curvedTrapezoid");
850
+ var _e = /* @__PURE__ */ t((e, t, n, r, i, a) => [
851
+ `M${e},${t + a}`,
852
+ `a${i},${a} 0,0,0 ${n},0`,
853
+ `a${i},${a} 0,0,0 ${-n},0`,
854
+ `l0,${r}`,
855
+ `a${i},${a} 0,0,0 ${n},0`,
856
+ `l0,${-r}`
857
+ ].join(" "), "createCylinderPathD"), ve = /* @__PURE__ */ t((e, t, n, r, i, a) => [
858
+ `M${e},${t + a}`,
859
+ `M${e + n},${t + a}`,
860
+ `a${i},${a} 0,0,0 ${-n},0`,
861
+ `l0,${r}`,
862
+ `a${i},${a} 0,0,0 ${n},0`,
863
+ `l0,${-r}`
864
+ ].join(" "), "createOuterCylinderPathD"), ye = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), be = 8, xe = 8;
865
+ async function Se(e, t) {
866
+ let { labelStyles: n, nodeStyles: r } = y(t);
867
+ t.labelStyle = n;
868
+ let i = t.padding ?? 0, a = t.look === "neo" ? 24 : i, o = t.look === "neo" ? 24 : i;
869
+ if (t.width || t.height) {
870
+ let e = t.width ?? 0;
871
+ t.width = (t.width ?? 0) - o, t.width < xe && (t.width = xe);
872
+ let n = e / 2 / (2.5 + e / 50);
873
+ t.height = (t.height ?? 0) - a - n * 3, t.height < be && (t.height = be);
874
+ }
875
+ let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t.width ? t.width : c.width) + o, d = u / 2, p = d / (2.5 + u / 50), m = (t.height ? t.height : c.height) + a + p, h, { cssStyles: g } = t;
876
+ if (t.look === "handDrawn") {
877
+ let e = S.svg(s), n = ve(0, 0, u, m, d, p), r = ye(0, p, u, m, d, p), i = v(t, {}), a = e.path(n, i), o = e.path(r, v(t, { fill: "none" }));
878
+ h = s.insert(() => o, ":first-child"), h = s.insert(() => a, ":first-child"), h.attr("class", "basic label-container"), g && h.attr("style", g);
879
+ } else {
880
+ let e = _e(0, 0, u, m, d, p);
881
+ h = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", f(g)).attr("style", r);
882
+ }
883
+ return h.attr("label-offset-y", p), h.attr("transform", `translate(${-u / 2}, ${-(m / 2 + p)})`), T(t, h), l.attr("transform", `translate(${-(c.width / 2) - (c.x - (c.left ?? 0))}, ${-(c.height / 2) + (t.padding ?? 0) / 1.5 - (c.y - (c.top ?? 0))})`), t.intersect = function(e) {
884
+ let n = W.rect(t, e), r = n.x - (t.x ?? 0);
885
+ if (d != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - p)) {
886
+ let i = p * p * (1 - r * r / (d * d));
887
+ i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
888
+ }
889
+ return n;
890
+ }, s;
891
+ }
892
+ t(Se, "cylinder");
893
+ async function Ce(e, t) {
894
+ let { labelStyles: n, nodeStyles: r } = y(t);
895
+ t.labelStyle = n;
896
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = s.width + i, u = s.height + a, d = u * .2, f = -l / 2, p = -u / 2 - d / 2, { cssStyles: m } = t, h = S.svg(o), g = v(t, {});
897
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
898
+ let _ = [
899
+ {
900
+ x: f,
901
+ y: p + d
902
+ },
903
+ {
904
+ x: -f,
905
+ y: p + d
906
+ },
907
+ {
908
+ x: -f,
909
+ y: -p
910
+ },
911
+ {
912
+ x: f,
913
+ y: -p
914
+ },
915
+ {
916
+ x: f,
917
+ y: p
918
+ },
919
+ {
920
+ x: -f,
921
+ y: p
922
+ },
923
+ {
924
+ x: -f,
925
+ y: p + d
926
+ }
927
+ ], b = h.polygon(_.map((e) => [e.x, e.y]), g), x = o.insert(() => b, ":first-child");
928
+ return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), c.attr("transform", `translate(${f + (t.padding ?? 0) / 2 - (s.x - (s.left ?? 0))}, ${p + d + (t.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`), T(t, x), t.intersect = function(e) {
929
+ return W.rect(t, e);
930
+ }, o;
931
+ }
932
+ t(Ce, "dividedRectangle");
933
+ async function we(t, n) {
934
+ let { labelStyles: r, nodeStyles: i } = y(n), a = n.look === "neo" ? 12 : 5;
935
+ n.labelStyle = r;
936
+ let o = n.padding ?? 0, s = n.look === "neo" ? 16 : o, { shapeSvg: c, bbox: l } = await C(t, n, E(n)), u = (n?.width ? n?.width / 2 : l.width / 2) + (s ?? 0), d = u - a, p, { cssStyles: m } = n;
937
+ if (n.look === "handDrawn") {
938
+ let e = S.svg(c), t = v(n, {
939
+ roughness: .2,
940
+ strokeWidth: 2.5
941
+ }), r = v(n, {
942
+ roughness: .2,
943
+ strokeWidth: 1.5
944
+ }), i = e.circle(0, 0, u * 2, t), a = e.circle(0, 0, d * 2, r);
945
+ p = c.insert("g", ":first-child"), p.attr("class", f(n.cssClasses)).attr("style", f(m)), p.node()?.appendChild(i), p.node()?.appendChild(a);
946
+ } else {
947
+ p = c.insert("g", ":first-child");
948
+ let e = p.insert("circle", ":first-child"), t = p.insert("circle");
949
+ p.attr("class", "basic label-container").attr("style", i), e.attr("class", "outer-circle").attr("style", i).attr("r", u).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", i).attr("r", d).attr("cx", 0).attr("cy", 0);
950
+ }
951
+ return T(n, p), n.intersect = function(t) {
952
+ return e.info("DoubleCircle intersect", n, u, t), W.circle(n, u, t);
953
+ }, c;
954
+ }
955
+ t(we, "doublecircle");
956
+ function Te(t, n, { config: { themeVariables: r } }) {
957
+ let { labelStyles: i, nodeStyles: a } = y(n);
958
+ n.label = "", n.labelStyle = i;
959
+ let o = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = S.svg(o), { nodeBorder: l } = r, u = v(n, { fillStyle: "solid" });
960
+ n.look !== "handDrawn" && (u.roughness = 0);
961
+ let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
962
+ return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), T(n, f), n.intersect = function(t) {
963
+ return e.info("filledCircle intersect", n, {
964
+ radius: 7,
965
+ point: t
966
+ }), W.circle(n, 7, t);
967
+ }, o;
968
+ }
969
+ t(Te, "filledCircle");
970
+ var Ee = 10, De = 10;
971
+ async function Oe(t, n) {
972
+ let { labelStyles: r, nodeStyles: i } = y(n);
973
+ n.labelStyle = r;
974
+ let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
975
+ (n.width || n.height) && (n.height = n?.height ?? 0, n.height < Ee && (n.height = Ee), n.width = (n?.width ?? 0) - o - o / 2, n.width < De && (n.width = De));
976
+ let { shapeSvg: s, bbox: c, label: l } = await C(t, n, E(n)), u = (n?.width ? n?.width : c.width) + (o ?? 0), d = n?.height ? n?.height : u + c.height, f = d, p = [
977
+ {
978
+ x: 0,
979
+ y: -d
980
+ },
981
+ {
982
+ x: f,
983
+ y: -d
984
+ },
985
+ {
986
+ x: f / 2,
987
+ y: 0
988
+ }
989
+ ], { cssStyles: m } = n, h = S.svg(s), g = v(n, {});
990
+ n.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
991
+ let _ = D(p), b = h.path(_, g), x = s.insert(() => b, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`).attr("class", "outer-path");
992
+ return m && n.look !== "handDrawn" && x.selectChildren("path").attr("style", m), i && n.look !== "handDrawn" && x.selectChildren("path").attr("style", i), n.width = u, n.height = d, T(n, x), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-d / 2 + (n.padding ?? 0) / 2 + (c.y - (c.top ?? 0))})`), n.intersect = function(t) {
993
+ return e.info("Triangle intersect", n, p, t), W.polygon(n, p, t);
994
+ }, s;
995
+ }
996
+ t(Oe, "flippedTriangle");
997
+ function ke(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
998
+ let { nodeStyles: a } = y(t);
999
+ t.label = "";
1000
+ let o = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
1001
+ n === "LR" && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
1002
+ let u = -1 * c / 2, d = -1 * l / 2, f = S.svg(o), p = v(t, {
1003
+ stroke: i.lineColor,
1004
+ fill: i.lineColor
1005
+ });
1006
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1007
+ let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
1008
+ s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), T(t, h);
1009
+ let g = r?.padding ?? 0;
1010
+ return t.width && t.height && (t.width += g / 2 || 0, t.height += g / 2 || 0), t.intersect = function(e) {
1011
+ return W.rect(t, e);
1012
+ }, o;
1013
+ }
1014
+ t(ke, "forkJoin");
1015
+ async function Ae(t, n) {
1016
+ let { labelStyles: r, nodeStyles: i } = y(n);
1017
+ n.labelStyle = r;
1018
+ let a = n.look === "neo" ? 16 : n.padding ?? 0, o = n.look === "neo" ? 12 : n.padding ?? 0;
1019
+ (n.width || n.height) && (n.height = (n?.height ?? 0) - o * 2, n.height < 10 && (n.height = 10), n.width = (n?.width ?? 0) - a * 2, n.width < 15 && (n.width = 15));
1020
+ let { shapeSvg: s, bbox: c } = await C(t, n, E(n)), l = (n?.width ? n?.width : Math.max(15, c.width)) + a * 2, u = (n?.height ? n?.height : Math.max(10, c.height)) + o * 2, d = u / 2, { cssStyles: f } = n, p = S.svg(s), m = v(n, {});
1021
+ n.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
1022
+ let h = [
1023
+ {
1024
+ x: -l / 2,
1025
+ y: -u / 2
1026
+ },
1027
+ {
1028
+ x: l / 2 - d,
1029
+ y: -u / 2
1030
+ },
1031
+ ...k(-l / 2 + d, 0, d, 50, 90, 270),
1032
+ {
1033
+ x: l / 2 - d,
1034
+ y: u / 2
1035
+ },
1036
+ {
1037
+ x: -l / 2,
1038
+ y: u / 2
1039
+ }
1040
+ ], g = D(h), _ = p.path(g, m), b = s.insert(() => _, ":first-child");
1041
+ return b.attr("class", "basic label-container outer-path"), f && n.look !== "handDrawn" && b.selectChildren("path").attr("style", f), i && n.look !== "handDrawn" && b.selectChildren("path").attr("style", i), T(n, b), n.intersect = function(t) {
1042
+ return e.info("Pill intersect", n, {
1043
+ radius: d,
1044
+ point: t
1045
+ }), W.polygon(n, h, t);
1046
+ }, s;
1047
+ }
1048
+ t(Ae, "halfRoundedRectangle");
1049
+ var je = /* @__PURE__ */ t((e, t, n, r, i) => [
1050
+ `M${e + i},${t}`,
1051
+ `L${e + n - i},${t}`,
1052
+ `L${e + n},${t - r / 2}`,
1053
+ `L${e + n - i},${t - r}`,
1054
+ `L${e + i},${t - r}`,
1055
+ `L${e},${t - r / 2}`,
1056
+ "Z"
1057
+ ].join(" "), "createHexagonPathD");
1058
+ async function Me(e, t) {
1059
+ let { labelStyles: n, nodeStyles: r } = y(t), i = t.look === "neo" ? 3.5 : 4;
1060
+ t.labelStyle = n;
1061
+ let a = t.padding ?? 0, o = t.look === "neo" ? 70 : a, s = t.look === "neo" ? 32 : a;
1062
+ if (t.width || t.height) {
1063
+ let e = (t.height ?? 0) / i;
1064
+ t.width = (t?.width ?? 0) - 2 * e - s, t.height = (t.height ?? 0) - o;
1065
+ }
1066
+ let { shapeSvg: c, bbox: l } = await C(e, t, E(t)), u = (t?.height ? t?.height : l.height) + o, d = u / i, f = (t?.width ? t?.width : l.width) + 2 * d + s, p = [
1067
+ {
1068
+ x: d,
1069
+ y: 0
1070
+ },
1071
+ {
1072
+ x: f - d,
1073
+ y: 0
1074
+ },
1075
+ {
1076
+ x: f,
1077
+ y: -u / 2
1078
+ },
1079
+ {
1080
+ x: f - d,
1081
+ y: -u
1082
+ },
1083
+ {
1084
+ x: d,
1085
+ y: -u
1086
+ },
1087
+ {
1088
+ x: 0,
1089
+ y: -u / 2
1090
+ }
1091
+ ], m, { cssStyles: h } = t;
1092
+ if (t.look === "handDrawn") {
1093
+ let e = S.svg(c), n = v(t, {}), r = je(0, 0, f, u, d), i = e.path(r, n);
1094
+ m = c.insert(() => i, ":first-child").attr("transform", `translate(${-f / 2}, ${u / 2})`), h && m.attr("style", h);
1095
+ } else m = q(c, f, u, p);
1096
+ return r && m.attr("style", r), t.width = f, t.height = u, T(t, m), t.intersect = function(e) {
1097
+ return W.polygon(t, p, e);
1098
+ }, c;
1099
+ }
1100
+ t(Me, "hexagon");
1101
+ async function Ne(t, n) {
1102
+ let { labelStyles: r, nodeStyles: i } = y(n);
1103
+ n.label = "", n.labelStyle = r;
1104
+ let { shapeSvg: a } = await C(t, n, E(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = S.svg(a), u = v(n, {});
1105
+ n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1106
+ let d = [
1107
+ {
1108
+ x: 0,
1109
+ y: 0
1110
+ },
1111
+ {
1112
+ x: o,
1113
+ y: 0
1114
+ },
1115
+ {
1116
+ x: 0,
1117
+ y: s
1118
+ },
1119
+ {
1120
+ x: o,
1121
+ y: s
1122
+ }
1123
+ ], f = D(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
1124
+ return m.attr("class", "basic label-container outer-path"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), T(n, m), n.intersect = function(t) {
1125
+ return e.info("Pill intersect", n, { points: d }), W.polygon(n, d, t);
1126
+ }, a;
1127
+ }
1128
+ t(Ne, "hourglass");
1129
+ async function Pe(t, n, { config: { themeVariables: r, flowchart: i } }) {
1130
+ let { labelStyles: a } = y(n);
1131
+ n.labelStyle = a;
1132
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1133
+ n.width = Math.max(c, l ?? 0);
1134
+ let { shapeSvg: u, bbox: d, label: f } = await C(t, n, "icon-shape default"), p = n.pos === "t", m = c, g = c, { nodeBorder: _ } = r, { stylesMap: b } = x(n), w = -g / 2, E = -m / 2, D = n.label ? 8 : 0, O = S.svg(u), k = v(n, {
1135
+ stroke: "none",
1136
+ fill: "none"
1137
+ });
1138
+ n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid");
1139
+ let A = O.rectangle(w, E, g, m, k), j = Math.max(g, d.width), M = m + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1140
+ ...k,
1141
+ fill: "transparent",
1142
+ stroke: "none"
1143
+ }), P = u.insert(() => A, ":first-child"), F = u.insert(() => N);
1144
+ if (n.icon) {
1145
+ let e = u.append("g");
1146
+ e.html(`<g>${await h(n.icon, {
1147
+ height: c,
1148
+ width: c,
1149
+ fallbackPrefix: ""
1150
+ })}</g>`);
1151
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1152
+ e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${b.get("stroke") ?? _};`);
1153
+ }
1154
+ return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -M / 2 : M / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), T(n, F), n.intersect = function(t) {
1155
+ if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
1156
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1157
+ return o = p ? [
1158
+ {
1159
+ x: r - d.width / 2,
1160
+ y: i - a / 2
1161
+ },
1162
+ {
1163
+ x: r + d.width / 2,
1164
+ y: i - a / 2
1165
+ },
1166
+ {
1167
+ x: r + d.width / 2,
1168
+ y: i - a / 2 + d.height + D
1169
+ },
1170
+ {
1171
+ x: r + g / 2,
1172
+ y: i - a / 2 + d.height + D
1173
+ },
1174
+ {
1175
+ x: r + g / 2,
1176
+ y: i + a / 2
1177
+ },
1178
+ {
1179
+ x: r - g / 2,
1180
+ y: i + a / 2
1181
+ },
1182
+ {
1183
+ x: r - g / 2,
1184
+ y: i - a / 2 + d.height + D
1185
+ },
1186
+ {
1187
+ x: r - d.width / 2,
1188
+ y: i - a / 2 + d.height + D
1189
+ }
1190
+ ] : [
1191
+ {
1192
+ x: r - g / 2,
1193
+ y: i - a / 2
1194
+ },
1195
+ {
1196
+ x: r + g / 2,
1197
+ y: i - a / 2
1198
+ },
1199
+ {
1200
+ x: r + g / 2,
1201
+ y: i - a / 2 + m
1202
+ },
1203
+ {
1204
+ x: r + d.width / 2,
1205
+ y: i - a / 2 + m
1206
+ },
1207
+ {
1208
+ x: r + d.width / 2 / 2,
1209
+ y: i + a / 2
1210
+ },
1211
+ {
1212
+ x: r - d.width / 2,
1213
+ y: i + a / 2
1214
+ },
1215
+ {
1216
+ x: r - d.width / 2,
1217
+ y: i - a / 2 + m
1218
+ },
1219
+ {
1220
+ x: r - g / 2,
1221
+ y: i - a / 2 + m
1222
+ }
1223
+ ], W.polygon(n, o, t);
1224
+ }, u;
1225
+ }
1226
+ t(Pe, "icon");
1227
+ async function Fe(t, n, { config: { themeVariables: r, flowchart: i } }) {
1228
+ let { labelStyles: a } = y(n);
1229
+ n.labelStyle = a;
1230
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1231
+ n.width = Math.max(c, l ?? 0);
1232
+ let { shapeSvg: u, bbox: d, label: f } = await C(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: g, mainBkg: _ } = r, { stylesMap: b } = x(n), w = S.svg(u), E = v(n, {});
1233
+ n.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid"), E.stroke = b.get("fill") ?? _;
1234
+ let D = u.append("g");
1235
+ n.icon && D.html(`<g>${await h(n.icon, {
1236
+ height: c,
1237
+ width: c,
1238
+ fallbackPrefix: ""
1239
+ })}</g>`);
1240
+ let O = D.node().getBBox(), k = O.width, A = O.height, j = O.x, M = O.y, N = Math.max(k, A) * Math.SQRT2 + 40, P = w.circle(0, 0, N, E), F = Math.max(N, d.width), I = N + d.height + p, ee = w.rectangle(-F / 2, -I / 2, F, I, {
1241
+ ...E,
1242
+ fill: "transparent",
1243
+ stroke: "none"
1244
+ }), te = u.insert(() => P, ":first-child"), L = u.insert(() => ee);
1245
+ return D.attr("transform", `translate(${-k / 2 - j},${m ? d.height / 2 + p / 2 - A / 2 - M : -d.height / 2 - p / 2 - A / 2 - M})`), D.attr("style", `color: ${b.get("stroke") ?? g};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -I / 2 : I / 2 - d.height})`), te.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), T(n, L), n.intersect = function(t) {
1246
+ return e.info("iconSquare intersect", n, t), W.rect(n, t);
1247
+ }, u;
1248
+ }
1249
+ t(Fe, "iconCircle");
1250
+ async function Ie(t, n, { config: { themeVariables: r, flowchart: i } }) {
1251
+ let { labelStyles: a } = y(n);
1252
+ n.labelStyle = a;
1253
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1254
+ n.width = Math.max(c, l ?? 0);
1255
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(t, n, "icon-shape default"), m = n.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = r, { stylesMap: E } = x(n), D = -_ / 2, O = -g / 2, k = n.label ? 8 : 0, A = S.svg(u), j = v(n, {});
1256
+ n.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1257
+ let M = A.path(N(D, O, _, g, 5), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1258
+ ...j,
1259
+ fill: "transparent",
1260
+ stroke: "none"
1261
+ }), ee = u.insert(() => M, ":first-child").attr("class", "icon-shape2"), te = u.insert(() => I);
1262
+ if (n.icon) {
1263
+ let e = u.append("g");
1264
+ e.html(`<g>${await h(n.icon, {
1265
+ height: c,
1266
+ width: c,
1267
+ fallbackPrefix: ""
1268
+ })}</g>`);
1269
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1270
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
1271
+ }
1272
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), ee.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(n, te), n.intersect = function(t) {
1273
+ if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
1274
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1275
+ return o = m ? [
1276
+ {
1277
+ x: r - d.width / 2,
1278
+ y: i - a / 2
1279
+ },
1280
+ {
1281
+ x: r + d.width / 2,
1282
+ y: i - a / 2
1283
+ },
1284
+ {
1285
+ x: r + d.width / 2,
1286
+ y: i - a / 2 + d.height + k
1287
+ },
1288
+ {
1289
+ x: r + _ / 2,
1290
+ y: i - a / 2 + d.height + k
1291
+ },
1292
+ {
1293
+ x: r + _ / 2,
1294
+ y: i + a / 2
1295
+ },
1296
+ {
1297
+ x: r - _ / 2,
1298
+ y: i + a / 2
1299
+ },
1300
+ {
1301
+ x: r - _ / 2,
1302
+ y: i - a / 2 + d.height + k
1303
+ },
1304
+ {
1305
+ x: r - d.width / 2,
1306
+ y: i - a / 2 + d.height + k
1307
+ }
1308
+ ] : [
1309
+ {
1310
+ x: r - _ / 2,
1311
+ y: i - a / 2
1312
+ },
1313
+ {
1314
+ x: r + _ / 2,
1315
+ y: i - a / 2
1316
+ },
1317
+ {
1318
+ x: r + _ / 2,
1319
+ y: i - a / 2 + g
1320
+ },
1321
+ {
1322
+ x: r + d.width / 2,
1323
+ y: i - a / 2 + g
1324
+ },
1325
+ {
1326
+ x: r + d.width / 2 / 2,
1327
+ y: i + a / 2
1328
+ },
1329
+ {
1330
+ x: r - d.width / 2,
1331
+ y: i + a / 2
1332
+ },
1333
+ {
1334
+ x: r - d.width / 2,
1335
+ y: i - a / 2 + g
1336
+ },
1337
+ {
1338
+ x: r - _ / 2,
1339
+ y: i - a / 2 + g
1340
+ }
1341
+ ], W.polygon(n, o, t);
1342
+ }, u;
1343
+ }
1344
+ t(Ie, "iconRounded");
1345
+ async function Le(t, n, { config: { themeVariables: r, flowchart: i } }) {
1346
+ let { labelStyles: a } = y(n);
1347
+ n.labelStyle = a;
1348
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1349
+ n.width = Math.max(c, l ?? 0);
1350
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(t, n, "icon-shape default"), m = n.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = r, { stylesMap: E } = x(n), D = -_ / 2, O = -g / 2, k = n.label ? 8 : 0, A = S.svg(u), j = v(n, {});
1351
+ n.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1352
+ let M = A.path(N(D, O, _, g, .1), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1353
+ ...j,
1354
+ fill: "transparent",
1355
+ stroke: "none"
1356
+ }), ee = u.insert(() => M, ":first-child"), te = u.insert(() => I);
1357
+ if (n.icon) {
1358
+ let e = u.append("g");
1359
+ e.html(`<g>${await h(n.icon, {
1360
+ height: c,
1361
+ width: c,
1362
+ fallbackPrefix: ""
1363
+ })}</g>`);
1364
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1365
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
1366
+ }
1367
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), ee.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(n, te), n.intersect = function(t) {
1368
+ if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
1369
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1370
+ return o = m ? [
1371
+ {
1372
+ x: r - d.width / 2,
1373
+ y: i - a / 2
1374
+ },
1375
+ {
1376
+ x: r + d.width / 2,
1377
+ y: i - a / 2
1378
+ },
1379
+ {
1380
+ x: r + d.width / 2,
1381
+ y: i - a / 2 + d.height + k
1382
+ },
1383
+ {
1384
+ x: r + _ / 2,
1385
+ y: i - a / 2 + d.height + k
1386
+ },
1387
+ {
1388
+ x: r + _ / 2,
1389
+ y: i + a / 2
1390
+ },
1391
+ {
1392
+ x: r - _ / 2,
1393
+ y: i + a / 2
1394
+ },
1395
+ {
1396
+ x: r - _ / 2,
1397
+ y: i - a / 2 + d.height + k
1398
+ },
1399
+ {
1400
+ x: r - d.width / 2,
1401
+ y: i - a / 2 + d.height + k
1402
+ }
1403
+ ] : [
1404
+ {
1405
+ x: r - _ / 2,
1406
+ y: i - a / 2
1407
+ },
1408
+ {
1409
+ x: r + _ / 2,
1410
+ y: i - a / 2
1411
+ },
1412
+ {
1413
+ x: r + _ / 2,
1414
+ y: i - a / 2 + g
1415
+ },
1416
+ {
1417
+ x: r + d.width / 2,
1418
+ y: i - a / 2 + g
1419
+ },
1420
+ {
1421
+ x: r + d.width / 2 / 2,
1422
+ y: i + a / 2
1423
+ },
1424
+ {
1425
+ x: r - d.width / 2,
1426
+ y: i + a / 2
1427
+ },
1428
+ {
1429
+ x: r - d.width / 2,
1430
+ y: i - a / 2 + g
1431
+ },
1432
+ {
1433
+ x: r - _ / 2,
1434
+ y: i - a / 2 + g
1435
+ }
1436
+ ], W.polygon(n, o, t);
1437
+ }, u;
1438
+ }
1439
+ t(Le, "iconSquare");
1440
+ async function Re(t, n, { config: { flowchart: r } }) {
1441
+ let i = new Image();
1442
+ i.src = n?.img ?? "", await i.decode();
1443
+ let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
1444
+ n.imageAspectRatio = a / o;
1445
+ let { labelStyles: s } = y(n);
1446
+ n.labelStyle = s;
1447
+ let c = r?.wrappingWidth;
1448
+ n.defaultWidth = r?.wrappingWidth;
1449
+ let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
1450
+ n.width = Math.max(u, c ?? 0);
1451
+ let { shapeSvg: f, bbox: p, label: m } = await C(t, n, "image-shape default"), h = n.pos === "t", g = -u / 2, _ = -d / 2, b = n.label ? 8 : 0, x = S.svg(f), w = v(n, {});
1452
+ n.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
1453
+ let E = x.rectangle(g, _, u, d, w), D = Math.max(u, p.width), O = d + p.height + b, k = x.rectangle(-D / 2, -O / 2, D, O, {
1454
+ ...w,
1455
+ fill: "none",
1456
+ stroke: "none"
1457
+ }), A = f.insert(() => E, ":first-child"), j = f.insert(() => k);
1458
+ if (n.img) {
1459
+ let e = f.append("image");
1460
+ e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? O / 2 - d : -O / 2})`);
1461
+ }
1462
+ return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), A.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), T(n, j), n.intersect = function(t) {
1463
+ if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
1464
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1465
+ return o = h ? [
1466
+ {
1467
+ x: r - p.width / 2,
1468
+ y: i - a / 2
1469
+ },
1470
+ {
1471
+ x: r + p.width / 2,
1472
+ y: i - a / 2
1473
+ },
1474
+ {
1475
+ x: r + p.width / 2,
1476
+ y: i - a / 2 + p.height + b
1477
+ },
1478
+ {
1479
+ x: r + u / 2,
1480
+ y: i - a / 2 + p.height + b
1481
+ },
1482
+ {
1483
+ x: r + u / 2,
1484
+ y: i + a / 2
1485
+ },
1486
+ {
1487
+ x: r - u / 2,
1488
+ y: i + a / 2
1489
+ },
1490
+ {
1491
+ x: r - u / 2,
1492
+ y: i - a / 2 + p.height + b
1493
+ },
1494
+ {
1495
+ x: r - p.width / 2,
1496
+ y: i - a / 2 + p.height + b
1497
+ }
1498
+ ] : [
1499
+ {
1500
+ x: r - u / 2,
1501
+ y: i - a / 2
1502
+ },
1503
+ {
1504
+ x: r + u / 2,
1505
+ y: i - a / 2
1506
+ },
1507
+ {
1508
+ x: r + u / 2,
1509
+ y: i - a / 2 + d
1510
+ },
1511
+ {
1512
+ x: r + p.width / 2,
1513
+ y: i - a / 2 + d
1514
+ },
1515
+ {
1516
+ x: r + p.width / 2 / 2,
1517
+ y: i + a / 2
1518
+ },
1519
+ {
1520
+ x: r - p.width / 2,
1521
+ y: i + a / 2
1522
+ },
1523
+ {
1524
+ x: r - p.width / 2,
1525
+ y: i - a / 2 + d
1526
+ },
1527
+ {
1528
+ x: r - u / 2,
1529
+ y: i - a / 2 + d
1530
+ }
1531
+ ], W.polygon(n, o, t);
1532
+ }, f;
1533
+ }
1534
+ t(Re, "imageSquare");
1535
+ async function ze(e, t) {
1536
+ let { labelStyles: n, nodeStyles: r } = y(t);
1537
+ t.labelStyle = n;
1538
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = Math.max(c.width + (o ?? 0) * 2, t?.width ?? 0), u = Math.max(c.height + (a ?? 0) * 2, t?.height ?? 0), d = [
1539
+ {
1540
+ x: 0,
1541
+ y: 0
1542
+ },
1543
+ {
1544
+ x: l,
1545
+ y: 0
1546
+ },
1547
+ {
1548
+ x: l + 3 * u / 6,
1549
+ y: -u
1550
+ },
1551
+ {
1552
+ x: -3 * u / 6,
1553
+ y: -u
1554
+ }
1555
+ ], f, { cssStyles: p } = t;
1556
+ if (t.look === "handDrawn") {
1557
+ let e = S.svg(s), n = v(t, {}), r = D(d), i = e.path(r, n);
1558
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), p && f.attr("style", p);
1559
+ } else f = q(s, l, u, d);
1560
+ return r && f.attr("style", r), t.width = l, t.height = u, T(t, f), t.intersect = function(e) {
1561
+ return W.polygon(t, d, e);
1562
+ }, s;
1563
+ }
1564
+ t(ze, "inv_trapezoid");
1565
+ async function Be(e, t, n) {
1566
+ let { labelStyles: r, nodeStyles: i } = y(t);
1567
+ t.labelStyle = r;
1568
+ let { shapeSvg: a, bbox: o } = await C(e, t, E(t)), s = Math.max(o.width + n.labelPaddingX * 2, t?.width || 0), c = Math.max(o.height + n.labelPaddingY * 2, t?.height || 0), l = -s / 2, u = -c / 2, d, { rx: p, ry: m } = t, { cssStyles: h } = t;
1569
+ if (n?.rx && n.ry && (p = n.rx, m = n.ry), t.look === "handDrawn") {
1570
+ let e = S.svg(a), n = v(t, {}), r = p || m ? e.path(N(l, u, s, c, p || 0), n) : e.rectangle(l, u, s, c, n);
1571
+ d = a.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", f(h));
1572
+ } else d = a.insert("rect", ":first-child"), d.attr("class", "basic label-container").attr("style", i).attr("rx", f(p)).attr("ry", f(m)).attr("x", l).attr("y", u).attr("width", s).attr("height", c);
1573
+ return T(t, d), t.calcIntersect = function(e, t) {
1574
+ return W.rect(e, t);
1575
+ }, t.intersect = function(e) {
1576
+ return W.rect(t, e);
1577
+ }, a;
1578
+ }
1579
+ t(Be, "drawRect");
1580
+ async function Ve(e, t) {
1581
+ let { shapeSvg: n, bbox: r, label: i } = await C(e, t, "label"), a = n.insert("rect", ":first-child");
1582
+ return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), T(t, a), t.intersect = function(e) {
1583
+ return W.rect(t, e);
1584
+ }, n;
1585
+ }
1586
+ t(Ve, "labelRect");
1587
+ async function He(e, t) {
1588
+ let { labelStyles: n, nodeStyles: r } = y(t);
1589
+ t.labelStyle = n;
1590
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
1591
+ {
1592
+ x: 0,
1593
+ y: 0
1594
+ },
1595
+ {
1596
+ x: u + 3 * l / 6,
1597
+ y: 0
1598
+ },
1599
+ {
1600
+ x: u,
1601
+ y: -l
1602
+ },
1603
+ {
1604
+ x: -(3 * l) / 6,
1605
+ y: -l
1606
+ }
1607
+ ], f, { cssStyles: p } = t;
1608
+ if (t.look === "handDrawn") {
1609
+ let e = S.svg(s), n = v(t, {}), r = D(d), i = e.path(r, n);
1610
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
1611
+ } else f = q(s, u, l, d);
1612
+ return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
1613
+ return W.polygon(t, d, e);
1614
+ }, s;
1615
+ }
1616
+ t(He, "lean_left");
1617
+ async function Ue(e, t) {
1618
+ let { labelStyles: n, nodeStyles: r } = y(t);
1619
+ t.labelStyle = n;
1620
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
1621
+ {
1622
+ x: -3 * l / 6,
1623
+ y: 0
1624
+ },
1625
+ {
1626
+ x: u,
1627
+ y: 0
1628
+ },
1629
+ {
1630
+ x: u + 3 * l / 6,
1631
+ y: -l
1632
+ },
1633
+ {
1634
+ x: 0,
1635
+ y: -l
1636
+ }
1637
+ ], f, { cssStyles: p } = t;
1638
+ if (t.look === "handDrawn") {
1639
+ let e = S.svg(s), n = v(t, {}), r = D(d), i = e.path(r, n);
1640
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
1641
+ } else f = q(s, u, l, d);
1642
+ return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
1643
+ return W.polygon(t, d, e);
1644
+ }, s;
1645
+ }
1646
+ t(Ue, "lean_right");
1647
+ function We(t, n) {
1648
+ let { labelStyles: r, nodeStyles: i } = y(n);
1649
+ n.label = "", n.labelStyle = r;
1650
+ let a = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
1651
+ {
1652
+ x: s,
1653
+ y: 0
1654
+ },
1655
+ {
1656
+ x: 0,
1657
+ y: c + 7 / 2
1658
+ },
1659
+ {
1660
+ x: s - 14,
1661
+ y: c + 7 / 2
1662
+ },
1663
+ {
1664
+ x: 0,
1665
+ y: 2 * c
1666
+ },
1667
+ {
1668
+ x: s,
1669
+ y: c - 7 / 2
1670
+ },
1671
+ {
1672
+ x: 14,
1673
+ y: c - 7 / 2
1674
+ }
1675
+ ], u = S.svg(a), d = v(n, {});
1676
+ n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
1677
+ let f = D(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
1678
+ return m.attr("class", "outer-path"), o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), T(n, m), n.intersect = function(t) {
1679
+ return e.info("lightningBolt intersect", n, t), W.polygon(n, l, t);
1680
+ }, a;
1681
+ }
1682
+ t(We, "lightningBolt");
1683
+ var Ge = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
1684
+ `M${e},${t + a}`,
1685
+ `a${i},${a} 0,0,0 ${n},0`,
1686
+ `a${i},${a} 0,0,0 ${-n},0`,
1687
+ `l0,${r}`,
1688
+ `a${i},${a} 0,0,0 ${n},0`,
1689
+ `l0,${-r}`,
1690
+ `M${e},${t + a + o}`,
1691
+ `a${i},${a} 0,0,0 ${n},0`
1692
+ ].join(" "), "createCylinderPathD"), Ke = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
1693
+ `M${e},${t + a}`,
1694
+ `M${e + n},${t + a}`,
1695
+ `a${i},${a} 0,0,0 ${-n},0`,
1696
+ `l0,${r}`,
1697
+ `a${i},${a} 0,0,0 ${n},0`,
1698
+ `l0,${-r}`,
1699
+ `M${e},${t + a + o}`,
1700
+ `a${i},${a} 0,0,0 ${n},0`
1701
+ ].join(" "), "createOuterCylinderPathD"), qe = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), Je = 10, Ye = 10;
1702
+ async function Xe(e, t) {
1703
+ let { labelStyles: n, nodeStyles: r } = y(t);
1704
+ t.labelStyle = n;
1705
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 24 : i;
1706
+ if (t.width || t.height) {
1707
+ let e = t.width ?? 0;
1708
+ t.width = (t.width ?? 0) - a, t.width < Ye && (t.width = Ye);
1709
+ let n = e / 2 / (2.5 + e / 50);
1710
+ t.height = (t.height ?? 0) - o - n * 3, t.height < Je && (t.height = Je);
1711
+ }
1712
+ let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = u / 2, p = d / (2.5 + u / 50), m = (t?.height ? t?.height : c.height) + p + o * 2, h = m * .1, g, { cssStyles: _ } = t;
1713
+ if (t.look === "handDrawn") {
1714
+ let e = S.svg(s), n = Ke(0, 0, u, m, d, p, h), r = qe(0, p, u, m, d, p), i = v(t, {}), a = e.path(n, i), o = e.path(r, i);
1715
+ s.insert(() => o, ":first-child").attr("class", "line"), g = s.insert(() => a, ":first-child"), g.attr("class", "basic label-container"), _ && g.attr("style", _);
1716
+ } else {
1717
+ let e = Ge(0, 0, u, m, d, p, h);
1718
+ g = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", f(_)).attr("style", r);
1719
+ }
1720
+ return g.attr("label-offset-y", p), g.attr("transform", `translate(${-u / 2}, ${-(m / 2 + p)})`), T(t, g), l.attr("transform", `translate(${-(c.width / 2) - (c.x - (c.left ?? 0))}, ${-(c.height / 2) + p - (c.y - (c.top ?? 0))})`), t.intersect = function(e) {
1721
+ let n = W.rect(t, e), r = n.x - (t.x ?? 0);
1722
+ if (d != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - p)) {
1723
+ let i = p * p * (1 - r * r / (d * d));
1724
+ i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
1725
+ }
1726
+ return n;
1727
+ }, s;
1728
+ }
1729
+ t(Xe, "linedCylinder");
1730
+ async function Ze(e, t) {
1731
+ let { labelStyles: n, nodeStyles: r } = y(t);
1732
+ t.labelStyle = n;
1733
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
1734
+ (t.width || t.height) && (t.width = (t.width ?? 0) * 10 / 11 - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
1735
+ let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ? t?.width : c.width) + (a ?? 0) * 2, d = (t?.height ? t?.height : c.height) + (o ?? 0) * 2, f = t.look === "neo" ? d / 4 : d / 8, p = d + f, { cssStyles: m } = t, h = S.svg(s), g = v(t, {});
1736
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1737
+ let _ = [
1738
+ {
1739
+ x: -u / 2 - u / 2 * .1,
1740
+ y: -p / 2
1741
+ },
1742
+ {
1743
+ x: -u / 2 - u / 2 * .1,
1744
+ y: p / 2
1745
+ },
1746
+ ...O(-u / 2 - u / 2 * .1, p / 2, u / 2 + u / 2 * .1, p / 2, f, .8),
1747
+ {
1748
+ x: u / 2 + u / 2 * .1,
1749
+ y: -p / 2
1750
+ },
1751
+ {
1752
+ x: -u / 2 - u / 2 * .1,
1753
+ y: -p / 2
1754
+ },
1755
+ {
1756
+ x: -u / 2,
1757
+ y: -p / 2
1758
+ },
1759
+ {
1760
+ x: -u / 2,
1761
+ y: p / 2 * 1.1
1762
+ },
1763
+ {
1764
+ x: -u / 2,
1765
+ y: -p / 2
1766
+ }
1767
+ ], b = h.polygon(_.map((e) => [e.x, e.y]), g), x = s.insert(() => b, ":first-child");
1768
+ return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(0,${-f / 2})`), l.attr("transform", `translate(${-u / 2 + (t.padding ?? 0) + u / 2 * .1 / 2 - (c.x - (c.left ?? 0))},${-d / 2 + (t.padding ?? 0) - f / 2 - (c.y - (c.top ?? 0))})`), T(t, x), t.intersect = function(e) {
1769
+ return W.polygon(t, _, e);
1770
+ }, s;
1771
+ }
1772
+ t(Ze, "linedWaveEdgedRect");
1773
+ async function Qe(e, t) {
1774
+ let { labelStyles: n, nodeStyles: r } = y(t);
1775
+ t.labelStyle = n;
1776
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = t.look === "neo" ? 10 : 5;
1777
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2 - 2 * s, 10), t.height = Math.max((t?.height ?? 0) - o * 2 - 2 * s, 10));
1778
+ let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(t)), d = (t?.width ? t?.width : l.width) + a * 2 + 2 * s, f = (t?.height ? t?.height : l.height) + o * 2 + 2 * s, p = d - 2 * s, m = f - 2 * s, h = -p / 2, g = -m / 2, { cssStyles: _ } = t, b = S.svg(c), x = v(t, {}), w = [
1779
+ {
1780
+ x: h - s,
1781
+ y: g + s
1782
+ },
1783
+ {
1784
+ x: h - s,
1785
+ y: g + m + s
1786
+ },
1787
+ {
1788
+ x: h + p - s,
1789
+ y: g + m + s
1790
+ },
1791
+ {
1792
+ x: h + p - s,
1793
+ y: g + m
1794
+ },
1795
+ {
1796
+ x: h + p,
1797
+ y: g + m
1798
+ },
1799
+ {
1800
+ x: h + p,
1801
+ y: g + m - s
1802
+ },
1803
+ {
1804
+ x: h + p + s,
1805
+ y: g + m - s
1806
+ },
1807
+ {
1808
+ x: h + p + s,
1809
+ y: g - s
1810
+ },
1811
+ {
1812
+ x: h + s,
1813
+ y: g - s
1814
+ },
1815
+ {
1816
+ x: h + s,
1817
+ y: g
1818
+ },
1819
+ {
1820
+ x: h,
1821
+ y: g
1822
+ },
1823
+ {
1824
+ x: h,
1825
+ y: g + s
1826
+ }
1827
+ ], O = [
1828
+ {
1829
+ x: h,
1830
+ y: g + s
1831
+ },
1832
+ {
1833
+ x: h + p - s,
1834
+ y: g + s
1835
+ },
1836
+ {
1837
+ x: h + p - s,
1838
+ y: g + m
1839
+ },
1840
+ {
1841
+ x: h + p,
1842
+ y: g + m
1843
+ },
1844
+ {
1845
+ x: h + p,
1846
+ y: g
1847
+ },
1848
+ {
1849
+ x: h,
1850
+ y: g
1851
+ }
1852
+ ];
1853
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
1854
+ let k = D(w), j = b.path(k, x), M = D(O), N = b.path(M, x);
1855
+ t.look !== "handDrawn" && (j = A(j), N = A(N));
1856
+ let P = c.insert("g", ":first-child");
1857
+ return P.insert(() => j), P.insert(() => N), P.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && P.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && P.selectAll("path").attr("style", r), u.attr("transform", `translate(${-(l.width / 2) - s - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + s - (l.y - (l.top ?? 0))})`), T(t, P), t.intersect = function(e) {
1858
+ return W.polygon(t, w, e);
1859
+ }, c;
1860
+ }
1861
+ t(Qe, "multiRect");
1862
+ async function $e(e, t) {
1863
+ let { labelStyles: n, nodeStyles: r } = y(t);
1864
+ t.labelStyle = n;
1865
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, l = t.look === "neo" ? 12 : s, u = !0;
1866
+ (t.width || t.height) && (u = !1, t.width = (t?.width ?? 0) - c * 2, t.height = (t?.height ?? 0) - l * 3);
1867
+ let d = Math.max(a.width, t?.width ?? 0) + c * 2, f = Math.max(a.height, t?.height ?? 0) + l * 3, p = t.look === "neo" ? f / 4 : f / 8, m = f + (u ? p / 2 : -p / 2), h = -d / 2, g = -m / 2, { cssStyles: _ } = t, b = O(h - 10, g + m + 10, h + d - 10, g + m + 10, p, .8), x = b?.[b.length - 1], w = [
1868
+ {
1869
+ x: h - 10,
1870
+ y: g + 10
1871
+ },
1872
+ {
1873
+ x: h - 10,
1874
+ y: g + m + 10
1875
+ },
1876
+ ...b,
1877
+ {
1878
+ x: h + d - 10,
1879
+ y: x.y - 10
1880
+ },
1881
+ {
1882
+ x: h + d,
1883
+ y: x.y - 10
1884
+ },
1885
+ {
1886
+ x: h + d,
1887
+ y: x.y - 20
1888
+ },
1889
+ {
1890
+ x: h + d + 10,
1891
+ y: x.y - 20
1892
+ },
1893
+ {
1894
+ x: h + d + 10,
1895
+ y: g - 10
1896
+ },
1897
+ {
1898
+ x: h + 10,
1899
+ y: g - 10
1900
+ },
1901
+ {
1902
+ x: h + 10,
1903
+ y: g
1904
+ },
1905
+ {
1906
+ x: h,
1907
+ y: g
1908
+ },
1909
+ {
1910
+ x: h,
1911
+ y: g + 10
1912
+ }
1913
+ ], k = [
1914
+ {
1915
+ x: h,
1916
+ y: g + 10
1917
+ },
1918
+ {
1919
+ x: h + d - 10,
1920
+ y: g + 10
1921
+ },
1922
+ {
1923
+ x: h + d - 10,
1924
+ y: x.y - 10
1925
+ },
1926
+ {
1927
+ x: h + d,
1928
+ y: x.y - 10
1929
+ },
1930
+ {
1931
+ x: h + d,
1932
+ y: g
1933
+ },
1934
+ {
1935
+ x: h,
1936
+ y: g
1937
+ }
1938
+ ], A = S.svg(i), j = v(t, {});
1939
+ t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid");
1940
+ let M = D(w), N = A.path(M, j), P = D(k), F = A.path(P, j), I = i.insert(() => N, ":first-child");
1941
+ return I.insert(() => F), I.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && I.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && I.selectAll("path").attr("style", r), I.attr("transform", `translate(0,${-p / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 10 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 10 - p / 2 - (a.y - (a.top ?? 0))})`), T(t, I), t.intersect = function(e) {
1942
+ return W.polygon(t, w, e);
1943
+ }, i;
1944
+ }
1945
+ t($e, "multiWaveEdgedRectangle");
1946
+ async function et(e, t, { config: { themeVariables: n } }) {
1947
+ let { labelStyles: r, nodeStyles: i } = y(t);
1948
+ t.labelStyle = r, t.useHtmlLabels || l(u()) || (t.centerLabel = !0);
1949
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), d = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), f = -c / 2, p = -d / 2, { cssStyles: m } = t, h = S.svg(a), g = v(t, {
1950
+ fill: n.noteBkgColor,
1951
+ stroke: n.noteBorderColor
1952
+ });
1953
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1954
+ let _ = h.rectangle(f, p, c, d, g), b = a.insert(() => _, ":first-child");
1955
+ return b.attr("class", "basic label-container outer-path"), s.attr("class", "label noteLabel"), m && t.look !== "handDrawn" && b.selectAll("path").attr("style", m), i && t.look !== "handDrawn" && b.selectAll("path").attr("style", i), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), T(t, b), t.intersect = function(e) {
1956
+ return W.rect(t, e);
1957
+ }, a;
1958
+ }
1959
+ t(et, "note");
1960
+ var tt = /* @__PURE__ */ t((e, t, n) => [
1961
+ `M${e + n / 2},${t}`,
1962
+ `L${e + n},${t - n / 2}`,
1963
+ `L${e + n / 2},${t - n}`,
1964
+ `L${e},${t - n / 2}`,
1965
+ "Z"
1966
+ ].join(" "), "createDecisionBoxPathD");
1967
+ async function nt(e, t) {
1968
+ let { labelStyles: n, nodeStyles: r } = y(t);
1969
+ t.labelStyle = n;
1970
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.width + (t.padding ?? 0) + (a.height + (t.padding ?? 0)), s = .5, c = [
1971
+ {
1972
+ x: o / 2,
1973
+ y: 0
1974
+ },
1975
+ {
1976
+ x: o,
1977
+ y: -o / 2
1978
+ },
1979
+ {
1980
+ x: o / 2,
1981
+ y: -o
1982
+ },
1983
+ {
1984
+ x: 0,
1985
+ y: -o / 2
1986
+ }
1987
+ ], l, { cssStyles: u } = t;
1988
+ if (t.look === "handDrawn") {
1989
+ let e = S.svg(i), n = v(t, {}), r = tt(0, 0, o), a = e.path(r, n);
1990
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
1991
+ } else l = q(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
1992
+ return r && l.attr("style", r), T(t, l), t.calcIntersect = function(e, t) {
1993
+ let n = e.width, r = [
1994
+ {
1995
+ x: n / 2,
1996
+ y: 0
1997
+ },
1998
+ {
1999
+ x: n,
2000
+ y: -n / 2
2001
+ },
2002
+ {
2003
+ x: n / 2,
2004
+ y: -n
2005
+ },
2006
+ {
2007
+ x: 0,
2008
+ y: -n / 2
2009
+ }
2010
+ ], i = W.polygon(e, r, t);
2011
+ return {
2012
+ x: i.x - .5,
2013
+ y: i.y - .5
2014
+ };
2015
+ }, t.intersect = function(e) {
2016
+ return this.calcIntersect(t, e);
2017
+ }, i;
2018
+ }
2019
+ t(nt, "question");
2020
+ async function rt(e, t) {
2021
+ let { labelStyles: n, nodeStyles: r } = y(t);
2022
+ t.labelStyle = n;
2023
+ let i = t.padding ?? 0, a = t.look === "neo" ? 21 : i ?? 0, o = t.look === "neo" ? 12 : i ?? 0, { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a), d = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), f = -u / 2, p = -d / 2, m = p / 2, h = [
2024
+ {
2025
+ x: f + m,
2026
+ y: p
2027
+ },
2028
+ {
2029
+ x: f,
2030
+ y: 0
2031
+ },
2032
+ {
2033
+ x: f + m,
2034
+ y: -p
2035
+ },
2036
+ {
2037
+ x: -f,
2038
+ y: -p
2039
+ },
2040
+ {
2041
+ x: -f,
2042
+ y: p
2043
+ }
2044
+ ], { cssStyles: g } = t, _ = S.svg(s), b = v(t, {});
2045
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2046
+ let x = D(h), w = _.path(x, b), O = s.insert(() => w, ":first-child");
2047
+ return O.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && O.selectAll("path").attr("style", g), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), O.attr("transform", `translate(${-m / 2},0)`), l.attr("transform", `translate(${-m / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), T(t, O), t.intersect = function(e) {
2048
+ return W.polygon(t, h, e);
2049
+ }, s;
2050
+ }
2051
+ t(rt, "rect_left_inv_arrow");
2052
+ async function it(t, r) {
2053
+ let { labelStyles: i, nodeStyles: o } = y(r);
2054
+ r.labelStyle = i;
2055
+ let s;
2056
+ s = r.cssClasses ? "node " + r.cssClasses : "node default";
2057
+ let c = t.insert("g").attr("class", s).attr("id", r.domId || r.id), u = c.insert("g"), d = c.insert("g").attr("class", "label").attr("style", o), f = r.description, p = r.label, m = await M(d, p, r.labelStyle, !0, !0), h = {
2058
+ width: 0,
2059
+ height: 0
2060
+ };
2061
+ if (l(a())) {
2062
+ let e = m.children[0], t = n(m);
2063
+ h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
2064
+ }
2065
+ e.info("Text 2", f);
2066
+ let g = f || [], _ = m.getBBox(), b = await M(d, Array.isArray(g) ? g.join("<br/>") : g, r.labelStyle, !0, !0), x = b.children[0], C = n(b);
2067
+ h = x.getBoundingClientRect(), C.attr("width", h.width), C.attr("height", h.height);
2068
+ let w = (r.padding || 0) / 2;
2069
+ n(b).attr("transform", "translate( " + (h.width > _.width ? 0 : (_.width - h.width) / 2) + ", " + (_.height + w + 5) + ")"), n(m).attr("transform", "translate( " + (h.width < _.width ? 0 : -(_.width - h.width) / 2) + ", 0)"), h = d.node().getBBox(), d.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - w + 3) + ")");
2070
+ let E = h.width + (r.padding || 0), D = h.height + (r.padding || 0), O = -h.width / 2 - w, k = -h.height / 2 - w, A, j;
2071
+ if (r.look === "handDrawn") {
2072
+ let t = S.svg(c), n = v(r, {}), i = t.path(N(O, k, E, D, r.rx || 0), n), a = t.line(-h.width / 2 - w, -h.height / 2 - w + _.height + w, h.width / 2 + w, -h.height / 2 - w + _.height + w, n);
2073
+ j = c.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), A = c.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
2074
+ } else A = u.insert("rect", ":first-child"), j = u.insert("line"), A.attr("class", "outer title-state").attr("style", o).attr("x", -h.width / 2 - w).attr("y", -h.height / 2 - w).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), j.attr("class", "divider").attr("x1", -h.width / 2 - w).attr("x2", h.width / 2 + w).attr("y1", -h.height / 2 - w + _.height + w).attr("y2", -h.height / 2 - w + _.height + w);
2075
+ return T(r, A), r.intersect = function(e) {
2076
+ return W.rect(r, e);
2077
+ }, c;
2078
+ }
2079
+ t(it, "rectWithTitle");
2080
+ async function at(e, t, { config: { themeVariables: n } }) {
2081
+ let r = n?.radius ?? 5;
2082
+ return Be(e, t, {
2083
+ rx: r,
2084
+ ry: r,
2085
+ classes: "",
2086
+ labelPaddingX: (t?.padding ?? 0) * 1,
2087
+ labelPaddingY: (t?.padding ?? 0) * 1
2088
+ });
2089
+ }
2090
+ t(at, "roundedRect");
2091
+ var Z = 8;
2092
+ async function ot(e, t) {
2093
+ let { labelStyles: n, nodeStyles: r } = y(t);
2094
+ t.labelStyle = n;
2095
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = (t?.width ?? s.width) + i * 2 + (t.look === "neo" ? Z : Z * 2), u = (t?.height ?? s.height) + a * 2, d = l - Z, p = u, m = Z - l / 2, h = -u / 2, { cssStyles: g } = t, _ = S.svg(o), b = v(t, {});
2096
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2097
+ let x = [
2098
+ {
2099
+ x: m,
2100
+ y: h
2101
+ },
2102
+ {
2103
+ x: m + d,
2104
+ y: h
2105
+ },
2106
+ {
2107
+ x: m + d,
2108
+ y: h + p
2109
+ },
2110
+ {
2111
+ x: m - Z,
2112
+ y: h + p
2113
+ },
2114
+ {
2115
+ x: m - Z,
2116
+ y: h
2117
+ },
2118
+ {
2119
+ x: m,
2120
+ y: h
2121
+ },
2122
+ {
2123
+ x: m,
2124
+ y: h + p
2125
+ }
2126
+ ], w = _.polygon(x.map((e) => [e.x, e.y]), b), D = o.insert(() => w, ":first-child");
2127
+ return D.attr("class", "basic label-container outer-path").attr("style", f(g)), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), g && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), c.attr("transform", `translate(${Z / 2 - s.width / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`), T(t, D), t.intersect = function(e) {
2128
+ return W.rect(t, e);
2129
+ }, o;
2130
+ }
2131
+ t(ot, "shadedProcess");
2132
+ async function st(e, t) {
2133
+ let { labelStyles: n, nodeStyles: r } = y(t);
2134
+ t.labelStyle = n;
2135
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2136
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2, 10), t.height = Math.max((t?.height ?? 0) / 1.5 - o * 2, 10));
2137
+ let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = ((t?.height ? t?.height : c.height) + o * 2) * 1.5, f = u, p = d / 1.5, m = -f / 2, h = -p / 2, { cssStyles: g } = t, _ = S.svg(s), b = v(t, {});
2138
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2139
+ let x = [
2140
+ {
2141
+ x: m,
2142
+ y: h
2143
+ },
2144
+ {
2145
+ x: m,
2146
+ y: h + p
2147
+ },
2148
+ {
2149
+ x: m + f,
2150
+ y: h + p
2151
+ },
2152
+ {
2153
+ x: m + f,
2154
+ y: h - p / 2
2155
+ }
2156
+ ], w = D(x), O = _.path(w, b), k = s.insert(() => O, ":first-child");
2157
+ return k.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && k.selectChildren("path").attr("style", g), r && t.look !== "handDrawn" && k.selectChildren("path").attr("style", r), k.attr("transform", `translate(0, ${p / 4})`), l.attr("transform", `translate(${-f / 2 + (t.padding ?? 0) - (c.x - (c.left ?? 0))}, ${-p / 4 + (t.padding ?? 0) - (c.y - (c.top ?? 0))})`), T(t, k), t.intersect = function(e) {
2158
+ return W.polygon(t, x, e);
2159
+ }, s;
2160
+ }
2161
+ t(st, "slopedRect");
2162
+ async function ct(e, t) {
2163
+ let n = t.padding ?? 0, r = t.look === "neo" ? 16 : n * 2, i = t.look === "neo" ? 12 : n;
2164
+ return Be(e, t, {
2165
+ rx: 0,
2166
+ ry: 0,
2167
+ classes: "",
2168
+ labelPaddingX: t.labelPaddingX ?? r,
2169
+ labelPaddingY: i
2170
+ });
2171
+ }
2172
+ t(ct, "squareRect");
2173
+ async function lt(e, t) {
2174
+ let { labelStyles: n, nodeStyles: r } = y(t);
2175
+ t.labelStyle = n;
2176
+ let i = t.padding ?? 0, a = t.look === "neo" ? 20 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = c.height + (t.look === "neo" ? o * 2 : o), u = c.width + l / 4 + (t.look === "neo" ? a * 2 : a), d = l / 2, { cssStyles: f } = t, p = S.svg(s), m = v(t, {});
2177
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
2178
+ let h = [
2179
+ {
2180
+ x: -u / 2 + d,
2181
+ y: -l / 2
2182
+ },
2183
+ {
2184
+ x: u / 2 - d,
2185
+ y: -l / 2
2186
+ },
2187
+ ...k(-u / 2 + d, 0, d, 50, 90, 270),
2188
+ {
2189
+ x: u / 2 - d,
2190
+ y: l / 2
2191
+ },
2192
+ ...k(u / 2 - d, 0, d, 50, 270, 450)
2193
+ ], g = D(h), _ = p.path(g, m), b = s.insert(() => _, ":first-child");
2194
+ return b.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && b.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && b.selectChildren("path").attr("style", r), T(t, b), t.intersect = function(e) {
2195
+ return W.polygon(t, h, e);
2196
+ }, s;
2197
+ }
2198
+ t(lt, "stadium");
2199
+ async function ut(e, t) {
2200
+ return Be(e, t, {
2201
+ rx: t.look === "neo" ? 3 : 5,
2202
+ ry: t.look === "neo" ? 3 : 5,
2203
+ classes: "flowchart-node"
2204
+ });
2205
+ }
2206
+ t(ut, "state");
2207
+ function dt(e, t, { config: { themeVariables: n } }) {
2208
+ let { labelStyles: r, nodeStyles: i } = y(t);
2209
+ t.labelStyle = r;
2210
+ let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c, nodeShadow: l } = n;
2211
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2212
+ let u = e.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), d = S.svg(u), f = v(t, {});
2213
+ t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
2214
+ let p = d.circle(0, 0, t.width, {
2215
+ ...f,
2216
+ stroke: o,
2217
+ strokeWidth: 2
2218
+ }), m = s ?? c, h = (t.width ?? 0) * 5 / 14, g = d.circle(0, 0, h, {
2219
+ ...f,
2220
+ fill: m,
2221
+ stroke: m,
2222
+ strokeWidth: 2,
2223
+ fillStyle: "solid"
2224
+ }), _ = u.insert(() => p, ":first-child");
2225
+ if (_.insert(() => g), t.look !== "handDrawn" && _.attr("class", "outer-path"), a && _.selectAll("path").attr("style", a), i && _.selectAll("path").attr("style", i), t.width < 25 && l && t.look !== "handDrawn") {
2226
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2227
+ _.attr("style", `filter:url(#${n})`);
2228
+ }
2229
+ return T(t, _), t.intersect = function(e) {
2230
+ return W.circle(t, (t.width ?? 0) / 2, e);
2231
+ }, u;
2232
+ }
2233
+ t(dt, "stateEnd");
2234
+ function ft(e, t, { config: { themeVariables: n } }) {
2235
+ let { lineColor: r, nodeShadow: i } = n;
2236
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2237
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), o;
2238
+ if (t.look === "handDrawn") {
2239
+ let e = S.svg(a).circle(0, 0, t.width, b(r));
2240
+ o = a.insert(() => e), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
2241
+ } else o = a.insert("circle", ":first-child"), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
2242
+ if (t.width < 25 && i && t.look !== "handDrawn") {
2243
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2244
+ o.attr("style", `filter:url(#${n})`);
2245
+ }
2246
+ return T(t, o), t.intersect = function(e) {
2247
+ return W.circle(t, (t.width ?? 7) / 2, e);
2248
+ }, a;
2249
+ }
2250
+ t(ft, "stateStart");
2251
+ var pt = 8;
2252
+ async function mt(e, t) {
2253
+ let { labelStyles: n, nodeStyles: r } = y(t);
2254
+ t.labelStyle = n;
2255
+ let i = t?.padding ?? 8, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ?? c.width) + 2 * pt + a, u = (t?.height ?? c.height) + o, d = l - 2 * pt, p = u, m = -l / 2, h = -u / 2, g = [
2256
+ {
2257
+ x: 0,
2258
+ y: 0
2259
+ },
2260
+ {
2261
+ x: d,
2262
+ y: 0
2263
+ },
2264
+ {
2265
+ x: d,
2266
+ y: -p
2267
+ },
2268
+ {
2269
+ x: 0,
2270
+ y: -p
2271
+ },
2272
+ {
2273
+ x: 0,
2274
+ y: 0
2275
+ },
2276
+ {
2277
+ x: -8,
2278
+ y: 0
2279
+ },
2280
+ {
2281
+ x: d + 8,
2282
+ y: 0
2283
+ },
2284
+ {
2285
+ x: d + 8,
2286
+ y: -p
2287
+ },
2288
+ {
2289
+ x: -8,
2290
+ y: -p
2291
+ },
2292
+ {
2293
+ x: -8,
2294
+ y: 0
2295
+ }
2296
+ ];
2297
+ if (t.look === "handDrawn") {
2298
+ let e = S.svg(s), n = v(t, {}), r = e.rectangle(m, h, d + 16, p, n), i = e.line(m + pt, h, m + pt, h + p, n), a = e.line(m + pt + d, h, m + pt + d, h + p, n);
2299
+ s.insert(() => i, ":first-child"), s.insert(() => a, ":first-child");
2300
+ let o = s.insert(() => r, ":first-child"), { cssStyles: c } = t;
2301
+ o.attr("class", "basic label-container").attr("style", f(c)), T(t, o);
2302
+ } else {
2303
+ let e = q(s, d, p, g);
2304
+ r && e.attr("style", r), T(t, e);
2305
+ }
2306
+ return t.intersect = function(e) {
2307
+ return W.polygon(t, g, e);
2308
+ }, s;
2309
+ }
2310
+ t(mt, "subroutine");
2311
+ var ht = .2;
2312
+ async function gt(e, t) {
2313
+ let { labelStyles: n, nodeStyles: r } = y(t);
2314
+ t.labelStyle = n;
2315
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2316
+ (t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - o * 2, 10), t.width = Math.max((t?.width ?? 0) - a * 2 - ht * (t.height + o * 2), 10));
2317
+ let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ? t?.height : c.height) + o * 2, u = ht * l, d = ht * l, f = (t?.width ? t?.width : c.width) + a * 2 + u - u, p = l, m = -f / 2, h = -p / 2, { cssStyles: g } = t, _ = S.svg(s), b = v(t, {}), x = [
2318
+ {
2319
+ x: m - u / 2,
2320
+ y: h
2321
+ },
2322
+ {
2323
+ x: m + f + u / 2,
2324
+ y: h
2325
+ },
2326
+ {
2327
+ x: m + f + u / 2,
2328
+ y: h + p
2329
+ },
2330
+ {
2331
+ x: m - u / 2,
2332
+ y: h + p
2333
+ }
2334
+ ], w = [
2335
+ {
2336
+ x: m + f - u / 2,
2337
+ y: h + p
2338
+ },
2339
+ {
2340
+ x: m + f + u / 2,
2341
+ y: h + p
2342
+ },
2343
+ {
2344
+ x: m + f + u / 2,
2345
+ y: h + p - d
2346
+ }
2347
+ ];
2348
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2349
+ let O = D(x), k = _.path(O, b), A = D(w), j = _.path(A, {
2350
+ ...b,
2351
+ fillStyle: "solid"
2352
+ }), M = s.insert(() => j, ":first-child");
2353
+ return M.insert(() => k, ":first-child"), M.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && M.selectAll("path").attr("style", g), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), T(t, M), t.intersect = function(e) {
2354
+ return W.polygon(t, x, e);
2355
+ }, s;
2356
+ }
2357
+ t(gt, "taggedRect");
2358
+ async function _t(e, t) {
2359
+ let { labelStyles: n, nodeStyles: r } = y(t);
2360
+ t.labelStyle = n;
2361
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 8, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = S.svg(i), h = v(t, {});
2362
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2363
+ let g = [
2364
+ {
2365
+ x: -s / 2 - s / 2 * .1,
2366
+ y: f / 2
2367
+ },
2368
+ ...O(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
2369
+ {
2370
+ x: s / 2 + s / 2 * .1,
2371
+ y: -f / 2
2372
+ },
2373
+ {
2374
+ x: -s / 2 - s / 2 * .1,
2375
+ y: -f / 2
2376
+ }
2377
+ ], _ = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
2378
+ {
2379
+ x: _ + s - u,
2380
+ y: (b + c) * 1.3
2381
+ },
2382
+ {
2383
+ x: _ + s,
2384
+ y: b + c - d
2385
+ },
2386
+ {
2387
+ x: _ + s,
2388
+ y: (b + c) * .9
2389
+ },
2390
+ ...O(_ + s, (b + c) * 1.25, _ + s - u, (b + c) * 1.3, -c * .02, .5)
2391
+ ], w = D(g), k = m.path(w, h), A = D(x), j = m.path(A, {
2392
+ ...h,
2393
+ fillStyle: "solid"
2394
+ }), M = i.insert(() => j, ":first-child");
2395
+ return M.insert(() => k, ":first-child"), M.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && M.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), M.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), T(t, M), t.intersect = function(e) {
2396
+ return W.polygon(t, g, e);
2397
+ }, i;
2398
+ }
2399
+ t(_t, "taggedWaveEdgedRectangle");
2400
+ async function vt(e, t) {
2401
+ let { labelStyles: n, nodeStyles: r } = y(t);
2402
+ t.labelStyle = n;
2403
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width || 0), s = Math.max(a.height + (t.padding ?? 0), t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
2404
+ return u.attr("class", "text").attr("style", r).attr("rx", 0).attr("ry", 0).attr("x", c).attr("y", l).attr("width", o).attr("height", s), T(t, u), t.intersect = function(e) {
2405
+ return W.rect(t, e);
2406
+ }, i;
2407
+ }
2408
+ t(vt, "text");
2409
+ var yt = /* @__PURE__ */ t((e, t, n, r, i, a) => `M${e},${t}
2410
+ a${i},${a} 0,0,1 0,${-r}
2411
+ l${n},0
2412
+ a${i},${a} 0,0,1 0,${r}
2413
+ M${n},${-r}
2414
+ a${i},${a} 0,0,0 0,${r}
2415
+ l${-n},0`, "createCylinderPathD"), bt = /* @__PURE__ */ t((e, t, n, r, i, a) => [
2416
+ `M${e},${t}`,
2417
+ `M${e + n},${t}`,
2418
+ `a${i},${a} 0,0,0 0,${-r}`,
2419
+ `l${-n},0`,
2420
+ `a${i},${a} 0,0,0 0,${r}`,
2421
+ `l${n},0`
2422
+ ].join(" "), "createOuterCylinderPathD"), xt = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD"), St = 5, Ct = 10;
2423
+ async function wt(e, t) {
2424
+ let { labelStyles: n, nodeStyles: r } = y(t);
2425
+ t.labelStyle = n;
2426
+ let i = t.padding ?? 0, a = t.look === "neo" ? 12 : i / 2;
2427
+ if (t.width || t.height) {
2428
+ let e = t.height ?? 0;
2429
+ t.height = (t.height ?? 0) - a, t.height < St && (t.height = St);
2430
+ let n = e / 2 / (2.5 + e / 50);
2431
+ t.width = (t.width ?? 0) - a - n * 3, t.width < Ct && (t.width = Ct);
2432
+ }
2433
+ let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = (t.height ? t.height : s.height) + a, u = l / 2, d = u / (2.5 + l / 50), p = (t.width ? t.width : s.width) + d + a, { cssStyles: m } = t, h;
2434
+ if (t.look === "handDrawn") {
2435
+ let e = S.svg(o), n = bt(0, 0, p, l, d, u), r = xt(0, 0, p, l, d, u), i = e.path(n, v(t, {})), a = e.path(r, v(t, { fill: "none" }));
2436
+ h = o.insert(() => a, ":first-child"), h = o.insert(() => i, ":first-child"), h.attr("class", "basic label-container"), m && h.attr("style", m);
2437
+ } else {
2438
+ let e = yt(0, 0, p, l, d, u);
2439
+ h = o.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", f(m)).attr("style", r), h.attr("class", "basic label-container outer-path"), m && h.selectAll("path").attr("style", m), r && h.selectAll("path").attr("style", r);
2440
+ }
2441
+ return h.attr("label-offset-x", d), h.attr("transform", `translate(${-p / 2}, ${l / 2} )`), c.attr("transform", `translate(${-(s.width / 2) - d - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`), T(t, h), t.intersect = function(e) {
2442
+ let n = W.rect(t, e), r = n.y - (t.y ?? 0);
2443
+ if (u != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - d)) {
2444
+ let i = d * d * (1 - r * r / (u * u));
2445
+ i != 0 && (i = Math.sqrt(Math.abs(i))), i = d - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
2446
+ }
2447
+ return n;
2448
+ }, o;
2449
+ }
2450
+ t(wt, "tiltedCylinder");
2451
+ async function Tt(e, t) {
2452
+ let { labelStyles: n, nodeStyles: r } = y(t);
2453
+ t.labelStyle = n;
2454
+ let i = t.padding ?? 0, a = (t.look, i), o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
2455
+ {
2456
+ x: -3 * l / 6,
2457
+ y: 0
2458
+ },
2459
+ {
2460
+ x: u + 3 * l / 6,
2461
+ y: 0
2462
+ },
2463
+ {
2464
+ x: u,
2465
+ y: -l
2466
+ },
2467
+ {
2468
+ x: 0,
2469
+ y: -l
2470
+ }
2471
+ ], f, { cssStyles: p } = t;
2472
+ if (t.look === "handDrawn") {
2473
+ let e = S.svg(s), n = v(t, {}), r = D(d), i = e.path(r, n);
2474
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2475
+ } else f = q(s, u, l, d);
2476
+ return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
2477
+ return W.polygon(t, d, e);
2478
+ }, s;
2479
+ }
2480
+ t(Tt, "trapezoid");
2481
+ async function Et(e, t) {
2482
+ let { labelStyles: n, nodeStyles: r } = y(t);
2483
+ t.labelStyle = n;
2484
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2485
+ (t.width || t.height) && (t.height = (t.height ?? 0) - o * 2, t.height < 5 && (t.height = 5), t.width = (t.width ?? 0) - a * 2, t.width < 15 && (t.width = 15));
2486
+ let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o * 2, { cssStyles: d } = t, f = S.svg(s), p = v(t, {});
2487
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
2488
+ let m = [
2489
+ {
2490
+ x: -l / 2 * .8,
2491
+ y: -u / 2
2492
+ },
2493
+ {
2494
+ x: l / 2 * .8,
2495
+ y: -u / 2
2496
+ },
2497
+ {
2498
+ x: l / 2,
2499
+ y: -u / 2 * .6
2500
+ },
2501
+ {
2502
+ x: l / 2,
2503
+ y: u / 2
2504
+ },
2505
+ {
2506
+ x: -l / 2,
2507
+ y: u / 2
2508
+ },
2509
+ {
2510
+ x: -l / 2,
2511
+ y: -u / 2 * .6
2512
+ }
2513
+ ], h = D(m), g = f.path(h, p), _ = s.insert(() => g, ":first-child");
2514
+ return _.attr("class", "basic label-container outer-path"), d && t.look !== "handDrawn" && _.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && _.selectChildren("path").attr("style", r), T(t, _), t.intersect = function(e) {
2515
+ return W.polygon(t, m, e);
2516
+ }, s;
2517
+ }
2518
+ t(Et, "trapezoidalPentagon");
2519
+ var Dt = 10, Ot = 10;
2520
+ async function kt(t, n) {
2521
+ let { labelStyles: r, nodeStyles: i } = y(n);
2522
+ n.labelStyle = r;
2523
+ let s = n.padding ?? 0, c = n.look === "neo" ? s * 2 : s;
2524
+ (n.width || n.height) && (n.width = ((n?.width ?? 0) - c) / 2, n.width < Ot && (n.width = Ot), n.height = n?.height ?? 0, n.height < Dt && (n.height = Dt));
2525
+ let { shapeSvg: l, bbox: u, label: d } = await C(t, n, E(n)), f = o(a().flowchart?.htmlLabels), p = (n?.width ? n?.width : u.width) + c, m = n?.height ? n?.height : p + u.height, h = m, g = [
2526
+ {
2527
+ x: 0,
2528
+ y: 0
2529
+ },
2530
+ {
2531
+ x: h,
2532
+ y: 0
2533
+ },
2534
+ {
2535
+ x: h / 2,
2536
+ y: -m
2537
+ }
2538
+ ], { cssStyles: _ } = n, b = S.svg(l), x = v(n, {});
2539
+ n.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2540
+ let w = D(g), O = b.path(w, x), k = l.insert(() => O, ":first-child").attr("transform", `translate(${-m / 2}, ${m / 2})`).attr("class", "outer-path");
2541
+ return _ && n.look !== "handDrawn" && k.selectChildren("path").attr("style", _), i && n.look !== "handDrawn" && k.selectChildren("path").attr("style", i), n.width = p, n.height = m, T(n, k), d.attr("transform", `translate(${-u.width / 2 - (u.x - (u.left ?? 0))}, ${m / 2 - (u.height + (n.padding ?? 0) / (f ? 2 : 1) - (u.y - (u.top ?? 0)))})`), n.intersect = function(t) {
2542
+ return e.info("Triangle intersect", n, g, t), W.polygon(n, g, t);
2543
+ }, l;
2544
+ }
2545
+ t(kt, "triangle");
2546
+ async function At(e, t) {
2547
+ let { labelStyles: n, nodeStyles: r } = y(t);
2548
+ t.labelStyle = n;
2549
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = !0;
2550
+ (t.width || t.height) && (s = !1, t.width = (t?.width ?? 0) - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
2551
+ let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(t)), d = (t?.width ? t?.width : l.width) + (a ?? 0) * 2, f = (t?.height ? t?.height : l.height) + (o ?? 0) * 2, p = t.look === "neo" ? f / 4 : f / 8, m = f + (s ? p : -p), { cssStyles: h } = t, g = 14 - d, _ = g > 0 ? g / 2 : 0, b = S.svg(c), x = v(t, {});
2552
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2553
+ let w = [
2554
+ {
2555
+ x: -d / 2 - _,
2556
+ y: m / 2
2557
+ },
2558
+ ...O(-d / 2 - _, m / 2, d / 2 + _, m / 2, p, .8),
2559
+ {
2560
+ x: d / 2 + _,
2561
+ y: -m / 2
2562
+ },
2563
+ {
2564
+ x: -d / 2 - _,
2565
+ y: -m / 2
2566
+ }
2567
+ ], k = D(w), A = b.path(k, x), j = c.insert(() => A, ":first-child");
2568
+ return j.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && j.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.attr("transform", `translate(0,${-p / 2})`), u.attr("transform", `translate(${-d / 2 + (t.padding ?? 0) - (l.x - (l.left ?? 0))},${-f / 2 + (t.padding ?? 0) - p - (l.y - (l.top ?? 0))})`), T(t, j), t.intersect = function(e) {
2569
+ return W.polygon(t, w, e);
2570
+ }, c;
2571
+ }
2572
+ t(At, "waveEdgedRectangle");
2573
+ async function jt(e, t) {
2574
+ let { labelStyles: n, nodeStyles: r } = y(t);
2575
+ t.labelStyle = n;
2576
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 20 : i;
2577
+ if (t.width || t.height) {
2578
+ t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
2579
+ let e = Math.min(t.height * .2, t.height / 4);
2580
+ t.height = Math.ceil(t.height - o - 20 / 9 * e), t.width -= a * 2;
2581
+ }
2582
+ let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o, d = u / 8, f = u + d * 2, { cssStyles: p } = t, m = S.svg(s), h = v(t, {});
2583
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2584
+ let g = [
2585
+ {
2586
+ x: -l / 2,
2587
+ y: f / 2
2588
+ },
2589
+ ...O(-l / 2, f / 2, l / 2, f / 2, d, 1),
2590
+ {
2591
+ x: l / 2,
2592
+ y: -f / 2
2593
+ },
2594
+ ...O(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
2595
+ ], _ = D(g), b = m.path(_, h), x = s.insert(() => b, ":first-child");
2596
+ return x.attr("class", "basic label-container"), p && t.look !== "handDrawn" && x.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), T(t, x), t.intersect = function(e) {
2597
+ return W.polygon(t, g, e);
2598
+ }, s;
2599
+ }
2600
+ t(jt, "waveRectangle");
2601
+ var Q = 10;
2602
+ async function Mt(e, t) {
2603
+ let { labelStyles: n, nodeStyles: r } = y(t);
2604
+ t.labelStyle = n;
2605
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0;
2606
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - i * 2 - Q, 10), t.height = Math.max((t?.height ?? 0) - a * 2 - Q, 10));
2607
+ let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = (t?.width ? t?.width : s.width) + i * 2 + Q, u = (t?.height ? t?.height : s.height) + a * 2 + Q, d = l - Q, f = u - Q, p = -d / 2, m = -f / 2, { cssStyles: h } = t, g = S.svg(o), _ = v(t, {}), b = [
2608
+ {
2609
+ x: p - Q,
2610
+ y: m - Q
2611
+ },
2612
+ {
2613
+ x: p - Q,
2614
+ y: m + f
2615
+ },
2616
+ {
2617
+ x: p + d,
2618
+ y: m + f
2619
+ },
2620
+ {
2621
+ x: p + d,
2622
+ y: m - Q
2623
+ }
2624
+ ], x = `M${p - Q},${m - Q} L${p + d},${m - Q} L${p + d},${m + f} L${p - Q},${m + f} L${p - Q},${m - Q}
2625
+ M${p - Q},${m} L${p + d},${m}
2626
+ M${p},${m - Q} L${p},${m + f}`;
2627
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
2628
+ let w = g.path(x, _), D = o.insert(() => w, ":first-child");
2629
+ return D.attr("transform", `translate(${Q / 2}, ${Q / 2})`), D.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && D.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), c.attr("transform", `translate(${-(s.width / 2) + Q / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + Q / 2 - (s.y - (s.top ?? 0))})`), T(t, D), t.intersect = function(e) {
2630
+ return W.polygon(t, b, e);
2631
+ }, o;
2632
+ }
2633
+ t(Mt, "windowPane");
2634
+ var Nt = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Pt = /* @__PURE__ */ new Set([
2635
+ "redux",
2636
+ "redux-dark",
2637
+ "redux-color",
2638
+ "redux-dark-color"
2639
+ ]);
2640
+ async function Ft(e, t) {
2641
+ let r = t;
2642
+ r.alias && (t.label = r.alias);
2643
+ let { theme: i, themeVariables: a } = u(), { rowEven: s, rowOdd: c, nodeBorder: l, borderColorArray: d } = a;
2644
+ if (t.look === "handDrawn") {
2645
+ let { themeVariables: n } = u(), { background: r } = n;
2646
+ await Ft(e, {
2647
+ ...t,
2648
+ id: t.id + "-background",
2649
+ domId: (t.domId || t.id) + "-background",
2650
+ look: "default",
2651
+ cssStyles: ["stroke: none", `fill: ${r}`]
2652
+ });
2653
+ }
2654
+ let f = u();
2655
+ t.useHtmlLabels = f.htmlLabels;
2656
+ let m = f.er?.diagramPadding ?? 10, h = f.er?.entityPadding ?? 6, { cssStyles: g } = t, { labelStyles: _, nodeStyles: b } = y(t);
2657
+ if (r.attributes.length === 0 && t.label) {
2658
+ let n = {
2659
+ rx: 0,
2660
+ ry: 0,
2661
+ labelPaddingX: m,
2662
+ labelPaddingY: m * 1.5,
2663
+ classes: ""
2664
+ };
2665
+ p(t.label, f) + n.labelPaddingX * 2 < f.er.minEntityWidth && (t.width = f.er.minEntityWidth);
2666
+ let a = await Be(e, t, n);
2667
+ if (i != null && Nt.has(i)) {
2668
+ let e = r.colorIndex ?? 0;
2669
+ a.attr("data-color-id", `color-${e % d.length}`);
2670
+ }
2671
+ if (!o(f.htmlLabels)) {
2672
+ let e = a.select("text"), t = e.node()?.getBBox();
2673
+ e.attr("transform", `translate(${-t.width / 2}, 0)`);
2674
+ }
2675
+ return a;
2676
+ }
2677
+ f.htmlLabels || (m *= 1.25, h *= 1.25);
2678
+ let x = E(t);
2679
+ x ||= "node default";
2680
+ let C = e.insert("g").attr("class", x).attr("id", t.domId || t.id), w = await It(C, t.label ?? "", f, 0, 0, ["name"], _);
2681
+ w.height += h;
2682
+ let D = 0, O = [], k = [], A = 0, j = 0, M = 0, N = 0, P = !0, F = !0;
2683
+ for (let e of r.attributes) {
2684
+ let t = await It(C, e.type, f, 0, D, ["attribute-type"], _);
2685
+ A = Math.max(A, t.width + m);
2686
+ let n = await It(C, e.name, f, 0, D, ["attribute-name"], _);
2687
+ j = Math.max(j, n.width + m);
2688
+ let r = await It(C, e.keys.join(), f, 0, D, ["attribute-keys"], _);
2689
+ M = Math.max(M, r.width + m);
2690
+ let i = await It(C, e.comment, f, 0, D, ["attribute-comment"], _);
2691
+ N = Math.max(N, i.width + m);
2692
+ let a = Math.max(t.height, n.height, r.height, i.height) + h;
2693
+ k.push({
2694
+ yOffset: D,
2695
+ rowHeight: a
2696
+ }), D += a;
2697
+ }
2698
+ let I = 4;
2699
+ M <= m && (P = !1, M = 0, I--), N <= m && (F = !1, N = 0, I--);
2700
+ let ee = C.node().getBBox();
2701
+ if (w.width + m * 2 - (A + j + M + N) > 0) {
2702
+ let e = w.width + m * 2 - (A + j + M + N);
2703
+ A += e / I, j += e / I, M > 0 && (M += e / I), N > 0 && (N += e / I);
2704
+ }
2705
+ let te = A + j + M + N, L = S.svg(C), R = v(t, {});
2706
+ t.look !== "handDrawn" && (R.roughness = 0, R.fillStyle = "solid");
2707
+ let ne = 0;
2708
+ k.length > 0 && (ne = k.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
2709
+ let z = Math.max(ee.width + m * 2, t?.width || 0, te), B = Math.max((ne ?? 0) + w.height, t?.height || 0), V = -z / 2, H = -B / 2;
2710
+ if (C.selectAll("g:not(:first-child)").each((e, t, r) => {
2711
+ let i = n(r[t]), a = i.attr("transform"), o = 0, s = 0;
2712
+ if (a) {
2713
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
2714
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? o += A : i.attr("class").includes("attribute-keys") ? o += A + j : i.attr("class").includes("attribute-comment") && (o += A + j + M));
2715
+ }
2716
+ i.attr("transform", `translate(${V + m / 2 + o}, ${s + H + w.height + h / 2})`);
2717
+ }), C.select(".name").attr("transform", "translate(" + -w.width / 2 + ", " + (H + h / 2) + ")"), i != null && Nt.has(i)) {
2718
+ let e = r.colorIndex ?? 0;
2719
+ C.attr("data-color-id", `color-${e % d.length}`);
2720
+ }
2721
+ let re = L.rectangle(V, H, z, B, R), ie = C.insert(() => re, ":first-child").attr("class", "outer-path").attr("style", g.join(""));
2722
+ O.push(0);
2723
+ for (let [e, t] of k.entries()) {
2724
+ let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = L.rectangle(V, w.height + H + t?.yOffset, z, t?.rowHeight, {
2725
+ ...R,
2726
+ fill: n ? s : c,
2727
+ stroke: l
2728
+ });
2729
+ C.insert(() => r, "g.label").attr("style", g.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
2730
+ }
2731
+ let U = 1e-4, G = Lt(V, w.height + H, z + V, w.height + H, U), K = L.polygon(G.map((e) => [e.x, e.y]), R);
2732
+ if (C.insert(() => K).attr("class", "divider"), G = Lt(A + V, w.height + H, A + V, B + H, U), K = L.polygon(G.map((e) => [e.x, e.y]), R), C.insert(() => K).attr("class", "divider"), P) {
2733
+ let e = A + j + V;
2734
+ G = Lt(e, w.height + H, e, B + H, U), K = L.polygon(G.map((e) => [e.x, e.y]), R), C.insert(() => K).attr("class", "divider");
2735
+ }
2736
+ if (F) {
2737
+ let e = A + j + M + V;
2738
+ G = Lt(e, w.height + H, e, B + H, U), K = L.polygon(G.map((e) => [e.x, e.y]), R), C.insert(() => K).attr("class", "divider");
2739
+ }
2740
+ for (let e of O) {
2741
+ let t = w.height + H + e;
2742
+ G = Lt(V, t, z + V, t, U), K = L.polygon(G.map((e) => [e.x, e.y]), R), C.insert(() => K).attr("class", "divider");
2743
+ }
2744
+ if (T(t, ie), b && t.look !== "handDrawn") if (i != null && Pt.has(i)) C.selectAll("path").attr("style", b);
2745
+ else {
2746
+ let e = b.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
2747
+ C.selectAll("path").attr("style", e ?? ""), C.selectAll(".row-rect-even path").attr("style", b);
2748
+ }
2749
+ return t.intersect = function(e) {
2750
+ return W.rect(t, e);
2751
+ }, C;
2752
+ }
2753
+ t(Ft, "erBox");
2754
+ async function It(e, t, r, i = 0, a = 0, c = [], l = "") {
2755
+ let u = e.insert("g").attr("class", `label ${c.join(" ")}`).attr("transform", `translate(${i}, ${a})`).attr("style", l);
2756
+ t !== s(t) && (t = s(t), t = t.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
2757
+ let d = u.node().appendChild(await m(u, t, {
2758
+ width: p(t, r) + 100,
2759
+ style: l,
2760
+ useHtmlLabels: r.htmlLabels
2761
+ }, r));
2762
+ if (t.includes("&lt;") || t.includes("&gt;")) {
2763
+ let e = d.children[0];
2764
+ for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
2765
+ }
2766
+ let f = d.getBBox();
2767
+ if (o(r.htmlLabels)) {
2768
+ let e = d.children[0];
2769
+ e.style.textAlign = "start";
2770
+ let t = n(d);
2771
+ f = e.getBoundingClientRect(), t.attr("width", f.width), t.attr("height", f.height);
2772
+ }
2773
+ return f;
2774
+ }
2775
+ t(It, "addText");
2776
+ function Lt(e, t, n, r, i) {
2777
+ return e === n ? [
2778
+ {
2779
+ x: e - i / 2,
2780
+ y: t
2781
+ },
2782
+ {
2783
+ x: e + i / 2,
2784
+ y: t
2785
+ },
2786
+ {
2787
+ x: n + i / 2,
2788
+ y: r
2789
+ },
2790
+ {
2791
+ x: n - i / 2,
2792
+ y: r
2793
+ }
2794
+ ] : [
2795
+ {
2796
+ x: e,
2797
+ y: t - i / 2
2798
+ },
2799
+ {
2800
+ x: e,
2801
+ y: t + i / 2
2802
+ },
2803
+ {
2804
+ x: n,
2805
+ y: r + i / 2
2806
+ },
2807
+ {
2808
+ x: n,
2809
+ y: r - i / 2
2810
+ }
2811
+ ];
2812
+ }
2813
+ t(Lt, "lineToPolygon");
2814
+ async function Rt(e, t, n, r, i = n.class.padding ?? 12) {
2815
+ let a = r ? 0 : 3, o = e.insert("g").attr("class", E(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
2816
+ if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
2817
+ let e = t.annotations[0];
2818
+ await zt(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
2819
+ }
2820
+ c = o.insert("g").attr("class", "label-group text"), await zt(c, t, 0, ["font-weight: bolder"]);
2821
+ let m = c.node().getBBox();
2822
+ f = m.height, l = o.insert("g").attr("class", "members-group text");
2823
+ let h = 0;
2824
+ for (let e of t.members) {
2825
+ let t = await zt(l, e, h, [e.parseClassifier()]);
2826
+ h += t + a;
2827
+ }
2828
+ p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
2829
+ let g = 0;
2830
+ for (let e of t.methods) {
2831
+ let t = await zt(u, e, g, [e.parseClassifier()]);
2832
+ g += t + a;
2833
+ }
2834
+ let _ = o.node().getBBox();
2835
+ if (s !== null) {
2836
+ let e = s.node().getBBox();
2837
+ s.attr("transform", `translate(${-e.width / 2})`);
2838
+ }
2839
+ return c.attr("transform", `translate(${-m.width / 2}, ${d})`), _ = o.node().getBBox(), l.attr("transform", `translate(0, ${d + f + i * 2})`), _ = o.node().getBBox(), u.attr("transform", `translate(0, ${d + f + (p ? p + i * 4 : i * 2)})`), _ = o.node().getBBox(), {
2840
+ shapeSvg: o,
2841
+ bbox: _
2842
+ };
2843
+ }
2844
+ t(Rt, "textHelper");
2845
+ async function zt(e, r, a, s = []) {
2846
+ let l = e.insert("g").attr("class", "label").attr("style", s.join("; ")), f = u(), h = "useHtmlLabels" in r ? r.useHtmlLabels : o(f.htmlLabels) ?? !0, g = "";
2847
+ g = "text" in r ? r.text : r.label, !h && g.startsWith("\\") && (g = g.substring(1)), c(g) && (h = !0);
2848
+ let _ = await m(l, i(d(g)), {
2849
+ width: p(g, f) + 50,
2850
+ classes: "markdown-node-label",
2851
+ useHtmlLabels: h
2852
+ }, f), v, y = 1;
2853
+ if (h) {
2854
+ let e = _.children[0], r = n(_);
2855
+ y = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (y += e.innerHTML.split("<mrow>").length - 1);
2856
+ let i = e.getElementsByTagName("img");
2857
+ if (i) {
2858
+ let e = g.replace(/<img[^>]*>/g, "").trim() === "";
2859
+ await Promise.all([...i].map((n) => new Promise((r) => {
2860
+ function i() {
2861
+ if (n.style.display = "flex", n.style.flexDirection = "column", e) {
2862
+ let e = f.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, t = parseInt(e, 10) * 5 + "px";
2863
+ n.style.minWidth = t, n.style.maxWidth = t;
2864
+ } else n.style.width = "100%";
2865
+ r(n);
2866
+ }
2867
+ t(i, "setupImage"), setTimeout(() => {
2868
+ n.complete && i();
2869
+ }), n.addEventListener("error", i), n.addEventListener("load", i);
2870
+ })));
2871
+ }
2872
+ v = e.getBoundingClientRect(), r.attr("width", v.width), r.attr("height", v.height);
2873
+ } else {
2874
+ s.includes("font-weight: bolder") && n(_).selectAll("tspan").attr("font-weight", ""), y = _.children.length;
2875
+ let e = _.children[0];
2876
+ (_.textContent === "" || _.textContent.includes("&gt")) && (e.textContent = g[0] + g.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), g[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), v = _.getBBox();
2877
+ }
2878
+ return l.attr("transform", "translate(0," + (-v.height / (2 * y) + a) + ")"), v.height;
2879
+ }
2880
+ t(zt, "addText");
2881
+ async function Bt(e, t) {
2882
+ let r = a(), { themeVariables: i } = r, { useGradient: s } = i, c = r.class.padding ?? 12, l = c, u = t.useHtmlLabels ?? o(r.htmlLabels) ?? !0, d = t;
2883
+ d.annotations = d.annotations ?? [], d.members = d.members ?? [], d.methods = d.methods ?? [];
2884
+ let { shapeSvg: f, bbox: p } = await Rt(e, t, r, u, l), { labelStyles: m, nodeStyles: h } = y(t);
2885
+ t.labelStyle = m, t.cssStyles = d.styles || "";
2886
+ let g = d.styles?.join(";") || h || "";
2887
+ t.cssStyles ||= g.replaceAll("!important", "").split(";");
2888
+ let _ = d.members.length === 0 && d.methods.length === 0 && !r.class?.hideEmptyMembersBox, b = S.svg(f), x = v(t, {});
2889
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2890
+ let C = Math.max(t.width ?? 0, p.width), w = Math.max(t.height ?? 0, p.height), E = (t.height ?? 0) > p.height;
2891
+ d.members.length === 0 && d.methods.length === 0 ? w += l : d.members.length > 0 && d.methods.length === 0 && (w += l * 2);
2892
+ let D = -C / 2, O = -w / 2, k = _ ? c * 2 : d.members.length === 0 && d.methods.length === 0 ? -c : 0;
2893
+ E && (k = c * 2);
2894
+ let A = b.rectangle(D - c, O - c - (_ ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0), C + 2 * c, w + 2 * c + k, x), j = f.insert(() => A, ":first-child");
2895
+ j.attr("class", "basic label-container outer-path");
2896
+ let M = j.node().getBBox(), N = f.select(".annotation-group").node().getBBox().height - (_ ? c / 2 : 0) || 0, P = f.select(".label-group").node().getBBox().height - (_ ? c / 2 : 0) || 0, F = f.select(".members-group").node().getBBox().height - (_ ? c / 2 : 0) || 0, I = (N + P + O + c - (O - c - (_ ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0))) / 2;
2897
+ if (f.selectAll(".text").each((e, t, i) => {
2898
+ let a = n(i[t]), o = a.attr("transform"), s = 0;
2899
+ if (o) {
2900
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);
2901
+ e && (s = parseFloat(e[2]));
2902
+ }
2903
+ let p = s + O + c - (_ ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0);
2904
+ if (a.attr("class").includes("methods-group")) {
2905
+ let e = Math.max(F, l / 2);
2906
+ p = E ? Math.max(I, N + P + e + O + l * 2 + c) + l * 2 : N + P + e + O + l * 4 + c;
2907
+ }
2908
+ d.members.length === 0 && d.methods.length === 0 && r.class?.hideEmptyMembersBox && (p = d.annotations.length > 0 ? s - l : s), u || (p -= 4);
2909
+ let m = D;
2910
+ (a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (m = -a.node()?.getBBox().width / 2 || 0, f.selectAll("text").each(function(e, t, n) {
2911
+ window.getComputedStyle(n[t]).textAnchor === "middle" && (m = 0);
2912
+ })), a.attr("transform", `translate(${m}, ${p})`);
2913
+ }), d.members.length > 0 || d.methods.length > 0 || _) {
2914
+ let e = N + P + O + c, n = b.line(M.x, e, M.x + M.width, e + .001, x);
2915
+ f.insert(() => n).attr("class", `divider${t.look === "neo" && !s ? " neo-line" : ""}`).attr("style", g);
2916
+ }
2917
+ if (_ || d.members.length > 0 || d.methods.length > 0) {
2918
+ let e = N + P + F + O + l * 2 + c, n = b.line(M.x, E ? Math.max(I, e) : e, M.x + M.width, (E ? Math.max(I, e) : e) + .001, x);
2919
+ f.insert(() => n).attr("class", `divider${t.look === "neo" && !s ? " neo-line" : ""}`).attr("style", g);
2920
+ }
2921
+ if (d.look !== "handDrawn" && f.selectAll("path").attr("style", g), j.select(":nth-child(2)").attr("style", g), f.selectAll(".divider").select("path").attr("style", g), t.labelStyle ? f.selectAll("span").attr("style", t.labelStyle) : f.selectAll("span").attr("style", g), !u) {
2922
+ let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(g);
2923
+ if (t) {
2924
+ let e = t[0].replace("color", "fill");
2925
+ f.selectAll("tspan").attr("style", e);
2926
+ } else if (m) {
2927
+ let t = e.exec(m);
2928
+ if (t) {
2929
+ let e = t[0].replace("color", "fill");
2930
+ f.selectAll("tspan").attr("style", e);
2931
+ }
2932
+ }
2933
+ }
2934
+ return T(t, j), t.intersect = function(e) {
2935
+ return W.rect(t, e);
2936
+ }, f;
2937
+ }
2938
+ t(Bt, "classBox");
2939
+ async function Vt(e, t) {
2940
+ let { labelStyles: r, nodeStyles: i } = y(t);
2941
+ t.labelStyle = r;
2942
+ let o = t, s = t, c = "verifyMethod" in t, l = E(t), { themeVariables: u } = a(), { borderColorArray: d, requirementEdgeLabelBackground: f } = u, p = e.insert("g").attr("class", l).attr("id", t.domId ?? t.id), m;
2943
+ m = c ? await $(p, `&lt;&lt;${o.type}&gt;&gt;`, 0, t.labelStyle) : await $(p, "&lt;&lt;Element&gt;&gt;", 0, t.labelStyle);
2944
+ let h = m, g = await $(p, o.name, h, t.labelStyle + "; font-weight: bold;");
2945
+ if (h += g + 20, c) {
2946
+ let e = await $(p, `${o.requirementId ? `ID: ${o.requirementId}` : ""}`, h, t.labelStyle);
2947
+ h += e;
2948
+ let n = await $(p, `${o.text ? `Text: ${o.text}` : ""}`, h, t.labelStyle);
2949
+ h += n;
2950
+ let r = await $(p, `${o.risk ? `Risk: ${o.risk}` : ""}`, h, t.labelStyle);
2951
+ h += r, await $(p, `${o.verifyMethod ? `Verification: ${o.verifyMethod}` : ""}`, h, t.labelStyle);
2952
+ } else {
2953
+ let e = await $(p, `${s.type ? `Type: ${s.type}` : ""}`, h, t.labelStyle);
2954
+ h += e, await $(p, `${s.docRef ? `Doc Ref: ${s.docRef}` : ""}`, h, t.labelStyle);
2955
+ }
2956
+ let _ = (p.node()?.getBBox().width ?? 200) + 20, b = (p.node()?.getBBox().height ?? 200) + 20, x = -_ / 2, C = -b / 2, w = S.svg(p), D = v(t, {});
2957
+ t.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
2958
+ let O = w.rectangle(x, C, _, b, D), k = p.insert(() => O, ":first-child");
2959
+ if (k.attr("class", "basic label-container outer-path").attr("style", i), d?.length) {
2960
+ let e = t.colorIndex ?? 0;
2961
+ p.attr("data-color-id", `color-${e % d.length}`);
2962
+ }
2963
+ if (p.selectAll(".label").each((e, t, r) => {
2964
+ let i = n(r[t]), a = i.attr("transform"), o = 0, s = 0;
2965
+ if (a) {
2966
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
2967
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
2968
+ }
2969
+ let c = s - b / 2, l = x + 20 / 2;
2970
+ (t === 0 || t === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
2971
+ }), h > m + g + 20) {
2972
+ let e = C + m + g + 20, n;
2973
+ if (t.look === "neo") {
2974
+ let t = .001, r = [
2975
+ [x, e],
2976
+ [x + _, e],
2977
+ [x + _, e + t],
2978
+ [x, e + t]
2979
+ ];
2980
+ n = w.polygon(r, D);
2981
+ } else n = w.line(x, e, x + _, e, D);
2982
+ p.insert(() => n).attr("class", "divider");
2983
+ }
2984
+ return T(t, k), t.intersect = function(e) {
2985
+ return W.rect(t, e);
2986
+ }, i && t.look !== "handDrawn" && (f || d?.length) && p.selectAll("path").attr("style", i), p;
2987
+ }
2988
+ t(Vt, "requirementBox");
2989
+ async function $(e, t, r, o = "") {
2990
+ if (t === "") return 0;
2991
+ let s = e.insert("g").attr("class", "label").attr("style", o), c = a(), l = c.htmlLabels ?? !0, u = await m(s, i(d(t)), {
2992
+ width: p(t, c) + 50,
2993
+ classes: "markdown-node-label",
2994
+ useHtmlLabels: l,
2995
+ style: o
2996
+ }, c), f;
2997
+ if (l) {
2998
+ let e = u.children[0], t = n(u);
2999
+ f = e.getBoundingClientRect(), t.attr("width", f.width), t.attr("height", f.height);
3000
+ } else {
3001
+ let e = u.children[0];
3002
+ for (let t of e.children) o && t.setAttribute("style", o);
3003
+ f = u.getBBox(), f.height += 6;
3004
+ }
3005
+ return s.attr("transform", `translate(${-f.width / 2},${-f.height / 2 + r})`), f.height;
3006
+ }
3007
+ t($, "addText");
3008
+ var Ht = /* @__PURE__ */ t((e) => {
3009
+ switch (e) {
3010
+ case "Very High": return "red";
3011
+ case "High": return "orange";
3012
+ case "Medium": return null;
3013
+ case "Low": return "blue";
3014
+ case "Very Low": return "lightblue";
3015
+ }
3016
+ }, "colorFromPriority");
3017
+ async function Ut(e, t, { config: n }) {
3018
+ let { labelStyles: r, nodeStyles: i } = y(t);
3019
+ t.labelStyle = r || "";
3020
+ let a = t.width;
3021
+ t.width = (t.width ?? 200) - 10;
3022
+ let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = t.padding || 10, u = "", d;
3023
+ "ticket" in t && t.ticket && n?.kanban?.ticketBaseUrl && (u = n?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), d = o.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", u).attr("target", "_blank"));
3024
+ let f = {
3025
+ useHtmlLabels: t.useHtmlLabels,
3026
+ labelStyle: t.labelStyle || "",
3027
+ width: t.width,
3028
+ img: t.img,
3029
+ padding: t.padding || 8,
3030
+ centerLabel: !1
3031
+ }, p, m;
3032
+ d ? {label: p, bbox: m} = await w(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await w(o, "ticket" in t && t.ticket || "", f);
3033
+ let { label: h, bbox: g } = await w(o, "assigned" in t && t.assigned || "", f);
3034
+ t.width = a;
3035
+ let _ = t?.width || 0, b = Math.max(m.height, g.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, D = -_ / 2, O = -x / 2;
3036
+ c.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + _ / 2 - g.width - 20) + ", " + (-b + s.height / 2) + ")");
3037
+ let k, { rx: A, ry: j } = t, { cssStyles: M } = t;
3038
+ if (t.look === "handDrawn") {
3039
+ let e = S.svg(o), n = v(t, {}), r = A || j ? e.path(N(D, O, _, x, A || 0), n) : e.rectangle(D, O, _, x, n);
3040
+ k = o.insert(() => r, ":first-child"), k.attr("class", "basic label-container").attr("style", M || null);
3041
+ } else {
3042
+ k = o.insert("rect", ":first-child"), k.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", A ?? 5).attr("ry", j ?? 5).attr("x", D).attr("y", O).attr("width", _).attr("height", x);
3043
+ let e = "priority" in t && t.priority;
3044
+ if (e) {
3045
+ let t = o.append("line"), n = D + 2, r = O + Math.floor((A ?? 0) / 2), i = O + x - Math.floor((A ?? 0) / 2);
3046
+ t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Ht(e));
3047
+ }
3048
+ }
3049
+ return T(t, k), t.height = x, t.intersect = function(e) {
3050
+ return W.rect(t, e);
3051
+ }, o;
3052
+ }
3053
+ t(Ut, "kanbanItem");
3054
+ async function Wt(t, n) {
3055
+ let { labelStyles: r, nodeStyles: i } = y(n);
3056
+ n.labelStyle = r;
3057
+ let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await C(t, n, E(n)), l = o.width + 10 * s, u = o.height + 8 * s, d = .15 * l, { cssStyles: p } = n, m = o.width + 20, h = o.height + 20, g = Math.max(l, m), _ = Math.max(u, h);
3058
+ c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`);
3059
+ let b, x = `M0 0
3060
+ a${d},${d} 1 0,0 ${g * .25},${-1 * _ * .1}
3061
+ a${d},${d} 1 0,0 ${g * .25},0
3062
+ a${d},${d} 1 0,0 ${g * .25},0
3063
+ a${d},${d} 1 0,0 ${g * .25},${_ * .1}
3064
+
3065
+ a${d},${d} 1 0,0 ${g * .15},${_ * .33}
3066
+ a${d * .8},${d * .8} 1 0,0 0,${_ * .34}
3067
+ a${d},${d} 1 0,0 ${-1 * g * .15},${_ * .33}
3068
+
3069
+ a${d},${d} 1 0,0 ${-1 * g * .25},${_ * .15}
3070
+ a${d},${d} 1 0,0 ${-1 * g * .25},0
3071
+ a${d},${d} 1 0,0 ${-1 * g * .25},0
3072
+ a${d},${d} 1 0,0 ${-1 * g * .25},${-1 * _ * .15}
3073
+
3074
+ a${d},${d} 1 0,0 ${-1 * g * .1},${-1 * _ * .33}
3075
+ a${d * .8},${d * .8} 1 0,0 0,${-1 * _ * .34}
3076
+ a${d},${d} 1 0,0 ${g * .1},${-1 * _ * .33}
3077
+ H0 V0 Z`;
3078
+ if (n.look === "handDrawn") {
3079
+ let e = S.svg(a), t = v(n, {}), r = e.path(x, t);
3080
+ b = a.insert(() => r, ":first-child"), b.attr("class", "basic label-container").attr("style", f(p));
3081
+ } else b = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", x);
3082
+ return b.attr("transform", `translate(${-g / 2}, ${-_ / 2})`), T(n, b), n.calcIntersect = function(e, t) {
3083
+ return W.rect(e, t);
3084
+ }, n.intersect = function(t) {
3085
+ return e.info("Bang intersect", n, t), W.rect(n, t);
3086
+ }, a;
3087
+ }
3088
+ t(Wt, "bang");
3089
+ async function Gt(t, n) {
3090
+ let { labelStyles: r, nodeStyles: i } = y(n);
3091
+ n.labelStyle = r;
3092
+ let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await C(t, n, E(n)), l = o.width + 2 * s, u = o.height + 2 * s, d = .15 * l, p = .25 * l, m = .35 * l, h = .2 * l, { cssStyles: g } = n, _, b = `M0 0
3093
+ a${d},${d} 0 0,1 ${l * .25},${-1 * l * .1}
3094
+ a${m},${m} 1 0,1 ${l * .4},${-1 * l * .1}
3095
+ a${p},${p} 1 0,1 ${l * .35},${l * .2}
3096
+
3097
+ a${d},${d} 1 0,1 ${l * .15},${u * .35}
3098
+ a${h},${h} 1 0,1 ${-1 * l * .15},${u * .65}
3099
+
3100
+ a${p},${d} 1 0,1 ${-1 * l * .25},${l * .15}
3101
+ a${m},${m} 1 0,1 ${-1 * l * .5},0
3102
+ a${d},${d} 1 0,1 ${-1 * l * .25},${-1 * l * .15}
3103
+
3104
+ a${d},${d} 1 0,1 ${-1 * l * .1},${-1 * u * .35}
3105
+ a${h},${h} 1 0,1 ${l * .1},${-1 * u * .65}
3106
+ H0 V0 Z`;
3107
+ if (n.look === "handDrawn") {
3108
+ let e = S.svg(a), t = v(n, {}), r = e.path(b, t);
3109
+ _ = a.insert(() => r, ":first-child"), _.attr("class", "basic label-container").attr("style", f(g));
3110
+ } else _ = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", b);
3111
+ return c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`), _.attr("transform", `translate(${-l / 2}, ${-u / 2})`), T(n, _), n.calcIntersect = function(e, t) {
3112
+ return W.rect(e, t);
3113
+ }, n.intersect = function(t) {
3114
+ return e.info("Cloud intersect", n, t), W.rect(n, t);
3115
+ }, a;
3116
+ }
3117
+ t(Gt, "cloud");
3118
+ async function Kt(e, t) {
3119
+ let { labelStyles: n, nodeStyles: r } = y(t);
3120
+ t.labelStyle = n;
3121
+ let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await C(e, t, E(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = t.look === "neo" ? `
3122
+ M${-c / 2} ${l / 2 - 5}
3123
+ v${-l + 10}
3124
+ q0,-5 5,-5
3125
+ h${c - 10}
3126
+ q5,0 5,5
3127
+ v${l - 5}
3128
+ H${-c / 2}
3129
+ Z
3130
+ ` : `
3131
+ M${-c / 2} ${l / 2 - 5}
3132
+ v${-l + 10}
3133
+ q0,-5 5,-5
3134
+ h${c - 10}
3135
+ q5,0 5,5
3136
+ v${l - 10}
3137
+ q0,5 -5,5
3138
+ h${-(c - 10)}
3139
+ q-5,0 -5,-5
3140
+ Z
3141
+ `;
3142
+ if (!t.domId) throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
3143
+ let d = i.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
3144
+ return i.append("line").attr("class", "node-line-").attr("x1", -c / 2).attr("y1", l / 2).attr("x2", c / 2).attr("y2", l / 2), s.attr("transform", `translate(${-a.width / 2}, ${-a.height / 2})`), i.append(() => s.node()), T(t, d), t.calcIntersect = function(e, t) {
3145
+ return W.rect(e, t);
3146
+ }, t.intersect = function(e) {
3147
+ return W.rect(t, e);
3148
+ }, i;
3149
+ }
3150
+ t(Kt, "defaultMindmapNode");
3151
+ async function qt(e, t) {
3152
+ return ue(e, t, { padding: t.padding ?? 0 });
3153
+ }
3154
+ t(qt, "mindmapCircle");
3155
+ var Jt = [
3156
+ {
3157
+ semanticName: "Process",
3158
+ name: "Rectangle",
3159
+ shortName: "rect",
3160
+ description: "Standard process shape",
3161
+ aliases: [
3162
+ "proc",
3163
+ "process",
3164
+ "rectangle"
3165
+ ],
3166
+ internalAliases: ["squareRect"],
3167
+ handler: ct
3168
+ },
3169
+ {
3170
+ semanticName: "Event",
3171
+ name: "Rounded Rectangle",
3172
+ shortName: "rounded",
3173
+ description: "Represents an event",
3174
+ aliases: ["event"],
3175
+ internalAliases: ["roundedRect"],
3176
+ handler: at
3177
+ },
3178
+ {
3179
+ semanticName: "Terminal Point",
3180
+ name: "Stadium",
3181
+ shortName: "stadium",
3182
+ description: "Terminal point",
3183
+ aliases: ["terminal", "pill"],
3184
+ handler: lt
3185
+ },
3186
+ {
3187
+ semanticName: "Subprocess",
3188
+ name: "Framed Rectangle",
3189
+ shortName: "fr-rect",
3190
+ description: "Subprocess",
3191
+ aliases: [
3192
+ "subprocess",
3193
+ "subproc",
3194
+ "framed-rectangle",
3195
+ "subroutine"
3196
+ ],
3197
+ handler: mt
3198
+ },
3199
+ {
3200
+ semanticName: "Database",
3201
+ name: "Cylinder",
3202
+ shortName: "cyl",
3203
+ description: "Database storage",
3204
+ aliases: [
3205
+ "db",
3206
+ "database",
3207
+ "cylinder"
3208
+ ],
3209
+ handler: Se
3210
+ },
3211
+ {
3212
+ semanticName: "Start",
3213
+ name: "Circle",
3214
+ shortName: "circle",
3215
+ description: "Starting point",
3216
+ aliases: ["circ"],
3217
+ handler: ue
3218
+ },
3219
+ {
3220
+ semanticName: "Bang",
3221
+ name: "Bang",
3222
+ shortName: "bang",
3223
+ description: "Bang",
3224
+ aliases: ["bang"],
3225
+ handler: Wt
3226
+ },
3227
+ {
3228
+ semanticName: "Cloud",
3229
+ name: "Cloud",
3230
+ shortName: "cloud",
3231
+ description: "cloud",
3232
+ aliases: ["cloud"],
3233
+ handler: Gt
3234
+ },
3235
+ {
3236
+ semanticName: "Decision",
3237
+ name: "Diamond",
3238
+ shortName: "diam",
3239
+ description: "Decision-making step",
3240
+ aliases: [
3241
+ "decision",
3242
+ "diamond",
3243
+ "question"
3244
+ ],
3245
+ handler: nt
3246
+ },
3247
+ {
3248
+ semanticName: "Prepare Conditional",
3249
+ name: "Hexagon",
3250
+ shortName: "hex",
3251
+ description: "Preparation or condition step",
3252
+ aliases: ["hexagon", "prepare"],
3253
+ handler: Me
3254
+ },
3255
+ {
3256
+ semanticName: "Data Input/Output",
3257
+ name: "Lean Right",
3258
+ shortName: "lean-r",
3259
+ description: "Represents input or output",
3260
+ aliases: ["lean-right", "in-out"],
3261
+ internalAliases: ["lean_right"],
3262
+ handler: Ue
3263
+ },
3264
+ {
3265
+ semanticName: "Data Input/Output",
3266
+ name: "Lean Left",
3267
+ shortName: "lean-l",
3268
+ description: "Represents output or input",
3269
+ aliases: ["lean-left", "out-in"],
3270
+ internalAliases: ["lean_left"],
3271
+ handler: He
3272
+ },
3273
+ {
3274
+ semanticName: "Priority Action",
3275
+ name: "Trapezoid Base Bottom",
3276
+ shortName: "trap-b",
3277
+ description: "Priority action",
3278
+ aliases: [
3279
+ "priority",
3280
+ "trapezoid-bottom",
3281
+ "trapezoid"
3282
+ ],
3283
+ handler: Tt
3284
+ },
3285
+ {
3286
+ semanticName: "Manual Operation",
3287
+ name: "Trapezoid Base Top",
3288
+ shortName: "trap-t",
3289
+ description: "Represents a manual task",
3290
+ aliases: [
3291
+ "manual",
3292
+ "trapezoid-top",
3293
+ "inv-trapezoid"
3294
+ ],
3295
+ internalAliases: ["inv_trapezoid"],
3296
+ handler: ze
3297
+ },
3298
+ {
3299
+ semanticName: "Stop",
3300
+ name: "Double Circle",
3301
+ shortName: "dbl-circ",
3302
+ description: "Represents a stop point",
3303
+ aliases: ["double-circle"],
3304
+ internalAliases: ["doublecircle"],
3305
+ handler: we
3306
+ },
3307
+ {
3308
+ semanticName: "Text Block",
3309
+ name: "Text Block",
3310
+ shortName: "text",
3311
+ description: "Text block",
3312
+ handler: vt
3313
+ },
3314
+ {
3315
+ semanticName: "Card",
3316
+ name: "Notched Rectangle",
3317
+ shortName: "notch-rect",
3318
+ description: "Represents a card",
3319
+ aliases: ["card", "notched-rectangle"],
3320
+ handler: ce
3321
+ },
3322
+ {
3323
+ semanticName: "Lined/Shaded Process",
3324
+ name: "Lined Rectangle",
3325
+ shortName: "lin-rect",
3326
+ description: "Lined process shape",
3327
+ aliases: [
3328
+ "lined-rectangle",
3329
+ "lined-process",
3330
+ "lin-proc",
3331
+ "shaded-process"
3332
+ ],
3333
+ handler: ot
3334
+ },
3335
+ {
3336
+ semanticName: "Start",
3337
+ name: "Small Circle",
3338
+ shortName: "sm-circ",
3339
+ description: "Small starting point",
3340
+ aliases: ["start", "small-circle"],
3341
+ internalAliases: ["stateStart"],
3342
+ handler: ft
3343
+ },
3344
+ {
3345
+ semanticName: "Stop",
3346
+ name: "Framed Circle",
3347
+ shortName: "fr-circ",
3348
+ description: "Stop point",
3349
+ aliases: ["stop", "framed-circle"],
3350
+ internalAliases: ["stateEnd"],
3351
+ handler: dt
3352
+ },
3353
+ {
3354
+ semanticName: "Fork/Join",
3355
+ name: "Filled Rectangle",
3356
+ shortName: "fork",
3357
+ description: "Fork or join in process flow",
3358
+ aliases: ["join"],
3359
+ internalAliases: ["forkJoin"],
3360
+ handler: ke
3361
+ },
3362
+ {
3363
+ semanticName: "Collate",
3364
+ name: "Hourglass",
3365
+ shortName: "hourglass",
3366
+ description: "Represents a collate operation",
3367
+ aliases: ["hourglass", "collate"],
3368
+ handler: Ne
3369
+ },
3370
+ {
3371
+ semanticName: "Comment",
3372
+ name: "Curly Brace",
3373
+ shortName: "brace",
3374
+ description: "Adds a comment",
3375
+ aliases: ["comment", "brace-l"],
3376
+ handler: pe
3377
+ },
3378
+ {
3379
+ semanticName: "Comment Right",
3380
+ name: "Curly Brace",
3381
+ shortName: "brace-r",
3382
+ description: "Adds a comment",
3383
+ handler: me
3384
+ },
3385
+ {
3386
+ semanticName: "Comment with braces on both sides",
3387
+ name: "Curly Braces",
3388
+ shortName: "braces",
3389
+ description: "Adds a comment",
3390
+ handler: he
3391
+ },
3392
+ {
3393
+ semanticName: "Com Link",
3394
+ name: "Lightning Bolt",
3395
+ shortName: "bolt",
3396
+ description: "Communication link",
3397
+ aliases: ["com-link", "lightning-bolt"],
3398
+ handler: We
3399
+ },
3400
+ {
3401
+ semanticName: "Document",
3402
+ name: "Document",
3403
+ shortName: "doc",
3404
+ description: "Represents a document",
3405
+ aliases: ["doc", "document"],
3406
+ handler: At
3407
+ },
3408
+ {
3409
+ semanticName: "Delay",
3410
+ name: "Half-Rounded Rectangle",
3411
+ shortName: "delay",
3412
+ description: "Represents a delay",
3413
+ aliases: ["half-rounded-rectangle"],
3414
+ handler: Ae
3415
+ },
3416
+ {
3417
+ semanticName: "Direct Access Storage",
3418
+ name: "Horizontal Cylinder",
3419
+ shortName: "h-cyl",
3420
+ description: "Direct access storage",
3421
+ aliases: ["das", "horizontal-cylinder"],
3422
+ handler: wt
3423
+ },
3424
+ {
3425
+ semanticName: "Disk Storage",
3426
+ name: "Lined Cylinder",
3427
+ shortName: "lin-cyl",
3428
+ description: "Disk storage",
3429
+ aliases: ["disk", "lined-cylinder"],
3430
+ handler: Xe
3431
+ },
3432
+ {
3433
+ semanticName: "Display",
3434
+ name: "Curved Trapezoid",
3435
+ shortName: "curv-trap",
3436
+ description: "Represents a display",
3437
+ aliases: ["curved-trapezoid", "display"],
3438
+ handler: ge
3439
+ },
3440
+ {
3441
+ semanticName: "Divided Process",
3442
+ name: "Divided Rectangle",
3443
+ shortName: "div-rect",
3444
+ description: "Divided process shape",
3445
+ aliases: [
3446
+ "div-proc",
3447
+ "divided-rectangle",
3448
+ "divided-process"
3449
+ ],
3450
+ handler: Ce
3451
+ },
3452
+ {
3453
+ semanticName: "Extract",
3454
+ name: "Triangle",
3455
+ shortName: "tri",
3456
+ description: "Extraction process",
3457
+ aliases: ["extract", "triangle"],
3458
+ handler: kt
3459
+ },
3460
+ {
3461
+ semanticName: "Internal Storage",
3462
+ name: "Window Pane",
3463
+ shortName: "win-pane",
3464
+ description: "Internal storage",
3465
+ aliases: ["internal-storage", "window-pane"],
3466
+ handler: Mt
3467
+ },
3468
+ {
3469
+ semanticName: "Junction",
3470
+ name: "Filled Circle",
3471
+ shortName: "f-circ",
3472
+ description: "Junction point",
3473
+ aliases: ["junction", "filled-circle"],
3474
+ handler: Te
3475
+ },
3476
+ {
3477
+ semanticName: "Loop Limit",
3478
+ name: "Trapezoidal Pentagon",
3479
+ shortName: "notch-pent",
3480
+ description: "Loop limit step",
3481
+ aliases: ["loop-limit", "notched-pentagon"],
3482
+ handler: Et
3483
+ },
3484
+ {
3485
+ semanticName: "Manual File",
3486
+ name: "Flipped Triangle",
3487
+ shortName: "flip-tri",
3488
+ description: "Manual file operation",
3489
+ aliases: ["manual-file", "flipped-triangle"],
3490
+ handler: Oe
3491
+ },
3492
+ {
3493
+ semanticName: "Manual Input",
3494
+ name: "Sloped Rectangle",
3495
+ shortName: "sl-rect",
3496
+ description: "Manual input step",
3497
+ aliases: ["manual-input", "sloped-rectangle"],
3498
+ handler: st
3499
+ },
3500
+ {
3501
+ semanticName: "Multi-Document",
3502
+ name: "Stacked Document",
3503
+ shortName: "docs",
3504
+ description: "Multiple documents",
3505
+ aliases: [
3506
+ "documents",
3507
+ "st-doc",
3508
+ "stacked-document"
3509
+ ],
3510
+ handler: $e
3511
+ },
3512
+ {
3513
+ semanticName: "Multi-Process",
3514
+ name: "Stacked Rectangle",
3515
+ shortName: "st-rect",
3516
+ description: "Multiple processes",
3517
+ aliases: [
3518
+ "procs",
3519
+ "processes",
3520
+ "stacked-rectangle"
3521
+ ],
3522
+ handler: Qe
3523
+ },
3524
+ {
3525
+ semanticName: "Stored Data",
3526
+ name: "Bow Tie Rectangle",
3527
+ shortName: "bow-rect",
3528
+ description: "Stored data",
3529
+ aliases: ["stored-data", "bow-tie-rectangle"],
3530
+ handler: oe
3531
+ },
3532
+ {
3533
+ semanticName: "Summary",
3534
+ name: "Crossed Circle",
3535
+ shortName: "cross-circ",
3536
+ description: "Summary",
3537
+ aliases: ["summary", "crossed-circle"],
3538
+ handler: fe
3539
+ },
3540
+ {
3541
+ semanticName: "Tagged Document",
3542
+ name: "Tagged Document",
3543
+ shortName: "tag-doc",
3544
+ description: "Tagged document",
3545
+ aliases: ["tag-doc", "tagged-document"],
3546
+ handler: _t
3547
+ },
3548
+ {
3549
+ semanticName: "Tagged Process",
3550
+ name: "Tagged Rectangle",
3551
+ shortName: "tag-rect",
3552
+ description: "Tagged process",
3553
+ aliases: [
3554
+ "tagged-rectangle",
3555
+ "tag-proc",
3556
+ "tagged-process"
3557
+ ],
3558
+ handler: gt
3559
+ },
3560
+ {
3561
+ semanticName: "Paper Tape",
3562
+ name: "Flag",
3563
+ shortName: "flag",
3564
+ description: "Paper tape",
3565
+ aliases: ["paper-tape"],
3566
+ handler: jt
3567
+ },
3568
+ {
3569
+ semanticName: "Odd",
3570
+ name: "Odd",
3571
+ shortName: "odd",
3572
+ description: "Odd shape",
3573
+ internalAliases: ["rect_left_inv_arrow"],
3574
+ handler: rt
3575
+ },
3576
+ {
3577
+ semanticName: "Lined Document",
3578
+ name: "Lined Document",
3579
+ shortName: "lin-doc",
3580
+ description: "Lined document",
3581
+ aliases: ["lined-document"],
3582
+ handler: Ze
3583
+ }
3584
+ ], Yt = (/* @__PURE__ */ t(() => {
3585
+ let e = [...Object.entries({
3586
+ state: ut,
3587
+ choice: le,
3588
+ note: et,
3589
+ rectWithTitle: it,
3590
+ labelRect: Ve,
3591
+ iconSquare: Le,
3592
+ iconCircle: Fe,
3593
+ icon: Pe,
3594
+ iconRounded: Ie,
3595
+ imageSquare: Re,
3596
+ anchor: G,
3597
+ kanbanItem: Ut,
3598
+ mindmapCircle: qt,
3599
+ defaultMindmapNode: Kt,
3600
+ classBox: Bt,
3601
+ erBox: Ft,
3602
+ requirementBox: Vt
3603
+ }), ...Jt.flatMap((e) => [
3604
+ e.shortName,
3605
+ ..."aliases" in e ? e.aliases : [],
3606
+ ..."internalAliases" in e ? e.internalAliases : []
3607
+ ].map((t) => [t, e.handler]))];
3608
+ return Object.fromEntries(e);
3609
+ }, "generateShapeMap"))();
3610
+ function Xt(e) {
3611
+ return e in Yt;
3612
+ }
3613
+ t(Xt, "isValidShape");
3614
+ var Zt = /* @__PURE__ */ new Map();
3615
+ async function Qt(e, t, n) {
3616
+ let r, i;
3617
+ t.shape === "rect" && (t.rx && t.ry ? t.shape = "roundedRect" : t.shape = "squareRect");
3618
+ let a = t.shape ? Yt[t.shape] : void 0;
3619
+ if (!a) throw Error(`No such shape: ${t.shape}. Please check your syntax.`);
3620
+ if (t.link) {
3621
+ let o;
3622
+ n.config.securityLevel === "sandbox" ? o = "_top" : t.linkTarget && (o = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", o ?? null), i = await a(r, t, n);
3623
+ } else i = await a(e, t, n), r = i;
3624
+ return r.attr("data-look", f(t.look)), t.tooltip && i.attr("title", t.tooltip), Zt.set(t.id, r), t.haveCallback && r.attr("class", r.attr("class") + " clickable"), r;
3625
+ }
3626
+ t(Qt, "insertNode");
3627
+ var $t = /* @__PURE__ */ t((e, t) => {
3628
+ Zt.set(t.id, e);
3629
+ }, "setNodeElem"), en = /* @__PURE__ */ t(() => {
3630
+ Zt.clear();
3631
+ }, "clear"), tn = /* @__PURE__ */ t((t) => {
3632
+ let n = Zt.get(t.id);
3633
+ e.trace("Transforming node", t.diff, t, "translate(" + (t.x - t.width / 2 - 5) + ", " + t.width / 2 + ")");
3634
+ let r = t.diff || 0;
3635
+ return t.clusterNode ? n.attr("transform", "translate(" + (t.x + r - t.width / 2) + ", " + (t.y - t.height / 2 - 8) + ")") : n.attr("transform", "translate(" + t.x + ", " + t.y + ")"), r;
3636
+ }, "positionNode");
3637
+ //#endregion
3638
+ export { Qt as a, tn as c, ee as i, $t as l, en as n, Xt as o, M as r, C as s, te as t, T as u };