@layers-app/editor 0.7.18 → 0.7.20

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 (249) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +77 -1
  3. package/dist/index.js +15 -9
  4. package/dist/layers.-pxItkuK.js +11 -0
  5. package/dist/layers.4783bPvO.js +39 -0
  6. package/dist/layers.4XOTUH37.js +1089 -0
  7. package/dist/layers.4peyl00A.js +2 -0
  8. package/dist/layers.4wAcqQtQ.js +423 -0
  9. package/dist/layers.4ykD0YcM.js +40 -0
  10. package/dist/layers.52famHy6.js +1 -0
  11. package/dist/layers.6Feq9YXQ.js +40 -0
  12. package/dist/layers.6GQPwq_6.js +960 -0
  13. package/dist/layers.7JqFgE4-.js +15 -0
  14. package/dist/layers.7wQbmwwB.js +1034 -0
  15. package/dist/layers.8JNx1FTq.js +35 -0
  16. package/dist/layers.8jhm9FEJ.js +10 -0
  17. package/dist/layers.8lNrKfca.js +41 -0
  18. package/dist/layers.9kQUqqYe.js +139 -0
  19. package/dist/layers.9pNaFvaX.js +1 -0
  20. package/dist/layers.AO3vHISA.js +33 -0
  21. package/dist/layers.Ab6Lx44l.js +129 -0
  22. package/dist/layers.B-w9_4cB.js +22 -0
  23. package/dist/layers.B0bpRgNT.js +122 -0
  24. package/dist/layers.B19hGmey.js +1 -0
  25. package/dist/layers.B2OK_mI8.js +1 -0
  26. package/dist/layers.B3D4g2HH.js +1 -0
  27. package/dist/layers.B3mzJc8P.js +907 -0
  28. package/dist/layers.B5YhL7Gw.js +40 -0
  29. package/dist/layers.B7K7JjK6.js +1510 -0
  30. package/dist/layers.B885pkJL.js +794 -0
  31. package/dist/layers.B961U-Vk.js +1 -0
  32. package/dist/layers.B9jATAXU.js +42 -0
  33. package/dist/layers.BAtv1CM7.js +1 -0
  34. package/dist/layers.BBv6P-Uu.js +37 -0
  35. package/dist/layers.BC6JEDP2.js +796 -0
  36. package/dist/layers.BEagxCE_.js +35 -0
  37. package/dist/layers.BH34WCDb.js +6 -0
  38. package/dist/layers.BIeVwYKL.js +1 -0
  39. package/dist/layers.BIkD0WQr.js +10 -0
  40. package/dist/layers.BIlhFIEz.js +37 -0
  41. package/dist/layers.BJDrjORS.js +244 -0
  42. package/dist/{layers.D99OBX9u.js → layers.BJLOp9cg.js} +88 -86
  43. package/dist/layers.BJsWSYrS.js +323 -0
  44. package/dist/layers.BKwcxD8A.js +5 -0
  45. package/dist/layers.BLd2spTm.js +1 -0
  46. package/dist/layers.BLv_frn1.js +10 -0
  47. package/dist/layers.BO2V23mI.js +1 -0
  48. package/dist/layers.BO_D4q5p.js +42 -0
  49. package/dist/layers.BP7EcZBZ.js +1 -0
  50. package/dist/layers.BP8OcU0T.js +10 -0
  51. package/dist/layers.BRaRY9tU.js +373 -0
  52. package/dist/layers.BSTBZrFn.js +1 -0
  53. package/dist/layers.BT2iHuSm.js +8 -0
  54. package/dist/layers.BU-tjKWq.js +33 -0
  55. package/dist/layers.BWEUOe94.js +40 -0
  56. package/dist/layers.BXAu7G4b.js +4 -0
  57. package/dist/layers.BZ9zcjtY.js +8 -0
  58. package/dist/layers.BZa5A6cg.js +425 -0
  59. package/dist/layers.BZlzQFiI.js +51 -0
  60. package/dist/layers.BagtOD0V.js +1 -0
  61. package/dist/layers.BbCfEXyj.js +55 -0
  62. package/dist/layers.Be94M_F4.js +7 -0
  63. package/dist/layers.BhdUQN6J.js +1583 -0
  64. package/dist/layers.Bj915C_T.js +5 -0
  65. package/dist/layers.BnHSrOPr.js +40 -0
  66. package/dist/layers.BngaRys_.js +8583 -0
  67. package/dist/layers.BoRvGzPp.js +1 -0
  68. package/dist/layers.Bob38w8X.js +5 -0
  69. package/dist/layers.BpTkSHkL.js +38 -0
  70. package/dist/layers.BpVR__4s.js +32 -0
  71. package/dist/layers.BpilXLfW.js +6 -0
  72. package/dist/layers.Br9HAzwf.js +2482 -0
  73. package/dist/layers.Bt7brqhi.js +116 -0
  74. package/dist/layers.BtqAfMks.js +1 -0
  75. package/dist/layers.BtvHse58.js +1 -0
  76. package/dist/layers.BwzogUnt.js +41 -0
  77. package/dist/layers.ByB5f2g3.js +7 -0
  78. package/dist/layers.ByipH4AB.js +207 -0
  79. package/dist/layers.BzC5N3hu.js +1619 -0
  80. package/dist/layers.C-KP-jFZ.js +8 -0
  81. package/dist/layers.C0iFGBoQ.js +213 -0
  82. package/dist/layers.C1AULvj_.js +40 -0
  83. package/dist/layers.C2f7uCzl.js +21620 -0
  84. package/dist/layers.C47t6lve.js +2 -0
  85. package/dist/layers.C4gRYt-z.js +9 -0
  86. package/dist/layers.C4nmPqDc.js +9 -0
  87. package/dist/layers.C5UKJ24R.js +271 -0
  88. package/dist/layers.C5qsYNKq.js +7 -0
  89. package/dist/layers.C70jnpZq.js +42 -0
  90. package/dist/layers.C7Qg5l_Q.js +5 -0
  91. package/dist/layers.C7v0beLV.js +9 -0
  92. package/dist/layers.C8_lu5UH.js +23 -0
  93. package/dist/layers.CAcCDIzK.js +32 -0
  94. package/dist/layers.CCWJVHwX.js +26946 -0
  95. package/dist/layers.CF2BAIC-.js +1 -0
  96. package/dist/layers.CFUGAgBV.js +805 -0
  97. package/dist/layers.CHZsXQcr.js +1 -0
  98. package/dist/layers.CIo6HbVI.js +37 -0
  99. package/dist/layers.CJaSQy6k.js +70 -0
  100. package/dist/layers.CJhFGqXY.js +1 -0
  101. package/dist/layers.CKU_klOZ.js +41 -0
  102. package/dist/layers.CKrtSnTU.js +7 -0
  103. package/dist/layers.CNoIsdHV.js +223 -0
  104. package/dist/layers.CQ-g_IO8.js +39 -0
  105. package/dist/layers.CRWtU7Vx.js +1268 -0
  106. package/dist/layers.CSattQNk.js +8 -0
  107. package/dist/layers.CT-8Geho.js +118 -0
  108. package/dist/layers.CWTjwUqI.js +9 -0
  109. package/dist/layers.CY3nuiOZ.js +39 -0
  110. package/dist/layers.CYDGmR2c.js +1 -0
  111. package/dist/layers.CYPtUh0S.js +36 -0
  112. package/dist/layers.CYjyWg9h.js +139 -0
  113. package/dist/layers.CZCoH1Jq.js +189 -0
  114. package/dist/layers.CZVe7Rrz.js +4 -0
  115. package/dist/layers.C_8NFZw0.js +84 -0
  116. package/dist/layers.C_IvrzZ3.js +7 -0
  117. package/dist/layers.C_vVmOaW.js +7 -0
  118. package/dist/layers.Cb3vLPzi.js +1 -0
  119. package/dist/layers.Cblg5KAJ.js +1286 -0
  120. package/dist/layers.CeUsnn-s.js +41 -0
  121. package/dist/layers.Cfwoj-CP.js +76 -0
  122. package/dist/layers.Cfxt2JbX.js +160 -0
  123. package/dist/layers.CjixIcYE.js +205 -0
  124. package/dist/layers.CliEt_s4.js +8 -0
  125. package/dist/layers.Cmumbtn4.js +11 -0
  126. package/dist/layers.Cnkh0zSn.js +5 -0
  127. package/dist/layers.Co0MEzNt.js +32 -0
  128. package/dist/layers.CpgPovn6.js +32 -0
  129. package/dist/layers.CqVTtuYm.js +6 -0
  130. package/dist/layers.Cr_8J_Ls.js +36 -0
  131. package/dist/layers.Cs7THreY.js +42 -0
  132. package/dist/layers.CtQHRQJd.js +65 -0
  133. package/dist/layers.Cuv2Lipq.js +10 -0
  134. package/dist/layers.Cuy--_Li.js +14 -0
  135. package/dist/layers.Cxrjuyke.js +38 -0
  136. package/dist/layers.Cxuu78R8.js +1 -0
  137. package/dist/layers.Cy_jbtrS.js +198 -0
  138. package/dist/layers.CyabQ7I1.js +40 -0
  139. package/dist/layers.CyqF5h2Z.js +1 -0
  140. package/dist/layers.Cyzu9PKQ.js +1 -0
  141. package/dist/layers.CzDyzzM2.js +36 -0
  142. package/dist/layers.D-LL79P8.js +32 -0
  143. package/dist/layers.D-uQN6e4.js +271 -0
  144. package/dist/layers.D00djYUT.js +9 -0
  145. package/dist/layers.D0zn4_Mx.js +1 -0
  146. package/dist/layers.D1PMEoqL.js +41 -0
  147. package/dist/layers.D1WSB9zI.js +806 -0
  148. package/dist/layers.D2dRxQww.js +10 -0
  149. package/dist/layers.D3KEnhiI.js +6 -0
  150. package/dist/layers.D3SlAvNp.js +934 -0
  151. package/dist/layers.D3eKKoAb.js +1 -0
  152. package/dist/layers.D4T8fTcj.js +1223 -0
  153. package/dist/layers.D7gfmd9A.js +36 -0
  154. package/dist/layers.D7jGxypv.js +8 -0
  155. package/dist/layers.DA1OUhKy.js +10 -0
  156. package/dist/layers.DB4o6Xfv.js +42 -0
  157. package/dist/layers.DBUjVgMd.js +1 -0
  158. package/dist/layers.DCkmUFPh.js +2966 -0
  159. package/dist/layers.DD4QPdYS.js +96 -0
  160. package/dist/layers.DE2Io1k7.js +295 -0
  161. package/dist/layers.DKnEcoKx.js +1088 -0
  162. package/dist/layers.DKsXm_hK.js +9 -0
  163. package/dist/layers.DLeGllIz.js +1 -0
  164. package/dist/layers.DLwuMfdd.js +84 -0
  165. package/dist/layers.DMkBISW1.js +1 -0
  166. package/dist/layers.DN9HoVxI.js +18 -0
  167. package/dist/layers.DOrgOHBr.js +1 -0
  168. package/dist/layers.DPipd7Yf.js +1 -0
  169. package/dist/layers.DQpNkl-s.js +39 -0
  170. package/dist/layers.DSNr6P6_.js +40 -0
  171. package/dist/layers.DWGLEZg1.js +34 -0
  172. package/dist/layers.DWxUDz1V.js +13 -0
  173. package/dist/layers.DYk9FILk.js +8 -0
  174. package/dist/layers.DZ3Nv-_j.js +8 -0
  175. package/dist/layers.DZGvjyDH.js +1 -0
  176. package/dist/layers.DZucH9TB.js +40 -0
  177. package/dist/layers.D__NkOsa.js +7 -0
  178. package/dist/layers.DbaKVP5e.js +1 -0
  179. package/dist/layers.DfkAyTyX.js +39 -0
  180. package/dist/layers.Dgie_iy2.js +772 -0
  181. package/dist/layers.DhHIDfZ5.js +1 -0
  182. package/dist/layers.Di-7t8Xt.js +6 -0
  183. package/dist/layers.DiPSTN4q.js +1 -0
  184. package/dist/layers.DjLIeP8d.js +257 -0
  185. package/dist/layers.DjUOC4st.js +16 -0
  186. package/dist/layers.Dk6h-6Wb.js +2 -0
  187. package/dist/layers.DkRR3p16.js +61 -0
  188. package/dist/layers.DnXxZJQo.js +48149 -0
  189. package/dist/layers.DpahuC02.js +6 -0
  190. package/dist/layers.Dpqc2FAN.js +40 -0
  191. package/dist/layers.DqScp2vq.js +1126 -0
  192. package/dist/layers.Dr1JRZ_S.js +4 -0
  193. package/dist/layers.DrTaVUsA.js +39 -0
  194. package/dist/layers.DrXLa4el.js +44 -0
  195. package/dist/layers.DtKxMd0g.js +4 -0
  196. package/dist/layers.DxA6ocdw.js +70 -0
  197. package/dist/layers.DxRZNwMP.js +1 -0
  198. package/dist/layers.Dy1naDTQ.js +14 -0
  199. package/dist/layers.FArKPCKA.js +21941 -0
  200. package/dist/layers.FXdB_jrR.js +9 -0
  201. package/dist/layers.GbuD0dtx.js +6 -0
  202. package/dist/layers.ILs-xE7i.js +11 -0
  203. package/dist/layers.JWCLFILJ.js +1 -0
  204. package/dist/layers.L9obQAvP.js +10 -0
  205. package/dist/layers.Lb5VQ9U4.js +504 -0
  206. package/dist/layers.MCy444Ia.js +41 -0
  207. package/dist/layers.QyDQqf0G.js +39 -0
  208. package/dist/layers.R4CPUhiF.js +8 -0
  209. package/dist/layers.R8mPlCA0.js +261 -0
  210. package/dist/layers.Sjtd5SpD.js +84 -0
  211. package/dist/layers.XlzBx5CM.js +437 -0
  212. package/dist/layers.YD8zq7G1.js +41 -0
  213. package/dist/layers.YWM6eRUH.js +1 -0
  214. package/dist/layers.a6EbdnVa.js +37 -0
  215. package/dist/layers.b0h5ZBmD.js +61 -0
  216. package/dist/layers.b9B2NY7n.js +11690 -0
  217. package/dist/layers.bS5nz97o.js +3 -0
  218. package/dist/layers.biaV5QcU.js +7 -0
  219. package/dist/layers.dxw35GiE.js +52 -0
  220. package/dist/layers.gFW_9pGM.js +1225 -0
  221. package/dist/layers.ge00jJfz.js +38 -0
  222. package/dist/layers.iryDeY19.js +9 -0
  223. package/dist/layers.jN02hLg8.js +7 -0
  224. package/dist/layers.jqEynR2I.js +8 -0
  225. package/dist/layers.lCpg7dOn.js +21 -0
  226. package/dist/layers.lIg0cncJ.js +39 -0
  227. package/dist/layers.lKk6bx4R.js +1 -0
  228. package/dist/layers.m4XcFQDd.js +6 -0
  229. package/dist/layers.m6FDW_ho.js +8 -0
  230. package/dist/layers.r6u8p96p.js +2238 -0
  231. package/dist/layers.rWob7btU.js +10 -0
  232. package/dist/layers.rYZbXo4d.js +32 -0
  233. package/dist/layers.sldWqHdD.js +11 -0
  234. package/dist/layers.tFqdqg82.js +10 -0
  235. package/dist/layers.v25uTBY8.js +39 -0
  236. package/dist/layers.wNarGMxP.js +9 -0
  237. package/dist/layers.wxYowcaq.js +41 -0
  238. package/dist/layers.xjN3ile4.js +9 -0
  239. package/dist/layers.yNlD-OCA.js +35 -0
  240. package/dist/layers.z-RuimGg.js +11 -0
  241. package/dist/layers.zvsP8spW.js +1 -0
  242. package/package.json +1 -1
  243. package/dist/layers.94hwidA2.js +0 -198
  244. package/dist/layers.B4l6ta1Q.js +0 -1
  245. package/dist/layers.BMrOAD_P.js +0 -1
  246. package/dist/layers.DOzLBYZr.js +0 -304
  247. package/dist/layers.YRyXopy_.js +0 -151
  248. package/dist/layers.usKC_Id5.js +0 -1
  249. package/dist/layers.zu-IYGYU.js +0 -47463
@@ -0,0 +1,794 @@
1
+ import { f as $, p as St } from "./layers.DqScp2vq.js";
2
+ import { d as x, a0 as G, l as M, g as D, Y as Lt, _ as V, $ as W, t as Z, V as tt, j as et } from "./layers.BngaRys_.js";
3
+ import * as rt from "lodash-es";
4
+ import { pick as _t, defaults as I } from "lodash-es";
5
+ import { l as Et } from "./layers.D4T8fTcj.js";
6
+ import { G as Tt } from "./layers.BJDrjORS.js";
7
+ import { b as T, c as at, i as nt, d as _, e as st, g as it, f as Nt, a as At, s as Pt } from "./layers.XlzBx5CM.js";
8
+ import { l as Ct } from "./layers.BU-tjKWq.js";
9
+ import "./layers.C2f7uCzl.js";
10
+ import "lodash-es/memoize.js";
11
+ import "lodash-es/merge.js";
12
+ import "lodash-es/isEmpty.js";
13
+ function It(r) {
14
+ if (!r.ok) throw new Error(r.status + " " + r.statusText);
15
+ return r.text();
16
+ }
17
+ function Bt(r, e) {
18
+ return fetch(r, e).then(It);
19
+ }
20
+ function Mt(r) {
21
+ return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
22
+ }
23
+ var Dt = Mt("image/svg+xml"), z = {
24
+ normal: Gt,
25
+ vee: Ot,
26
+ undirected: Ut
27
+ };
28
+ function Rt(r) {
29
+ z = r;
30
+ }
31
+ function Gt(r, e, t, n) {
32
+ var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
33
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
34
+ }
35
+ function Ot(r, e, t, n) {
36
+ var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
37
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
38
+ }
39
+ function Ut(r, e, t, n) {
40
+ var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
41
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
42
+ }
43
+ function $t(r, e) {
44
+ var t = r;
45
+ return t.node().appendChild(e.label), T(t, e.labelStyle), t;
46
+ }
47
+ function Wt(r, e) {
48
+ for (var t = r.append("text"), n = Vt(e.label).split(`
49
+ `), a = 0; a < n.length; a++)
50
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
51
+ return T(t, e.labelStyle), t;
52
+ }
53
+ function Vt(r) {
54
+ for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
55
+ if (n = r[a], t) {
56
+ switch (n) {
57
+ case "n":
58
+ e += `
59
+ `;
60
+ break;
61
+ default:
62
+ e += n;
63
+ }
64
+ t = !1;
65
+ } else n === "\\" ? t = !0 : e += n;
66
+ return e;
67
+ }
68
+ function q(r, e, t) {
69
+ var n = e.label, a = r.append("g");
70
+ e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
71
+ var s = a.node().getBBox(), i;
72
+ switch (t) {
73
+ case "top":
74
+ i = -e.height / 2;
75
+ break;
76
+ case "bottom":
77
+ i = e.height / 2 - s.height;
78
+ break;
79
+ default:
80
+ i = -s.height / 2;
81
+ }
82
+ return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
83
+ }
84
+ var Y = function(r, e) {
85
+ var t = e.nodes().filter(function(s) {
86
+ return nt(e, s);
87
+ }), n = r.selectAll("g.cluster").data(t, function(s) {
88
+ return s;
89
+ });
90
+ _(n.exit(), e).style("opacity", 0).remove();
91
+ var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
92
+ var i = e.node(s);
93
+ return i.id;
94
+ }).style("opacity", 0).each(function(s) {
95
+ var i = e.node(s), o = x(this);
96
+ x(this).append("rect");
97
+ var c = o.append("g").attr("class", "label");
98
+ q(c, i, i.clusterLabelPos);
99
+ });
100
+ return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
101
+ var i = e.node(s), o = x(this);
102
+ T(o, i.style);
103
+ }), n;
104
+ };
105
+ function zt(r) {
106
+ Y = r;
107
+ }
108
+ let H = function(r, e) {
109
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
110
+ return st(a);
111
+ }).classed("update", !0);
112
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
113
+ var s = x(this);
114
+ s.select(".label").remove();
115
+ var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
116
+ i.labelId && o.attr("id", i.labelId), Object.prototype.hasOwnProperty.call(i, "width") || (i.width = c.width), Object.prototype.hasOwnProperty.call(i, "height") || (i.height = c.height);
117
+ });
118
+ var n;
119
+ return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
120
+ };
121
+ function Yt(r) {
122
+ H = r;
123
+ }
124
+ function K(r, e) {
125
+ return r.intersect(e);
126
+ }
127
+ var X = function(r, e, t) {
128
+ var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
129
+ return st(i);
130
+ }).classed("update", !0), a = qt(n, e);
131
+ Qt(n, e);
132
+ var s = n.merge !== void 0 ? n.merge(a) : n;
133
+ return _(s, e).style("opacity", 1), s.each(function(i) {
134
+ var o = x(this), c = e.edge(i);
135
+ c.elem = this, c.id && o.attr("id", c.id), it(
136
+ o,
137
+ c.class,
138
+ (o.classed("update") ? "update " : "") + "edgePath"
139
+ );
140
+ }), s.selectAll("path.path").each(function(i) {
141
+ var o = e.edge(i);
142
+ o.arrowheadId = rt.uniqueId("arrowhead");
143
+ var c = x(this).attr("marker-end", function() {
144
+ return "url(" + Xt(location.href, o.arrowheadId) + ")";
145
+ }).style("fill", "none");
146
+ _(c, e).attr("d", function(d) {
147
+ return Ft(e, d);
148
+ }), T(c, o.style);
149
+ }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
150
+ var o = e.edge(i), c = t[o.arrowhead];
151
+ c(x(this), o.arrowheadId, o, "arrowhead");
152
+ }), s;
153
+ };
154
+ function Ht(r) {
155
+ X = r;
156
+ }
157
+ function Xt(r, e) {
158
+ var t = r.split("#")[0];
159
+ return t + "#" + e;
160
+ }
161
+ function Ft(r, e) {
162
+ var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
163
+ return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
164
+ }
165
+ function ot(r, e) {
166
+ var t = (Ct || Dt.line)().x(function(n) {
167
+ return n.x;
168
+ }).y(function(n) {
169
+ return n.y;
170
+ });
171
+ return (t.curve || t.interpolate)(r.curve), t(e);
172
+ }
173
+ function jt(r) {
174
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
175
+ return { x: t.e, y: t.f };
176
+ }
177
+ function qt(r, e) {
178
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
179
+ return t.append("path").attr("class", "path").attr("d", function(n) {
180
+ var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
181
+ return jt(s);
182
+ });
183
+ return ot(a, i);
184
+ }), t.append("defs"), t;
185
+ }
186
+ function Qt(r, e) {
187
+ var t = r.exit();
188
+ _(t, e).style("opacity", 0).remove();
189
+ }
190
+ var F = function(r, e, t) {
191
+ var n = e.nodes().filter(function(i) {
192
+ return !nt(e, i);
193
+ }), a = r.selectAll("g.node").data(n, function(i) {
194
+ return i;
195
+ }).classed("update", !0);
196
+ a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
197
+ var o = e.node(i), c = x(this);
198
+ it(
199
+ c,
200
+ o.class,
201
+ (c.classed("update") ? "update " : "") + "node"
202
+ ), c.select("g.label").remove();
203
+ var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
204
+ o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") && (h.width = o.width), Object.prototype.hasOwnProperty.call(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
205
+ "transform",
206
+ "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
207
+ );
208
+ var u = x(this);
209
+ u.select(".label-container").remove();
210
+ var f = y(u, h, o).classed("label-container", !0);
211
+ T(f, o.style);
212
+ var g = f.node().getBBox();
213
+ o.width = g.width, o.height = g.height;
214
+ });
215
+ var s;
216
+ return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
217
+ };
218
+ function Kt(r) {
219
+ F = r;
220
+ }
221
+ function Jt(r, e) {
222
+ var t = r.filter(function() {
223
+ return !x(this).classed("update");
224
+ });
225
+ function n(a) {
226
+ var s = e.node(a);
227
+ return "translate(" + s.x + "," + s.y + ")";
228
+ }
229
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
230
+ return e.node(a).width;
231
+ }).attr("height", function(a) {
232
+ return e.node(a).height;
233
+ }).attr("x", function(a) {
234
+ var s = e.node(a);
235
+ return -s.width / 2;
236
+ }).attr("y", function(a) {
237
+ var s = e.node(a);
238
+ return -s.height / 2;
239
+ });
240
+ }
241
+ function Zt(r, e) {
242
+ var t = r.filter(function() {
243
+ return !x(this).classed("update");
244
+ });
245
+ function n(a) {
246
+ var s = e.edge(a);
247
+ return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
248
+ }
249
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
250
+ }
251
+ function te(r, e) {
252
+ var t = r.filter(function() {
253
+ return !x(this).classed("update");
254
+ });
255
+ function n(a) {
256
+ var s = e.node(a);
257
+ return "translate(" + s.x + "," + s.y + ")";
258
+ }
259
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
260
+ }
261
+ function lt(r, e, t, n) {
262
+ var a = r.x, s = r.y, i = a - n.x, o = s - n.y, c = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / c);
263
+ n.x < a && (d = -d);
264
+ var l = Math.abs(e * t * o / c);
265
+ return n.y < s && (l = -l), { x: a + d, y: s + l };
266
+ }
267
+ function ee(r, e, t) {
268
+ return lt(r, e, e, t);
269
+ }
270
+ function re(r, e, t, n) {
271
+ var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
272
+ if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && J(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, y = s * e.x + o * e.y + d, !(l !== 0 && y !== 0 && J(l, y)) && (f = a * o - s * i, f !== 0)))
273
+ return g = Math.abs(f / 2), p = i * d - o * c, v = p < 0 ? (p - g) / f : (p + g) / f, p = s * c - a * d, k = p < 0 ? (p - g) / f : (p + g) / f, { x: v, y: k };
274
+ }
275
+ function J(r, e) {
276
+ return r * e > 0;
277
+ }
278
+ function E(r, e, t) {
279
+ var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
280
+ e.forEach(function(f) {
281
+ i = Math.min(i, f.x), o = Math.min(o, f.y);
282
+ });
283
+ for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
284
+ var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
285
+ r,
286
+ t,
287
+ { x: c + y.x, y: d + y.y },
288
+ { x: c + h.x, y: d + h.y }
289
+ );
290
+ u && s.push(u);
291
+ }
292
+ return s.length ? (s.length > 1 && s.sort(function(f, g) {
293
+ var p = f.x - t.x, v = f.y - t.y, k = Math.sqrt(p * p + v * v), P = g.x - t.x, L = g.y - t.y, O = Math.sqrt(P * P + L * L);
294
+ return k < O ? -1 : k === O ? 0 : 1;
295
+ }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
296
+ }
297
+ function Q(r, e) {
298
+ var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, c, d;
299
+ return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), c = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), c = i, d = a === 0 ? 0 : i * s / a), { x: t + c, y: n + d };
300
+ }
301
+ var j = {
302
+ rect: ne,
303
+ ellipse: se,
304
+ circle: ie,
305
+ diamond: oe
306
+ };
307
+ function ae(r) {
308
+ j = r;
309
+ }
310
+ function ne(r, e, t) {
311
+ var n = r.insert("rect", ":first-child").attr("rx", t.rx).attr("ry", t.ry).attr("x", -e.width / 2).attr("y", -e.height / 2).attr("width", e.width).attr("height", e.height);
312
+ return t.intersect = function(a) {
313
+ return Q(t, a);
314
+ }, n;
315
+ }
316
+ function se(r, e, t) {
317
+ var n = e.width / 2, a = e.height / 2, s = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", n).attr("ry", a);
318
+ return t.intersect = function(i) {
319
+ return lt(t, n, a, i);
320
+ }, s;
321
+ }
322
+ function ie(r, e, t) {
323
+ var n = Math.max(e.width, e.height) / 2, a = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", n);
324
+ return t.intersect = function(s) {
325
+ return ee(t, n, s);
326
+ }, a;
327
+ }
328
+ function oe(r, e, t) {
329
+ var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
330
+ { x: 0, y: -a },
331
+ { x: -n, y: 0 },
332
+ { x: 0, y: a },
333
+ { x: n, y: 0 }
334
+ ], i = r.insert("polygon", ":first-child").attr(
335
+ "points",
336
+ s.map(function(o) {
337
+ return o.x + "," + o.y;
338
+ }).join(" ")
339
+ );
340
+ return t.intersect = function(o) {
341
+ return E(t, s, o);
342
+ }, i;
343
+ }
344
+ function le() {
345
+ var r = function(e, t) {
346
+ he(t);
347
+ var n = B(e, "output"), a = B(n, "clusters"), s = B(n, "edgePaths"), i = H(B(n, "edgeLabels"), t), o = F(B(n, "nodes"), t, j);
348
+ Et(t), te(o, t), Zt(i, t), X(s, t, z);
349
+ var c = Y(a, t);
350
+ Jt(c, t), ue(t);
351
+ };
352
+ return r.createNodes = function(e) {
353
+ return arguments.length ? (Kt(e), r) : F;
354
+ }, r.createClusters = function(e) {
355
+ return arguments.length ? (zt(e), r) : Y;
356
+ }, r.createEdgeLabels = function(e) {
357
+ return arguments.length ? (Yt(e), r) : H;
358
+ }, r.createEdgePaths = function(e) {
359
+ return arguments.length ? (Ht(e), r) : X;
360
+ }, r.shapes = function(e) {
361
+ return arguments.length ? (ae(e), r) : j;
362
+ }, r.arrows = function(e) {
363
+ return arguments.length ? (Rt(e), r) : z;
364
+ }, r;
365
+ }
366
+ var ce = {
367
+ paddingLeft: 10,
368
+ paddingRight: 10,
369
+ paddingTop: 10,
370
+ paddingBottom: 10,
371
+ rx: 0,
372
+ ry: 0,
373
+ shape: "rect"
374
+ }, de = {
375
+ arrowhead: "normal",
376
+ curve: G
377
+ };
378
+ function he(r) {
379
+ r.nodes().forEach((e) => {
380
+ const t = r.node(e);
381
+ !Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
382
+ paddingLeft: t.paddingX,
383
+ paddingRight: t.paddingX
384
+ }), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
385
+ paddingTop: t.paddingY,
386
+ paddingBottom: t.paddingY
387
+ }), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
388
+ paddingLeft: t.padding,
389
+ paddingRight: t.padding,
390
+ paddingTop: t.padding,
391
+ paddingBottom: t.padding
392
+ }), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
393
+ t[n] = Number(t[n]);
394
+ }), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
395
+ }), r.edges().forEach(function(e) {
396
+ var t = r.edge(e);
397
+ Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
398
+ });
399
+ }
400
+ function ue(r) {
401
+ r.nodes().forEach((e) => {
402
+ var t = r.node(e);
403
+ Object.prototype.hasOwnProperty.call(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, Object.prototype.hasOwnProperty.call(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
404
+ });
405
+ }
406
+ function B(r, e) {
407
+ var t = r.select("g." + e);
408
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
409
+ }
410
+ function ct(r, e, t) {
411
+ const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
412
+ { x: s / 2, y: 0 },
413
+ { x: s, y: -s / 2 },
414
+ { x: s / 2, y: -s },
415
+ { x: 0, y: -s / 2 }
416
+ ], o = N(r, s, s, i);
417
+ return t.intersect = function(c) {
418
+ return E(t, i, c);
419
+ }, o;
420
+ }
421
+ function dt(r, e, t) {
422
+ const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
423
+ { x: s, y: 0 },
424
+ { x: i - s, y: 0 },
425
+ { x: i, y: -a / 2 },
426
+ { x: i - s, y: -a },
427
+ { x: s, y: -a },
428
+ { x: 0, y: -a / 2 }
429
+ ], c = N(r, i, a, o);
430
+ return t.intersect = function(d) {
431
+ return E(t, o, d);
432
+ }, c;
433
+ }
434
+ function ht(r, e, t) {
435
+ const n = e.width, a = e.height, s = [
436
+ { x: -a / 2, y: 0 },
437
+ { x: n, y: 0 },
438
+ { x: n, y: -a },
439
+ { x: -a / 2, y: -a },
440
+ { x: 0, y: -a / 2 }
441
+ ], i = N(r, n, a, s);
442
+ return t.intersect = function(o) {
443
+ return E(t, s, o);
444
+ }, i;
445
+ }
446
+ function ut(r, e, t) {
447
+ const n = e.width, a = e.height, s = [
448
+ { x: -2 * a / 6, y: 0 },
449
+ { x: n - a / 6, y: 0 },
450
+ { x: n + 2 * a / 6, y: -a },
451
+ { x: a / 6, y: -a }
452
+ ], i = N(r, n, a, s);
453
+ return t.intersect = function(o) {
454
+ return E(t, s, o);
455
+ }, i;
456
+ }
457
+ function pt(r, e, t) {
458
+ const n = e.width, a = e.height, s = [
459
+ { x: 2 * a / 6, y: 0 },
460
+ { x: n + a / 6, y: 0 },
461
+ { x: n - 2 * a / 6, y: -a },
462
+ { x: -a / 6, y: -a }
463
+ ], i = N(r, n, a, s);
464
+ return t.intersect = function(o) {
465
+ return E(t, s, o);
466
+ }, i;
467
+ }
468
+ function ft(r, e, t) {
469
+ const n = e.width, a = e.height, s = [
470
+ { x: -2 * a / 6, y: 0 },
471
+ { x: n + 2 * a / 6, y: 0 },
472
+ { x: n - a / 6, y: -a },
473
+ { x: a / 6, y: -a }
474
+ ], i = N(r, n, a, s);
475
+ return t.intersect = function(o) {
476
+ return E(t, s, o);
477
+ }, i;
478
+ }
479
+ function yt(r, e, t) {
480
+ const n = e.width, a = e.height, s = [
481
+ { x: a / 6, y: 0 },
482
+ { x: n - a / 6, y: 0 },
483
+ { x: n + 2 * a / 6, y: -a },
484
+ { x: -2 * a / 6, y: -a }
485
+ ], i = N(r, n, a, s);
486
+ return t.intersect = function(o) {
487
+ return E(t, s, o);
488
+ }, i;
489
+ }
490
+ function vt(r, e, t) {
491
+ const n = e.width, a = e.height, s = [
492
+ { x: 0, y: 0 },
493
+ { x: n + a / 2, y: 0 },
494
+ { x: n, y: -a / 2 },
495
+ { x: n + a / 2, y: -a },
496
+ { x: 0, y: -a }
497
+ ], i = N(r, n, a, s);
498
+ return t.intersect = function(o) {
499
+ return E(t, s, o);
500
+ }, i;
501
+ }
502
+ function gt(r, e, t) {
503
+ const n = e.height, a = e.width + n / 4, s = r.insert("rect", ":first-child").attr("rx", n / 2).attr("ry", n / 2).attr("x", -a / 2).attr("y", -n / 2).attr("width", a).attr("height", n);
504
+ return t.intersect = function(i) {
505
+ return Q(t, i);
506
+ }, s;
507
+ }
508
+ function wt(r, e, t) {
509
+ const n = e.width, a = e.height, s = [
510
+ { x: 0, y: 0 },
511
+ { x: n, y: 0 },
512
+ { x: n, y: -a },
513
+ { x: 0, y: -a },
514
+ { x: 0, y: 0 },
515
+ { x: -8, y: 0 },
516
+ { x: n + 8, y: 0 },
517
+ { x: n + 8, y: -a },
518
+ { x: -8, y: -a },
519
+ { x: -8, y: 0 }
520
+ ], i = N(r, n, a, s);
521
+ return t.intersect = function(o) {
522
+ return E(t, s, o);
523
+ }, i;
524
+ }
525
+ function mt(r, e, t) {
526
+ const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
527
+ return t.intersect = function(d) {
528
+ const l = Q(t, d), y = l.x - t.x;
529
+ if (a != 0 && (Math.abs(y) < t.width / 2 || Math.abs(y) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
530
+ let h = s * s * (1 - y * y / (a * a));
531
+ h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
532
+ }
533
+ return l;
534
+ }, c;
535
+ }
536
+ function pe(r) {
537
+ r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = mt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = pt, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = vt;
538
+ }
539
+ function fe(r) {
540
+ r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: mt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: pt }), r({ trapezoid: ft }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: vt });
541
+ }
542
+ function N(r, e, t, n) {
543
+ return r.insert("polygon", ":first-child").attr(
544
+ "points",
545
+ n.map(function(a) {
546
+ return a.x + "," + a.y;
547
+ }).join(" ")
548
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
549
+ }
550
+ const ye = {
551
+ addToRender: pe,
552
+ addToRenderV2: fe
553
+ }, xt = {}, ve = function(r) {
554
+ const e = Object.keys(r);
555
+ for (const t of e)
556
+ xt[t] = r[t];
557
+ }, bt = async function(r, e, t, n, a, s) {
558
+ const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
559
+ for (const d of c) {
560
+ const l = r[d];
561
+ let y = "default";
562
+ l.classes.length > 0 && (y = l.classes.join(" "));
563
+ const h = V(l.styles);
564
+ let u = l.text !== void 0 ? l.text : l.id, f;
565
+ if (Z(D().flowchart.htmlLabels)) {
566
+ const v = {
567
+ label: await tt(
568
+ u.replace(
569
+ /fa[blrs]?:fa-[\w-]+/g,
570
+ // cspell:disable-line
571
+ (k) => `<i class='${k.replace(":", " ")}'></i>`
572
+ ),
573
+ D()
574
+ )
575
+ };
576
+ f = at(i, v).node(), f.parentNode.removeChild(f);
577
+ } else {
578
+ const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
579
+ v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
580
+ const k = u.split(et.lineBreakRegex);
581
+ for (const P of k) {
582
+ const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
583
+ L.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), L.setAttribute("dy", "1em"), L.setAttribute("x", "1"), L.textContent = P, v.appendChild(L);
584
+ }
585
+ f = v;
586
+ }
587
+ let g = 0, p = "";
588
+ switch (l.type) {
589
+ case "round":
590
+ g = 5, p = "rect";
591
+ break;
592
+ case "square":
593
+ p = "rect";
594
+ break;
595
+ case "diamond":
596
+ p = "question";
597
+ break;
598
+ case "hexagon":
599
+ p = "hexagon";
600
+ break;
601
+ case "odd":
602
+ p = "rect_left_inv_arrow";
603
+ break;
604
+ case "lean_right":
605
+ p = "lean_right";
606
+ break;
607
+ case "lean_left":
608
+ p = "lean_left";
609
+ break;
610
+ case "trapezoid":
611
+ p = "trapezoid";
612
+ break;
613
+ case "inv_trapezoid":
614
+ p = "inv_trapezoid";
615
+ break;
616
+ case "odd_right":
617
+ p = "rect_left_inv_arrow";
618
+ break;
619
+ case "circle":
620
+ p = "circle";
621
+ break;
622
+ case "ellipse":
623
+ p = "ellipse";
624
+ break;
625
+ case "stadium":
626
+ p = "stadium";
627
+ break;
628
+ case "subroutine":
629
+ p = "subroutine";
630
+ break;
631
+ case "cylinder":
632
+ p = "cylinder";
633
+ break;
634
+ case "group":
635
+ p = "rect";
636
+ break;
637
+ default:
638
+ p = "rect";
639
+ }
640
+ M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
641
+ labelType: "svg",
642
+ labelStyle: h.labelStyle,
643
+ shape: p,
644
+ label: f,
645
+ rx: g,
646
+ ry: g,
647
+ class: y,
648
+ style: h.style,
649
+ id: s.db.lookUpDomId(l.id)
650
+ });
651
+ }
652
+ }, kt = async function(r, e, t) {
653
+ let n = 0, a, s;
654
+ if (r.defaultStyle !== void 0) {
655
+ const i = V(r.defaultStyle);
656
+ a = i.style, s = i.labelStyle;
657
+ }
658
+ for (const i of r) {
659
+ n++;
660
+ const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
661
+ i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
662
+ let y = "", h = "";
663
+ if (i.style !== void 0) {
664
+ const u = V(i.style);
665
+ y = u.style, h = u.labelStyle;
666
+ } else
667
+ switch (i.stroke) {
668
+ case "normal":
669
+ y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
670
+ break;
671
+ case "dotted":
672
+ y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
673
+ break;
674
+ case "thick":
675
+ y = " stroke-width: 3.5px;fill:none";
676
+ break;
677
+ }
678
+ l.style = y, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = W(i.interpolate, G) : r.defaultInterpolate !== void 0 ? l.curve = W(r.defaultInterpolate, G) : l.curve = W(xt.curve, G), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Z(D().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
679
+ i.text.replace(
680
+ /fa[blrs]?:fa-[\w-]+/g,
681
+ // cspell:disable-line
682
+ (u) => `<i class='${u.replace(":", " ")}'></i>`
683
+ ),
684
+ D()
685
+ )}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
686
+ `), i.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
687
+ }
688
+ }, ge = function(r, e) {
689
+ return M.info("Extracting classes"), e.db.getClasses();
690
+ }, we = async function(r, e, t, n) {
691
+ M.info("Drawing flowchart");
692
+ const { securityLevel: a, flowchart: s } = D();
693
+ let i;
694
+ a === "sandbox" && (i = x("#i" + e));
695
+ const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
696
+ let d = n.db.getDirection();
697
+ d === void 0 && (d = "TD");
698
+ const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
699
+ multigraph: !0,
700
+ compound: !0
701
+ }).setGraph({
702
+ rankdir: d,
703
+ nodesep: l,
704
+ ranksep: y,
705
+ marginx: 8,
706
+ marginy: 8
707
+ }).setDefaultEdgeLabel(function() {
708
+ return {};
709
+ });
710
+ let u;
711
+ const f = n.db.getSubGraphs();
712
+ for (let w = f.length - 1; w >= 0; w--)
713
+ u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
714
+ const g = n.db.getVertices();
715
+ M.warn("Get vertices", g);
716
+ const p = n.db.getEdges();
717
+ let v = 0;
718
+ for (v = f.length - 1; v >= 0; v--) {
719
+ u = f[v], Pt("cluster").append("text");
720
+ for (let w = 0; w < u.nodes.length; w++)
721
+ M.warn(
722
+ "Setting subgraph",
723
+ u.nodes[w],
724
+ n.db.lookUpDomId(u.nodes[w]),
725
+ n.db.lookUpDomId(u.id)
726
+ ), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
727
+ }
728
+ await bt(g, h, e, o, c, n), await kt(p, h, n);
729
+ const k = new le();
730
+ ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
731
+ const A = b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
732
+ T(A, m[C + "Style"]);
733
+ }, k.arrows().normal = function(b, S) {
734
+ b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
735
+ };
736
+ const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
737
+ for (k(L, h), L.selectAll("g.node").attr("title", function() {
738
+ return n.db.getTooltip(this.id);
739
+ }), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
740
+ if (u = f[v], u.title !== "undefined") {
741
+ const w = c.querySelectorAll(
742
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
743
+ ), b = c.querySelectorAll(
744
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
745
+ ), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
746
+ A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
747
+ for (let U = 0; U < u.classes.length; U++)
748
+ b[0].classList.add(u.classes[U]);
749
+ }
750
+ if (!s.htmlLabels) {
751
+ const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
752
+ for (const b of w) {
753
+ const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
754
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
755
+ }
756
+ }
757
+ Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
758
+ const b = g[w];
759
+ if (b.link) {
760
+ const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
761
+ if (S) {
762
+ const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
763
+ m.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
764
+ const C = S.insert(function() {
765
+ return m;
766
+ }, ":first-child"), R = S.select(".label-container");
767
+ R && C.append(function() {
768
+ return R.node();
769
+ });
770
+ const A = S.select(".label");
771
+ A && C.append(function() {
772
+ return A.node();
773
+ });
774
+ }
775
+ }
776
+ });
777
+ }, me = {
778
+ setConf: ve,
779
+ addVertices: bt,
780
+ addEdges: kt,
781
+ getClasses: ge,
782
+ draw: we
783
+ }, Ce = {
784
+ parser: St,
785
+ db: $,
786
+ renderer: At,
787
+ styles: Nt,
788
+ init: (r) => {
789
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
790
+ }
791
+ };
792
+ export {
793
+ Ce as diagram
794
+ };