@layers-app/editor 0.7.16 → 0.7.18

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 +1 -77
  3. package/dist/index.js +9 -15
  4. package/dist/layers.94hwidA2.js +198 -0
  5. package/dist/layers.B4l6ta1Q.js +1 -0
  6. package/dist/layers.BMrOAD_P.js +1 -0
  7. package/dist/{layers.CfISeAkt.js → layers.D99OBX9u.js} +86 -88
  8. package/dist/layers.DOzLBYZr.js +304 -0
  9. package/dist/layers.YRyXopy_.js +151 -0
  10. package/dist/layers.usKC_Id5.js +1 -0
  11. package/dist/layers.zu-IYGYU.js +47463 -0
  12. package/package.json +1 -1
  13. package/dist/layers.-fM6L_z3.js +0 -1
  14. package/dist/layers.0KANPDnB.js +0 -9
  15. package/dist/layers.1Nv-nANB.js +0 -271
  16. package/dist/layers.1bdyQGVP.js +0 -8
  17. package/dist/layers.49H_5LNr.js +0 -41
  18. package/dist/layers.4HZb3jXk.js +0 -9
  19. package/dist/layers.4RmaHEsu.js +0 -36
  20. package/dist/layers.52famHy6.js +0 -1
  21. package/dist/layers.5WzirB7G.js +0 -960
  22. package/dist/layers.5bSjIKfg.js +0 -8
  23. package/dist/layers.7JqFgE4-.js +0 -15
  24. package/dist/layers.7oLFJZ8l.js +0 -36
  25. package/dist/layers.7xkZRnuM.js +0 -40
  26. package/dist/layers.9pNaFvaX.js +0 -1
  27. package/dist/layers.ABhWEnmQ.js +0 -37
  28. package/dist/layers.B-8gEV_E.js +0 -373
  29. package/dist/layers.B-9QQMGw.js +0 -9
  30. package/dist/layers.B0sBopW9.js +0 -10
  31. package/dist/layers.B19hGmey.js +0 -1
  32. package/dist/layers.B1ySJNCM.js +0 -40
  33. package/dist/layers.B2BhJZ0D.js +0 -42
  34. package/dist/layers.B2iVWMcm.js +0 -9
  35. package/dist/layers.B3D4g2HH.js +0 -1
  36. package/dist/layers.B6Va7v9s.js +0 -207
  37. package/dist/layers.B7K7JjK6.js +0 -1510
  38. package/dist/layers.B82wcYq0.js +0 -271
  39. package/dist/layers.BAU0IeY7.js +0 -1
  40. package/dist/layers.BAtv1CM7.js +0 -1
  41. package/dist/layers.BCD7sjs8.js +0 -1
  42. package/dist/layers.BEUJQJGq.js +0 -35
  43. package/dist/layers.BGDCJs-p.js +0 -1
  44. package/dist/layers.BHz2k1im.js +0 -7
  45. package/dist/layers.BIM8NeWS.js +0 -40
  46. package/dist/layers.BIbdMSbX.js +0 -772
  47. package/dist/layers.BIeVwYKL.js +0 -1
  48. package/dist/layers.BJDrjORS.js +0 -244
  49. package/dist/layers.BJhjIY5r.js +0 -37
  50. package/dist/layers.BJmaj5SY.js +0 -39
  51. package/dist/layers.BKy18lBk.js +0 -10
  52. package/dist/layers.BL3wEq7M.js +0 -32
  53. package/dist/layers.BLKD1Tiy.js +0 -39
  54. package/dist/layers.BLd2spTm.js +0 -1
  55. package/dist/layers.BNR6f37h.js +0 -160
  56. package/dist/layers.BNkwxNgt.js +0 -39
  57. package/dist/layers.BOMC5c1j.js +0 -2
  58. package/dist/layers.BQL01Vq6.js +0 -4
  59. package/dist/layers.BQm21WlP.js +0 -4
  60. package/dist/layers.BRGRJfuK.js +0 -41
  61. package/dist/layers.BSTBZrFn.js +0 -1
  62. package/dist/layers.BXDV2XaW.js +0 -425
  63. package/dist/layers.B_Vwa8Hx.js +0 -42
  64. package/dist/layers.B_jUVHTe.js +0 -32
  65. package/dist/layers.BakV9gnD.js +0 -42
  66. package/dist/layers.BbCfEXyj.js +0 -55
  67. package/dist/layers.BbbyE_Pc.js +0 -9
  68. package/dist/layers.Bd6ptC9U.js +0 -84
  69. package/dist/layers.BeCuix4V.js +0 -10
  70. package/dist/layers.BeFEsW5q.js +0 -1
  71. package/dist/layers.BfVGjstp.js +0 -42
  72. package/dist/layers.BgEbqAdb.js +0 -4
  73. package/dist/layers.Bk40urId.js +0 -1126
  74. package/dist/layers.Blc4R7F2.js +0 -41
  75. package/dist/layers.Bny7BWT9.js +0 -41
  76. package/dist/layers.BpilXLfW.js +0 -6
  77. package/dist/layers.Bpnbfq-r.js +0 -1
  78. package/dist/layers.BrbcqGdA.js +0 -48149
  79. package/dist/layers.BvGgfImM.js +0 -52
  80. package/dist/layers.BywviGiP.js +0 -11
  81. package/dist/layers.C-_ynqvr.js +0 -1
  82. package/dist/layers.C1actZbK.js +0 -11
  83. package/dist/layers.C3DRx9On.js +0 -10
  84. package/dist/layers.C3SAUwXb.js +0 -8
  85. package/dist/layers.C3yLkCio.js +0 -7
  86. package/dist/layers.C6fD5O8g.js +0 -6
  87. package/dist/layers.C8YD8pwl.js +0 -11
  88. package/dist/layers.C8_lu5UH.js +0 -23
  89. package/dist/layers.C92R-ENv.js +0 -39
  90. package/dist/layers.C9QCrDzm.js +0 -1
  91. package/dist/layers.C9_vX7IO.js +0 -139
  92. package/dist/layers.CA_fw2Dw.js +0 -32
  93. package/dist/layers.CB61rfHO.js +0 -1225
  94. package/dist/layers.CCur6VEj.js +0 -65
  95. package/dist/layers.CFLfRAu0.js +0 -14
  96. package/dist/layers.CFcHk-z5.js +0 -1268
  97. package/dist/layers.CFmNZSAJ.js +0 -1
  98. package/dist/layers.CGajZ1Yz.js +0 -42
  99. package/dist/layers.CHZsXQcr.js +0 -1
  100. package/dist/layers.CHhFVTiW.js +0 -10
  101. package/dist/layers.CJ1YRhUh.js +0 -6
  102. package/dist/layers.CJtE2LxP.js +0 -2482
  103. package/dist/layers.CJyO2xrs.js +0 -5
  104. package/dist/layers.CMyb9_FE.js +0 -40
  105. package/dist/layers.COjckA33.js +0 -10
  106. package/dist/layers.CPJSmpbw.js +0 -1
  107. package/dist/layers.CQvaw3yb.js +0 -5
  108. package/dist/layers.CRht5Nqq.js +0 -907
  109. package/dist/layers.CSXAHvGG.js +0 -33
  110. package/dist/layers.CTaitOnb.js +0 -11
  111. package/dist/layers.CV8UgwCq.js +0 -198
  112. package/dist/layers.CVJOismf.js +0 -6
  113. package/dist/layers.CXWtqfTe.js +0 -794
  114. package/dist/layers.CYPfnKfS.js +0 -96
  115. package/dist/layers.CYdP1IhC.js +0 -38
  116. package/dist/layers.CYneLciB.js +0 -1286
  117. package/dist/layers.CZLVHOh5.js +0 -8
  118. package/dist/layers.C_IvrzZ3.js +0 -7
  119. package/dist/layers.CbBTbZIx.js +0 -5
  120. package/dist/layers.CcP6Z-gZ.js +0 -118
  121. package/dist/layers.CcTyCqqv.js +0 -3
  122. package/dist/layers.Cd3kGFCJ.js +0 -32
  123. package/dist/layers.Ce7-wBOK.js +0 -11
  124. package/dist/layers.Cf5sVqJX.js +0 -39
  125. package/dist/layers.Cg3Hqyp6.js +0 -35
  126. package/dist/layers.Cg60w1Fn.js +0 -806
  127. package/dist/layers.Chd1p2rt.js +0 -26645
  128. package/dist/layers.CiTNX3uh.js +0 -32
  129. package/dist/layers.CkwenT1M.js +0 -8
  130. package/dist/layers.CnN8JfiX.js +0 -805
  131. package/dist/layers.Coh6z7rV.js +0 -8
  132. package/dist/layers.CpJSdiMb.js +0 -1
  133. package/dist/layers.CqVTtuYm.js +0 -6
  134. package/dist/layers.Cryqj610.js +0 -2238
  135. package/dist/layers.Cs-83js7.js +0 -1089
  136. package/dist/layers.CsivQuv1.js +0 -9
  137. package/dist/layers.Cud-IArB.js +0 -8
  138. package/dist/layers.CwL02t3J.js +0 -41
  139. package/dist/layers.CwsNJfmi.js +0 -10
  140. package/dist/layers.CxIhyFb7.js +0 -2966
  141. package/dist/layers.Cxh-oez0.js +0 -437
  142. package/dist/layers.Cyzu9PKQ.js +0 -1
  143. package/dist/layers.D-uio-rN.js +0 -423
  144. package/dist/layers.D0RX234F.js +0 -84
  145. package/dist/layers.D0zn4_Mx.js +0 -1
  146. package/dist/layers.D176Ljko.js +0 -116
  147. package/dist/layers.D2cVaX5z.js +0 -205
  148. package/dist/layers.D4Bw_BrO.js +0 -1
  149. package/dist/layers.D4T8fTcj.js +0 -1223
  150. package/dist/layers.D7jGxypv.js +0 -8
  151. package/dist/layers.D8fFj0P_.js +0 -34
  152. package/dist/layers.D9N3lSue.js +0 -7
  153. package/dist/layers.DAmxkO9p.js +0 -41
  154. package/dist/layers.DBwG7x-W.js +0 -8
  155. package/dist/layers.DDFbkCJT.js +0 -39
  156. package/dist/layers.DDnI7-13.js +0 -41
  157. package/dist/layers.DE6w34F3.js +0 -1
  158. package/dist/layers.DEaAvR_W.js +0 -189
  159. package/dist/layers.DEtMl_i3.js +0 -1034
  160. package/dist/layers.DHNIckw6.js +0 -39
  161. package/dist/layers.DHVcgZzL.js +0 -257
  162. package/dist/layers.DHcbExrH.js +0 -35
  163. package/dist/layers.DIpDvY-A.js +0 -40
  164. package/dist/layers.DJM_OF_R.js +0 -32
  165. package/dist/layers.DLJtS0JJ.js +0 -7
  166. package/dist/layers.DLwuMfdd.js +0 -84
  167. package/dist/layers.DMkBISW1.js +0 -1
  168. package/dist/layers.DN9HoVxI.js +0 -18
  169. package/dist/layers.DNJtYtN1.js +0 -9
  170. package/dist/layers.DOrgOHBr.js +0 -1
  171. package/dist/layers.DUlTmlus.js +0 -213
  172. package/dist/layers.DUutOP8h.js +0 -37
  173. package/dist/layers.DVWaIKgr.js +0 -21941
  174. package/dist/layers.D_WwW4Fn.js +0 -1
  175. package/dist/layers.D_fPGQ6i.js +0 -139
  176. package/dist/layers.D_faABvp.js +0 -21620
  177. package/dist/layers.DaIprEGs.js +0 -39
  178. package/dist/layers.Db0NyGA-.js +0 -1619
  179. package/dist/layers.DbaKVP5e.js +0 -1
  180. package/dist/layers.DdMy9cRx.js +0 -1088
  181. package/dist/layers.De35CioU.js +0 -44
  182. package/dist/layers.DgO3Q5mW.js +0 -4
  183. package/dist/layers.Di-PcJK6.js +0 -6
  184. package/dist/layers.DjCXWv2m.js +0 -38
  185. package/dist/layers.DjUOC4st.js +0 -16
  186. package/dist/layers.Dk2S8boy.js +0 -33
  187. package/dist/layers.DkBjWcDH.js +0 -504
  188. package/dist/layers.DnRaD217.js +0 -8583
  189. package/dist/layers.DnvnGxUC.js +0 -10
  190. package/dist/layers.DrarpmaN.js +0 -323
  191. package/dist/layers.DukGouVT.js +0 -39
  192. package/dist/layers.DvYYNhUp.js +0 -1
  193. package/dist/layers.Dv_6xN7s.js +0 -2
  194. package/dist/layers.DwWUZK6s.js +0 -129
  195. package/dist/layers.DwzO2zcv.js +0 -40
  196. package/dist/layers.DxA6ocdw.js +0 -70
  197. package/dist/layers.Dy1naDTQ.js +0 -14
  198. package/dist/layers.DzD-lWXV.js +0 -934
  199. package/dist/layers.E0TLXdrR.js +0 -40
  200. package/dist/layers.EcqLW9Mh.js +0 -1
  201. package/dist/layers.F4d4ILBH.js +0 -796
  202. package/dist/layers.G3enfHRT.js +0 -13
  203. package/dist/layers.HFONz6O9.js +0 -61
  204. package/dist/layers.IUqwmZRd.js +0 -122
  205. package/dist/layers.IbJq0D6U.js +0 -10
  206. package/dist/layers.Ic3KgoPg.js +0 -9
  207. package/dist/layers.JNgL8WWu.js +0 -10
  208. package/dist/layers.JWCLFILJ.js +0 -1
  209. package/dist/layers.KT-QFgdb.js +0 -7
  210. package/dist/layers.LCfVvo3T.js +0 -7
  211. package/dist/layers.LR-nMBU_.js +0 -1583
  212. package/dist/layers.Qt2qr0-t.js +0 -76
  213. package/dist/layers.R8mPlCA0.js +0 -261
  214. package/dist/layers.SCsPWeXb.js +0 -7
  215. package/dist/layers.U4NCf2-l.js +0 -70
  216. package/dist/layers.UewvnK33.js +0 -6
  217. package/dist/layers.VfVZmEbK.js +0 -8
  218. package/dist/layers.Vh-KvhZg.js +0 -1
  219. package/dist/layers.Y3D9xjCC.js +0 -9
  220. package/dist/layers.YT6D6D2x.js +0 -36
  221. package/dist/layers._y8hExIw.js +0 -223
  222. package/dist/layers.a8-4vDzD.js +0 -22
  223. package/dist/layers.aGzHUJ1W.js +0 -7
  224. package/dist/layers.b0h5ZBmD.js +0 -61
  225. package/dist/layers.b9B2NY7n.js +0 -11690
  226. package/dist/layers.ck9pUJ0W.js +0 -51
  227. package/dist/layers.d3HoUueQ.js +0 -2
  228. package/dist/layers.dWB4bggP.js +0 -1
  229. package/dist/layers.dh8xLSwh.js +0 -40
  230. package/dist/layers.eT_ZPmHS.js +0 -1
  231. package/dist/layers.fumrrA0i.js +0 -295
  232. package/dist/layers.gVfRcFrJ.js +0 -5
  233. package/dist/layers.js7-Kn9p.js +0 -36
  234. package/dist/layers.kW7XFPN_.js +0 -5
  235. package/dist/layers.lCpg7dOn.js +0 -21
  236. package/dist/layers.mobYTQXI.js +0 -1
  237. package/dist/layers.mvotlTNZ.js +0 -40
  238. package/dist/layers.n1dibO8I.js +0 -8
  239. package/dist/layers.nRPZ1e3g.js +0 -1
  240. package/dist/layers.o2u1uDM3.js +0 -1
  241. package/dist/layers.oJ31-KOl.js +0 -6
  242. package/dist/layers.ojcNGNgi.js +0 -1
  243. package/dist/layers.otxU0wtq.js +0 -40
  244. package/dist/layers.rE9xnPLC.js +0 -1
  245. package/dist/layers.s0KLXd5N.js +0 -41
  246. package/dist/layers.sqH5TpK8.js +0 -1
  247. package/dist/layers.t_MFWlU6.js +0 -9
  248. package/dist/layers.xrt74v23.js +0 -38
  249. package/dist/layers.zNb0110W.js +0 -37
@@ -1,437 +0,0 @@
1
- import { a8 as z, a9 as F, aa as j, a6 as U, l as g, g as S, d as $, u as H, Y as K, _ as A, $ as E, a0 as L, V, j as P, t as W } from "./layers.DnRaD217.js";
2
- import * as G from "lodash-es";
3
- import { G as X } from "./layers.BJDrjORS.js";
4
- import { r as Y } from "./layers.B-8gEV_E.js";
5
- import { c as J } from "./layers.CQvaw3yb.js";
6
- function Q(e) {
7
- return typeof e == "string" ? new z([document.querySelectorAll(e)], [document.documentElement]) : new z([j(e)], F);
8
- }
9
- function de(e, l) {
10
- return !!e.children(l).length;
11
- }
12
- function pe(e) {
13
- return N(e.v) + ":" + N(e.w) + ":" + N(e.name);
14
- }
15
- var Z = /:/g;
16
- function N(e) {
17
- return e ? String(e).replace(Z, "\\:") : "";
18
- }
19
- function O(e, l) {
20
- l && e.attr("style", l);
21
- }
22
- function be(e, l, c) {
23
- l && e.attr("class", l).attr("class", c + " " + e.attr("class"));
24
- }
25
- function fe(e, l) {
26
- var c = l.graph();
27
- if (G.isPlainObject(c)) {
28
- var a = c.transition;
29
- if (G.isFunction(a))
30
- return a(e);
31
- }
32
- return e;
33
- }
34
- function ee(e, l) {
35
- var c = e.append("foreignObject").attr("width", "100000"), a = c.append("xhtml:div");
36
- a.attr("xmlns", "http://www.w3.org/1999/xhtml");
37
- var i = l.label;
38
- switch (typeof i) {
39
- case "function":
40
- a.insert(i);
41
- break;
42
- case "object":
43
- a.insert(function() {
44
- return i;
45
- });
46
- break;
47
- default:
48
- a.html(i);
49
- }
50
- O(a, l.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap");
51
- var d = a.node().getBoundingClientRect();
52
- return c.attr("width", d.width).attr("height", d.height), c;
53
- }
54
- const q = {}, te = function(e) {
55
- const l = Object.keys(e);
56
- for (const c of l)
57
- q[c] = e[c];
58
- }, M = async function(e, l, c, a, i, d) {
59
- const u = a.select(`[id="${c}"]`), n = Object.keys(e);
60
- for (const p of n) {
61
- const r = e[p];
62
- let y = "default";
63
- r.classes.length > 0 && (y = r.classes.join(" ")), y = y + " flowchart-label";
64
- const w = A(r.styles);
65
- let t = r.text !== void 0 ? r.text : r.id, s;
66
- if (g.info("vertex", r, r.labelType), r.labelType === "markdown")
67
- g.info("vertex", r, r.labelType);
68
- else if (W(S().flowchart.htmlLabels))
69
- s = ee(u, {
70
- label: t
71
- }).node(), s.parentNode.removeChild(s);
72
- else {
73
- const k = i.createElementNS("http://www.w3.org/2000/svg", "text");
74
- k.setAttribute("style", w.labelStyle.replace("color:", "fill:"));
75
- const _ = t.split(P.lineBreakRegex);
76
- for (const C of _) {
77
- const v = i.createElementNS("http://www.w3.org/2000/svg", "tspan");
78
- v.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), v.setAttribute("dy", "1em"), v.setAttribute("x", "1"), v.textContent = C, k.appendChild(v);
79
- }
80
- s = k;
81
- }
82
- let b = 0, o = "";
83
- switch (r.type) {
84
- case "round":
85
- b = 5, o = "rect";
86
- break;
87
- case "square":
88
- o = "rect";
89
- break;
90
- case "diamond":
91
- o = "question";
92
- break;
93
- case "hexagon":
94
- o = "hexagon";
95
- break;
96
- case "odd":
97
- o = "rect_left_inv_arrow";
98
- break;
99
- case "lean_right":
100
- o = "lean_right";
101
- break;
102
- case "lean_left":
103
- o = "lean_left";
104
- break;
105
- case "trapezoid":
106
- o = "trapezoid";
107
- break;
108
- case "inv_trapezoid":
109
- o = "inv_trapezoid";
110
- break;
111
- case "odd_right":
112
- o = "rect_left_inv_arrow";
113
- break;
114
- case "circle":
115
- o = "circle";
116
- break;
117
- case "ellipse":
118
- o = "ellipse";
119
- break;
120
- case "stadium":
121
- o = "stadium";
122
- break;
123
- case "subroutine":
124
- o = "subroutine";
125
- break;
126
- case "cylinder":
127
- o = "cylinder";
128
- break;
129
- case "group":
130
- o = "rect";
131
- break;
132
- case "doublecircle":
133
- o = "doublecircle";
134
- break;
135
- default:
136
- o = "rect";
137
- }
138
- const T = await V(t, S());
139
- l.setNode(r.id, {
140
- labelStyle: w.labelStyle,
141
- shape: o,
142
- labelText: T,
143
- labelType: r.labelType,
144
- rx: b,
145
- ry: b,
146
- class: y,
147
- style: w.style,
148
- id: r.id,
149
- link: r.link,
150
- linkTarget: r.linkTarget,
151
- tooltip: d.db.getTooltip(r.id) || "",
152
- domId: d.db.lookUpDomId(r.id),
153
- haveCallback: r.haveCallback,
154
- width: r.type === "group" ? 500 : void 0,
155
- dir: r.dir,
156
- type: r.type,
157
- props: r.props,
158
- padding: S().flowchart.padding
159
- }), g.info("setNode", {
160
- labelStyle: w.labelStyle,
161
- labelType: r.labelType,
162
- shape: o,
163
- labelText: T,
164
- rx: b,
165
- ry: b,
166
- class: y,
167
- style: w.style,
168
- id: r.id,
169
- domId: d.db.lookUpDomId(r.id),
170
- width: r.type === "group" ? 500 : void 0,
171
- type: r.type,
172
- dir: r.dir,
173
- props: r.props,
174
- padding: S().flowchart.padding
175
- });
176
- }
177
- }, R = async function(e, l, c) {
178
- g.info("abc78 edges = ", e);
179
- let a = 0, i = {}, d, u;
180
- if (e.defaultStyle !== void 0) {
181
- const n = A(e.defaultStyle);
182
- d = n.style, u = n.labelStyle;
183
- }
184
- for (const n of e) {
185
- a++;
186
- const p = "L-" + n.start + "-" + n.end;
187
- i[p] === void 0 ? (i[p] = 0, g.info("abc78 new entry", p, i[p])) : (i[p]++, g.info("abc78 new entry", p, i[p]));
188
- let r = p + "-" + i[p];
189
- g.info("abc78 new link id to be used is", p, r, i[p]);
190
- const y = "LS-" + n.start, w = "LE-" + n.end, t = { style: "", labelStyle: "" };
191
- switch (t.minlen = n.length || 1, n.type === "arrow_open" ? t.arrowhead = "none" : t.arrowhead = "normal", t.arrowTypeStart = "arrow_open", t.arrowTypeEnd = "arrow_open", n.type) {
192
- case "double_arrow_cross":
193
- t.arrowTypeStart = "arrow_cross";
194
- case "arrow_cross":
195
- t.arrowTypeEnd = "arrow_cross";
196
- break;
197
- case "double_arrow_point":
198
- t.arrowTypeStart = "arrow_point";
199
- case "arrow_point":
200
- t.arrowTypeEnd = "arrow_point";
201
- break;
202
- case "double_arrow_circle":
203
- t.arrowTypeStart = "arrow_circle";
204
- case "arrow_circle":
205
- t.arrowTypeEnd = "arrow_circle";
206
- break;
207
- }
208
- let s = "", b = "";
209
- switch (n.stroke) {
210
- case "normal":
211
- s = "fill:none;", d !== void 0 && (s = d), u !== void 0 && (b = u), t.thickness = "normal", t.pattern = "solid";
212
- break;
213
- case "dotted":
214
- t.thickness = "normal", t.pattern = "dotted", t.style = "fill:none;stroke-width:2px;stroke-dasharray:3;";
215
- break;
216
- case "thick":
217
- t.thickness = "thick", t.pattern = "solid", t.style = "stroke-width: 3.5px;fill:none;";
218
- break;
219
- case "invisible":
220
- t.thickness = "invisible", t.pattern = "solid", t.style = "stroke-width: 0;fill:none;";
221
- break;
222
- }
223
- if (n.style !== void 0) {
224
- const o = A(n.style);
225
- s = o.style, b = o.labelStyle;
226
- }
227
- t.style = t.style += s, t.labelStyle = t.labelStyle += b, n.interpolate !== void 0 ? t.curve = E(n.interpolate, L) : e.defaultInterpolate !== void 0 ? t.curve = E(e.defaultInterpolate, L) : t.curve = E(q.curve, L), n.text === void 0 ? n.style !== void 0 && (t.arrowheadStyle = "fill: #333") : (t.arrowheadStyle = "fill: #333", t.labelpos = "c"), t.labelType = n.labelType, t.label = await V(
228
- n.text.replace(P.lineBreakRegex, `
229
- `),
230
- S()
231
- ), n.style === void 0 && (t.style = t.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), t.labelStyle = t.labelStyle.replace("color:", "fill:"), t.id = r, t.classes = "flowchart-link " + y + " " + w, l.setEdge(n.start, n.end, t, a);
232
- }
233
- }, re = function(e, l) {
234
- return l.db.getClasses();
235
- }, le = async function(e, l, c, a) {
236
- g.info("Drawing flowchart");
237
- let i = a.db.getDirection();
238
- i === void 0 && (i = "TD");
239
- const { securityLevel: d, flowchart: u } = S(), n = u.nodeSpacing || 50, p = u.rankSpacing || 50;
240
- let r;
241
- d === "sandbox" && (r = $("#i" + l));
242
- const y = d === "sandbox" ? $(r.nodes()[0].contentDocument.body) : $("body"), w = d === "sandbox" ? r.nodes()[0].contentDocument : document, t = new X({
243
- multigraph: !0,
244
- compound: !0
245
- }).setGraph({
246
- rankdir: i,
247
- nodesep: n,
248
- ranksep: p,
249
- marginx: 0,
250
- marginy: 0
251
- }).setDefaultEdgeLabel(function() {
252
- return {};
253
- });
254
- let s;
255
- const b = a.db.getSubGraphs();
256
- g.info("Subgraphs - ", b);
257
- for (let f = b.length - 1; f >= 0; f--)
258
- s = b[f], g.info("Subgraph - ", s), a.db.addVertex(
259
- s.id,
260
- { text: s.title, type: s.labelType },
261
- "group",
262
- void 0,
263
- s.classes,
264
- s.dir
265
- );
266
- const o = a.db.getVertices(), T = a.db.getEdges();
267
- g.info("Edges", T);
268
- let k = 0;
269
- for (k = b.length - 1; k >= 0; k--) {
270
- s = b[k], Q("cluster").append("text");
271
- for (let f = 0; f < s.nodes.length; f++)
272
- g.info("Setting up subgraphs", s.nodes[f], s.id), t.setParent(s.nodes[f], s.id);
273
- }
274
- await M(o, t, l, y, w, a), await R(T, t);
275
- const _ = y.select(`[id="${l}"]`), C = y.select("#" + l + " g");
276
- if (await Y(C, t, ["point", "circle", "cross"], "flowchart", l), H.insertTitle(_, "flowchartTitleText", u.titleTopMargin, a.db.getDiagramTitle()), K(t, _, u.diagramPadding, u.useMaxWidth), a.db.indexNodes("subGraph" + k), !u.htmlLabels) {
277
- const f = w.querySelectorAll('[id="' + l + '"] .edgeLabel .label');
278
- for (const x of f) {
279
- const m = x.getBBox(), h = w.createElementNS("http://www.w3.org/2000/svg", "rect");
280
- h.setAttribute("rx", 0), h.setAttribute("ry", 0), h.setAttribute("width", m.width), h.setAttribute("height", m.height), x.insertBefore(h, x.firstChild);
281
- }
282
- }
283
- Object.keys(o).forEach(function(f) {
284
- const x = o[f];
285
- if (x.link) {
286
- const m = $("#" + l + ' [id="' + f + '"]');
287
- if (m) {
288
- const h = w.createElementNS("http://www.w3.org/2000/svg", "a");
289
- h.setAttributeNS("http://www.w3.org/2000/svg", "class", x.classes.join(" ")), h.setAttributeNS("http://www.w3.org/2000/svg", "href", x.link), h.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), d === "sandbox" ? h.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : x.linkTarget && h.setAttributeNS("http://www.w3.org/2000/svg", "target", x.linkTarget);
290
- const B = m.insert(function() {
291
- return h;
292
- }, ":first-child"), I = m.select(".label-container");
293
- I && B.append(function() {
294
- return I.node();
295
- });
296
- const D = m.select(".label");
297
- D && B.append(function() {
298
- return D.node();
299
- });
300
- }
301
- }
302
- });
303
- }, ue = {
304
- setConf: te,
305
- addVertices: M,
306
- addEdges: R,
307
- getClasses: re,
308
- draw: le
309
- }, ae = (e, l) => {
310
- const c = J, a = c(e, "r"), i = c(e, "g"), d = c(e, "b");
311
- return U(a, i, d, l);
312
- }, oe = (e) => `.label {
313
- font-family: ${e.fontFamily};
314
- color: ${e.nodeTextColor || e.textColor};
315
- }
316
- .cluster-label text {
317
- fill: ${e.titleColor};
318
- }
319
- .cluster-label span,p {
320
- color: ${e.titleColor};
321
- }
322
-
323
- .label text,span,p {
324
- fill: ${e.nodeTextColor || e.textColor};
325
- color: ${e.nodeTextColor || e.textColor};
326
- }
327
-
328
- .node rect,
329
- .node circle,
330
- .node ellipse,
331
- .node polygon,
332
- .node path {
333
- fill: ${e.mainBkg};
334
- stroke: ${e.nodeBorder};
335
- stroke-width: 1px;
336
- }
337
- .flowchart-label text {
338
- text-anchor: middle;
339
- }
340
- // .flowchart-label .text-outer-tspan {
341
- // text-anchor: middle;
342
- // }
343
- // .flowchart-label .text-inner-tspan {
344
- // text-anchor: start;
345
- // }
346
-
347
- .node .katex path {
348
- fill: #000;
349
- stroke: #000;
350
- stroke-width: 1px;
351
- }
352
-
353
- .node .label {
354
- text-align: center;
355
- }
356
- .node.clickable {
357
- cursor: pointer;
358
- }
359
-
360
- .arrowheadPath {
361
- fill: ${e.arrowheadColor};
362
- }
363
-
364
- .edgePath .path {
365
- stroke: ${e.lineColor};
366
- stroke-width: 2.0px;
367
- }
368
-
369
- .flowchart-link {
370
- stroke: ${e.lineColor};
371
- fill: none;
372
- }
373
-
374
- .edgeLabel {
375
- background-color: ${e.edgeLabelBackground};
376
- rect {
377
- opacity: 0.5;
378
- background-color: ${e.edgeLabelBackground};
379
- fill: ${e.edgeLabelBackground};
380
- }
381
- text-align: center;
382
- }
383
-
384
- /* For html labels only */
385
- .labelBkg {
386
- background-color: ${ae(e.edgeLabelBackground, 0.5)};
387
- // background-color:
388
- }
389
-
390
- .cluster rect {
391
- fill: ${e.clusterBkg};
392
- stroke: ${e.clusterBorder};
393
- stroke-width: 1px;
394
- }
395
-
396
- .cluster text {
397
- fill: ${e.titleColor};
398
- }
399
-
400
- .cluster span,p {
401
- color: ${e.titleColor};
402
- }
403
- /* .cluster div {
404
- color: ${e.titleColor};
405
- } */
406
-
407
- div.mermaidTooltip {
408
- position: absolute;
409
- text-align: center;
410
- max-width: 200px;
411
- padding: 2px;
412
- font-family: ${e.fontFamily};
413
- font-size: 12px;
414
- background: ${e.tertiaryColor};
415
- border: 1px solid ${e.border2};
416
- border-radius: 2px;
417
- pointer-events: none;
418
- z-index: 100;
419
- }
420
-
421
- .flowchartTitleText {
422
- text-anchor: middle;
423
- font-size: 18px;
424
- fill: ${e.textColor};
425
- }
426
- `, we = oe;
427
- export {
428
- ue as a,
429
- O as b,
430
- ee as c,
431
- fe as d,
432
- pe as e,
433
- we as f,
434
- be as g,
435
- de as i,
436
- Q as s
437
- };
@@ -1 +0,0 @@
1
- "use strict";const ae=require("lodash-es"),w=require("./layers.BLd2spTm.js");function te(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const i=te(ae);class oe{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return j(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&j(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,a=r._prev;a!==r;)n.push(JSON.stringify(a,ie)),a=a._prev;return"["+n.join(", ")+"]"}}function j(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ie(e,n){if(e!=="_next"&&e!=="_prev")return n}var de=i.constant(1);function fe(e,n){if(e.nodeCount()<=1)return[];var r=ce(e,n||de),a=ue(r.graph,r.buckets,r.zeroIdx);return i.flatten(i.map(a,function(t){return e.outEdges(t.v,t.w)}))}function ue(e,n,r){for(var a=[],t=n[n.length-1],d=n[0],o;e.nodeCount();){for(;o=d.dequeue();)x(e,n,r,o);for(;o=t.dequeue();)x(e,n,r,o);if(e.nodeCount()){for(var f=n.length-2;f>0;--f)if(o=n[f].dequeue(),o){a=a.concat(x(e,n,r,o,!0));break}}}return a}function x(e,n,r,a,t){var d=t?[]:void 0;return i.forEach(e.inEdges(a.v),function(o){var f=e.edge(o),u=e.node(o.v);t&&d.push({v:o.v,w:o.w}),u.out-=f,P(n,r,u)}),i.forEach(e.outEdges(a.v),function(o){var f=e.edge(o),u=o.w,c=e.node(u);c.in-=f,P(n,r,c)}),e.removeNode(a.v),d}function ce(e,n){var r=new w.Graph,a=0,t=0;i.forEach(e.nodes(),function(f){r.setNode(f,{v:f,in:0,out:0})}),i.forEach(e.edges(),function(f){var u=r.edge(f.v,f.w)||0,c=n(f),s=u+c;r.setEdge(f.v,f.w,s),t=Math.max(t,r.node(f.v).out+=c),a=Math.max(a,r.node(f.w).in+=c)});var d=i.range(t+a+3).map(function(){return new oe}),o=a+1;return i.forEach(r.nodes(),function(f){P(d,o,r.node(f))}),{graph:r,buckets:d,zeroIdx:o}}function P(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function se(e){var n=e.graph().acyclicer==="greedy"?fe(e,r(e)):he(e);i.forEach(n,function(a){var t=e.edge(a);e.removeEdge(a),t.forwardName=a.name,t.reversed=!0,e.setEdge(a.w,a.v,t,i.uniqueId("rev"))});function r(a){return function(t){return a.edge(t).weight}}}function he(e){var n=[],r={},a={};function t(d){Object.prototype.hasOwnProperty.call(a,d)||(a[d]=!0,r[d]=!0,i.forEach(e.outEdges(d),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):t(o.w)}),delete r[d])}return i.forEach(e.nodes(),t),n}function le(e){i.forEach(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var a=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,a)}})}function E(e,n,r,a){var t;do t=i.uniqueId(a);while(e.hasNode(t));return r.dummy=n,e.setNode(t,r),t}function ve(e){var n=new w.Graph().setGraph(e.graph());return i.forEach(e.nodes(),function(r){n.setNode(r,e.node(r))}),i.forEach(e.edges(),function(r){var a=n.edge(r.v,r.w)||{weight:0,minlen:1},t=e.edge(r);n.setEdge(r.v,r.w,{weight:a.weight+t.weight,minlen:Math.max(a.minlen,t.minlen)})}),n}function q(e){var n=new w.Graph({multigraph:e.isMultigraph()}).setGraph(e.graph());return i.forEach(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),i.forEach(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function S(e,n){var r=e.x,a=e.y,t=n.x-r,d=n.y-a,o=e.width/2,f=e.height/2;if(!t&&!d)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(d)*o>Math.abs(t)*f?(d<0&&(f=-f),u=f*t/d,c=f):(t<0&&(o=-o),u=o,c=o*d/t),{x:r+u,y:a+c}}function k(e){var n=i.map(i.range(U(e)+1),function(){return[]});return i.forEach(e.nodes(),function(r){var a=e.node(r),t=a.rank;i.isUndefined(t)||(n[t][a.order]=r)}),n}function pe(e){var n=i.min(i.map(e.nodes(),function(r){return e.node(r).rank}));i.forEach(e.nodes(),function(r){var a=e.node(r);i.has(a,"rank")&&(a.rank-=n)})}function me(e){var n=i.min(i.map(e.nodes(),function(d){return e.node(d).rank})),r=[];i.forEach(e.nodes(),function(d){var o=e.node(d).rank-n;r[o]||(r[o]=[]),r[o].push(d)});var a=0,t=e.graph().nodeRankFactor;i.forEach(r,function(d,o){i.isUndefined(d)&&o%t!==0?--a:a&&i.forEach(d,function(f){e.node(f).rank+=a})})}function M(e,n,r,a){var t={width:0,height:0};return arguments.length>=4&&(t.rank=r,t.order=a),E(e,"border",t,n)}function U(e){return i.max(i.map(e.nodes(),function(n){var r=e.node(n).rank;if(!i.isUndefined(r))return r}))}function we(e,n){var r={lhs:[],rhs:[]};return i.forEach(e,function(a){n(a)?r.lhs.push(a):r.rhs.push(a)}),r}function be(e,n){return n()}function Ee(e){function n(r){var a=e.children(r),t=e.node(r);if(a.length&&i.forEach(a,n),Object.prototype.hasOwnProperty.call(t,"minRank")){t.borderLeft=[],t.borderRight=[];for(var d=t.minRank,o=t.maxRank+1;d<o;++d)V(e,"borderLeft","_bl",r,t,d),V(e,"borderRight","_br",r,t,d)}}i.forEach(e.children(),n)}function V(e,n,r,a,t,d){var o={width:0,height:0,rank:d,borderType:n},f=t[n][d-1],u=E(e,"border",o,r);t[n][d]=u,e.setParent(u,a),f&&e.setEdge(f,u,{weight:1})}function ye(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&W(e)}function ge(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&ke(e),(n==="lr"||n==="rl")&&(xe(e),W(e))}function W(e){i.forEach(e.nodes(),function(n){B(e.node(n))}),i.forEach(e.edges(),function(n){B(e.edge(n))})}function B(e){var n=e.width;e.width=e.height,e.height=n}function ke(e){i.forEach(e.nodes(),function(n){O(e.node(n))}),i.forEach(e.edges(),function(n){var r=e.edge(n);i.forEach(r.points,O),Object.prototype.hasOwnProperty.call(r,"y")&&O(r)})}function O(e){e.y=-e.y}function xe(e){i.forEach(e.nodes(),function(n){N(e.node(n))}),i.forEach(e.edges(),function(n){var r=e.edge(n);i.forEach(r.points,N),Object.prototype.hasOwnProperty.call(r,"x")&&N(r)})}function N(e){var n=e.x;e.x=e.y,e.y=n}function Oe(e){e.graph().dummyChains=[],i.forEach(e.edges(),function(n){Ne(e,n)})}function Ne(e,n){var r=n.v,a=e.node(r).rank,t=n.w,d=e.node(t).rank,o=n.name,f=e.edge(n),u=f.labelRank;if(d!==a+1){e.removeEdge(n);var c=void 0,s,h;for(h=0,++a;a<d;++h,++a)f.points=[],c={width:0,height:0,edgeLabel:f,edgeObj:n,rank:a},s=E(e,"edge",c,"_d"),a===u&&(c.width=f.width,c.height=f.height,c.dummy="edge-label",c.labelpos=f.labelpos),e.setEdge(r,s,{weight:f.weight},o),h===0&&e.graph().dummyChains.push(s),r=s;e.setEdge(r,t,{weight:f.weight},o)}}function Le(e){i.forEach(e.graph().dummyChains,function(n){var r=e.node(n),a=r.edgeLabel,t;for(e.setEdge(r.edgeObj,a);r.dummy;)t=e.successors(n)[0],e.removeNode(n),a.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height),n=t,r=e.node(n)})}function _(e){var n={};function r(a){var t=e.node(a);if(Object.prototype.hasOwnProperty.call(n,a))return t.rank;n[a]=!0;var d=i.min(i.map(e.outEdges(a),function(o){return r(o.w)-e.edge(o).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),t.rank=d}i.forEach(e.sources(),r)}function g(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function $(e){var n=new w.Graph({directed:!1}),r=e.nodes()[0],a=e.nodeCount();n.setNode(r,{});for(var t,d;Ie(n,e)<a;)t=Pe(n,e),d=n.hasNode(t.v)?g(e,t):-g(e,t),_e(n,e,d);return n}function Ie(e,n){function r(a){i.forEach(n.nodeEdges(a),function(t){var d=t.v,o=a===d?t.w:d;!e.hasNode(o)&&!g(n,t)&&(e.setNode(o,{}),e.setEdge(a,o,{}),r(o))})}return i.forEach(e.nodes(),r),e.nodeCount()}function Pe(e,n){return i.minBy(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return g(n,r)})}function _e(e,n,r){i.forEach(e.nodes(),function(a){n.node(a).rank+=r})}i.constant(1);i.constant(1);function Re(){}Re.prototype=new Error;function z(e,n,r){i.isArray(n)||(n=[n]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),t=[],d={};return i.each(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);X(e,o,r==="post",d,a,t)}),t}function X(e,n,r,a,t,d){Object.prototype.hasOwnProperty.call(a,n)||(a[n]=!0,r||d.push(n),i.each(t(n),function(o){X(e,o,r,a,t,d)}),r&&d.push(n))}function Ce(e,n){return z(e,n,"post")}function Te(e,n){return z(e,n,"pre")}b.initLowLimValues=C;b.initCutValues=R;b.calcCutValue=H;b.leaveEdge=K;b.enterEdge=Q;b.exchangeEdges=Z;function b(e){e=ve(e),_(e);var n=$(e);C(n),R(n,e);for(var r,a;r=K(n);)a=Q(n,e,r),Z(n,e,r,a)}function R(e,n){var r=Ce(e,e.nodes());r=r.slice(0,r.length-1),i.forEach(r,function(a){je(e,n,a)})}function je(e,n,r){var a=e.node(r),t=a.parent;e.edge(r,t).cutvalue=H(e,n,r)}function H(e,n,r){var a=e.node(r),t=a.parent,d=!0,o=n.edge(r,t),f=0;return o||(d=!1,o=n.edge(t,r)),f=o.weight,i.forEach(n.nodeEdges(r),function(u){var c=u.v===r,s=c?u.w:u.v;if(s!==t){var h=c===d,l=n.edge(u).weight;if(f+=h?l:-l,Me(e,r,s)){var v=e.edge(r,s).cutvalue;f+=h?-v:v}}}),f}function C(e,n){arguments.length<2&&(n=e.nodes()[0]),J(e,{},1,n)}function J(e,n,r,a,t){var d=r,o=e.node(a);return n[a]=!0,i.forEach(e.neighbors(a),function(f){Object.prototype.hasOwnProperty.call(n,f)||(r=J(e,n,r,f,a))}),o.low=d,o.lim=r++,t?o.parent=t:delete o.parent,r}function K(e){return i.find(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Q(e,n,r){var a=r.v,t=r.w;n.hasEdge(a,t)||(a=r.w,t=r.v);var d=e.node(a),o=e.node(t),f=d,u=!1;d.lim>o.lim&&(f=o,u=!0);var c=i.filter(n.edges(),function(s){return u===F(e,e.node(s.v),f)&&u!==F(e,e.node(s.w),f)});return i.minBy(c,function(s){return g(n,s)})}function Z(e,n,r,a){var t=r.v,d=r.w;e.removeEdge(t,d),e.setEdge(a.v,a.w,{}),C(e),R(e,n),Se(e,n)}function Se(e,n){var r=i.find(e.nodes(),function(t){return!n.node(t).parent}),a=Te(e,r);a=a.slice(1),i.forEach(a,function(t){var d=e.node(t).parent,o=n.edge(t,d),f=!1;o||(o=n.edge(d,t),f=!0),n.node(t).rank=n.node(d).rank+(f?o.minlen:-o.minlen)})}function Me(e,n,r){return e.hasEdge(n,r)}function F(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ve(e){switch(e.graph().ranker){case"network-simplex":G(e);break;case"tight-tree":Fe(e);break;case"longest-path":Be(e);break;default:G(e)}}var Be=_;function Fe(e){_(e),$(e)}function G(e){b(e)}function Ge(e){var n=E(e,"root",{},"_root"),r=De(e),a=i.max(i.values(r))-1,t=2*a+1;e.graph().nestingRoot=n,i.forEach(e.edges(),function(o){e.edge(o).minlen*=t});var d=Ae(e)+1;i.forEach(e.children(),function(o){ee(e,n,t,d,a,r,o)}),e.graph().nodeRankFactor=t}function ee(e,n,r,a,t,d,o){var f=e.children(o);if(!f.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var u=M(e,"_bt"),c=M(e,"_bb"),s=e.node(o);e.setParent(u,o),s.borderTop=u,e.setParent(c,o),s.borderBottom=c,i.forEach(f,function(h){ee(e,n,r,a,t,d,h);var l=e.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,m=l.borderTop?a:2*a,y=v!==p?1:t-d[o]+1;e.setEdge(u,v,{weight:m,minlen:y,nestingEdge:!0}),e.setEdge(p,c,{weight:m,minlen:y,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,u,{weight:0,minlen:t+d[o]})}function De(e){var n={};function r(a,t){var d=e.children(a);d&&d.length&&i.forEach(d,function(o){r(o,t+1)}),n[a]=t}return i.forEach(e.children(),function(a){r(a,1)}),n}function Ae(e){return i.reduce(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Ye(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,i.forEach(e.edges(),function(r){var a=e.edge(r);a.nestingEdge&&e.removeEdge(r)})}function qe(e,n,r){var a={},t;i.forEach(r,function(d){for(var o=e.parent(d),f,u;o;){if(f=e.parent(o),f?(u=a[f],a[f]=o):(u=t,t=o),u&&u!==o){n.setEdge(u,o);return}o=f}})}function Ue(e,n,r){var a=We(e),t=new w.Graph({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(d){return e.node(d)});return i.forEach(e.nodes(),function(d){var o=e.node(d),f=e.parent(d);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(t.setNode(d),t.setParent(d,f||a),i.forEach(e[r](d),function(u){var c=u.v===d?u.w:u.v,s=t.edge(c,d),h=i.isUndefined(s)?0:s.weight;t.setEdge(c,d,{weight:e.edge(u).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&t.setNode(d,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),t}function We(e){for(var n;e.hasNode(n=i.uniqueId("_root")););return n}function $e(e,n){for(var r=0,a=1;a<n.length;++a)r+=ze(e,n[a-1],n[a]);return r}function ze(e,n,r){for(var a=i.zipObject(r,i.map(r,function(c,s){return s})),t=i.flatten(i.map(n,function(c){return i.sortBy(i.map(e.outEdges(c),function(s){return{pos:a[s.w],weight:e.edge(s).weight}}),"pos")})),d=1;d<r.length;)d<<=1;var o=2*d-1;d-=1;var f=i.map(new Array(o),function(){return 0}),u=0;return i.forEach(t.forEach(function(c){var s=c.pos+d;f[s]+=c.weight;for(var h=0;s>0;)s%2&&(h+=f[s+1]),s=s-1>>1,f[s]+=c.weight;u+=c.weight*h})),u}function Xe(e){var n={},r=i.filter(e.nodes(),function(f){return!e.children(f).length}),a=i.max(i.map(r,function(f){return e.node(f).rank})),t=i.map(i.range(a+1),function(){return[]});function d(f){if(!i.has(n,f)){n[f]=!0;var u=e.node(f);t[u.rank].push(f),i.forEach(e.successors(f),d)}}var o=i.sortBy(r,function(f){return e.node(f).rank});return i.forEach(o,d),t}function He(e,n){return i.map(n,function(r){var a=e.inEdges(r);if(a.length){var t=i.reduce(a,function(d,o){var f=e.edge(o),u=e.node(o.v);return{sum:d.sum+f.weight*u.order,weight:d.weight+f.weight}},{sum:0,weight:0});return{v:r,barycenter:t.sum/t.weight,weight:t.weight}}else return{v:r}})}function Je(e,n){var r={};i.forEach(e,function(t,d){var o=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:d};i.isUndefined(t.barycenter)||(o.barycenter=t.barycenter,o.weight=t.weight)}),i.forEach(n.edges(),function(t){var d=r[t.v],o=r[t.w];!i.isUndefined(d)&&!i.isUndefined(o)&&(o.indegree++,d.out.push(r[t.w]))});var a=i.filter(r,function(t){return!t.indegree});return Ke(a)}function Ke(e){var n=[];function r(d){return function(o){o.merged||(i.isUndefined(o.barycenter)||i.isUndefined(d.barycenter)||o.barycenter>=d.barycenter)&&Qe(d,o)}}function a(d){return function(o){o.in.push(d),--o.indegree===0&&e.push(o)}}for(;e.length;){var t=e.pop();n.push(t),i.forEach(t.in.reverse(),r(t)),i.forEach(t.out,a(t))}return i.map(i.filter(n,function(d){return!d.merged}),function(d){return i.pick(d,["vs","i","barycenter","weight"])})}function Qe(e,n){var r=0,a=0;e.weight&&(r+=e.barycenter*e.weight,a+=e.weight),n.weight&&(r+=n.barycenter*n.weight,a+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/a,e.weight=a,e.i=Math.min(n.i,e.i),n.merged=!0}function Ze(e,n){var r=we(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),a=r.lhs,t=i.sortBy(r.rhs,function(s){return-s.i}),d=[],o=0,f=0,u=0;a.sort(en(!!n)),u=D(d,t,u),i.forEach(a,function(s){u+=s.vs.length,d.push(s.vs),o+=s.barycenter*s.weight,f+=s.weight,u=D(d,t,u)});var c={vs:i.flatten(d)};return f&&(c.barycenter=o/f,c.weight=f),c}function D(e,n,r){for(var a;n.length&&(a=i.last(n)).i<=r;)n.pop(),e.push(a.vs),r++;return r}function en(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function ne(e,n,r,a){var t=e.children(n),d=e.node(n),o=d?d.borderLeft:void 0,f=d?d.borderRight:void 0,u={};o&&(t=i.filter(t,function(p){return p!==o&&p!==f}));var c=He(e,t);i.forEach(c,function(p){if(e.children(p.v).length){var m=ne(e,p.v,r,a);u[p.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&rn(p,m)}});var s=Je(c,r);nn(s,u);var h=Ze(s,a);if(o&&(h.vs=i.flatten([o,h.vs,f]),e.predecessors(o).length)){var l=e.node(e.predecessors(o)[0]),v=e.node(e.predecessors(f)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h}function nn(e,n){i.forEach(e,function(r){r.vs=i.flatten(r.vs.map(function(a){return n[a]?n[a].vs:a}))})}function rn(e,n){i.isUndefined(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function an(e){var n=U(e),r=A(e,i.range(1,n+1),"inEdges"),a=A(e,i.range(n-1,-1,-1),"outEdges"),t=Xe(e);Y(e,t);for(var d=Number.POSITIVE_INFINITY,o,f=0,u=0;u<4;++f,++u){tn(f%2?r:a,f%4>=2),t=k(e);var c=$e(e,t);c<d&&(u=0,o=i.cloneDeep(t),d=c)}Y(e,o)}function A(e,n,r){return i.map(n,function(a){return Ue(e,a,r)})}function tn(e,n){var r=new w.Graph;i.forEach(e,function(a){var t=a.graph().root,d=ne(a,t,r,n);i.forEach(d.vs,function(o,f){a.node(o).order=f}),qe(a,r,d.vs)})}function Y(e,n){i.forEach(n,function(r){i.forEach(r,function(a,t){e.node(a).order=t})})}function on(e){var n=fn(e);i.forEach(e.graph().dummyChains,function(r){for(var a=e.node(r),t=a.edgeObj,d=dn(e,n,t.v,t.w),o=d.path,f=d.lca,u=0,c=o[u],s=!0;r!==t.w;){if(a=e.node(r),s){for(;(c=o[u])!==f&&e.node(c).maxRank<a.rank;)u++;c===f&&(s=!1)}if(!s){for(;u<o.length-1&&e.node(c=o[u+1]).minRank<=a.rank;)u++;c=o[u]}e.setParent(r,c),r=e.successors(r)[0]}})}function dn(e,n,r,a){var t=[],d=[],o=Math.min(n[r].low,n[a].low),f=Math.max(n[r].lim,n[a].lim),u,c;u=r;do u=e.parent(u),t.push(u);while(u&&(n[u].low>o||f>n[u].lim));for(c=u,u=a;(u=e.parent(u))!==c;)d.push(u);return{path:t.concat(d.reverse()),lca:c}}function fn(e){var n={},r=0;function a(t){var d=r;i.forEach(e.children(t),a),n[t]={low:d,lim:r++}}return i.forEach(e.children(),a),n}function un(e,n){var r={};function a(t,d){var o=0,f=0,u=t.length,c=i.last(d);return i.forEach(d,function(s,h){var l=sn(e,s),v=l?e.node(l).order:u;(l||s===c)&&(i.forEach(d.slice(f,h+1),function(p){i.forEach(e.predecessors(p),function(m){var y=e.node(m),T=y.order;(T<o||v<T)&&!(y.dummy&&e.node(p).dummy)&&re(r,m,p)})}),f=h+1,o=v)}),d}return i.reduce(n,a),r}function cn(e,n){var r={};function a(d,o,f,u,c){var s;i.forEach(i.range(o,f),function(h){s=d[h],e.node(s).dummy&&i.forEach(e.predecessors(s),function(l){var v=e.node(l);v.dummy&&(v.order<u||v.order>c)&&re(r,l,s)})})}function t(d,o){var f=-1,u,c=0;return i.forEach(o,function(s,h){if(e.node(s).dummy==="border"){var l=e.predecessors(s);l.length&&(u=e.node(l[0]).order,a(o,c,h,f,u),c=h,f=u)}a(o,c,o.length,u,d.length)}),o}return i.reduce(n,t),r}function sn(e,n){if(e.node(n).dummy)return i.find(e.predecessors(n),function(r){return e.node(r).dummy})}function re(e,n,r){if(n>r){var a=n;n=r,r=a}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var t=e[n];Object.defineProperty(t,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function hn(e,n,r){if(n>r){var a=n;n=r,r=a}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function ln(e,n,r,a){var t={},d={},o={};return i.forEach(n,function(f){i.forEach(f,function(u,c){t[u]=u,d[u]=u,o[u]=c})}),i.forEach(n,function(f){var u=-1;i.forEach(f,function(c){var s=a(c);if(s.length){s=i.sortBy(s,function(m){return o[m]});for(var h=(s.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=s[l];d[c]===c&&u<o[p]&&!hn(r,c,p)&&(d[p]=c,d[c]=t[c]=t[p],u=o[p])}}})}),{root:t,align:d}}function vn(e,n,r,a,t){var d={},o=pn(e,n,r,t),f=t?"borderLeft":"borderRight";function u(h,l){for(var v=o.nodes(),p=v.pop(),m={};p;)m[p]?h(p):(m[p]=!0,v.push(p),v=v.concat(l(p))),p=v.pop()}function c(h){d[h]=o.inEdges(h).reduce(function(l,v){return Math.max(l,d[v.v]+o.edge(v))},0)}function s(h){var l=o.outEdges(h).reduce(function(p,m){return Math.min(p,d[m.w]-o.edge(m))},Number.POSITIVE_INFINITY),v=e.node(h);l!==Number.POSITIVE_INFINITY&&v.borderType!==f&&(d[h]=Math.max(d[h],l))}return u(c,o.predecessors.bind(o)),u(s,o.successors.bind(o)),i.forEach(a,function(h){d[h]=d[r[h]]}),d}function pn(e,n,r,a){var t=new w.Graph,d=e.graph(),o=yn(d.nodesep,d.edgesep,a);return i.forEach(n,function(f){var u;i.forEach(f,function(c){var s=r[c];if(t.setNode(s),u){var h=r[u],l=t.edge(h,s);t.setEdge(h,s,Math.max(o(e,c,u),l||0))}u=c})}),t}function mn(e,n){return i.minBy(i.values(n),function(r){var a=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return i.forIn(r,function(d,o){var f=gn(e,o)/2;a=Math.max(d+f,a),t=Math.min(d-f,t)}),a-t})}function wn(e,n){var r=i.values(n),a=i.min(r),t=i.max(r);i.forEach(["u","d"],function(d){i.forEach(["l","r"],function(o){var f=d+o,u=e[f],c;if(u!==n){var s=i.values(u);c=o==="l"?a-i.min(s):t-i.max(s),c&&(e[f]=i.mapValues(u,function(h){return h+c}))}})})}function bn(e,n){return i.mapValues(e.ul,function(r,a){if(n)return e[n.toLowerCase()][a];var t=i.sortBy(i.map(e,a));return(t[1]+t[2])/2})}function En(e){var n=k(e),r=i.merge(un(e,n),cn(e,n)),a={},t;i.forEach(["u","d"],function(o){t=o==="u"?n:i.values(n).reverse(),i.forEach(["l","r"],function(f){f==="r"&&(t=i.map(t,function(h){return i.values(h).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),c=ln(e,t,r,u),s=vn(e,t,c.root,c.align,f==="r");f==="r"&&(s=i.mapValues(s,function(h){return-h})),a[o+f]=s})});var d=mn(e,a);return wn(a,d),bn(a,e.graph().align)}function yn(e,n,r){return function(a,t,d){var o=a.node(t),f=a.node(d),u=0,c;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":c=-o.width/2;break;case"r":c=o.width/2;break}if(c&&(u+=r?c:-c),c=0,u+=(o.dummy?n:e)/2,u+=(f.dummy?n:e)/2,u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":c=f.width/2;break;case"r":c=-f.width/2;break}return c&&(u+=r?c:-c),c=0,u}}function gn(e,n){return e.node(n).width}function kn(e){e=q(e),xn(e),i.forOwn(En(e),function(n,r){e.node(r).x=n})}function xn(e){var n=k(e),r=e.graph().ranksep,a=0;i.forEach(n,function(t){var d=i.max(i.map(t,function(o){return e.node(o).height}));i.forEach(t,function(o){e.node(o).y=a+d/2}),a+=d+r})}function On(e,n){var r=be;r("layout",()=>{var a=r(" buildLayoutGraph",()=>Mn(e));r(" runLayout",()=>Nn(a,r)),r(" updateInputGraph",()=>Ln(e,a))})}function Nn(e,n){n(" makeSpaceForEdgeLabels",()=>Vn(e)),n(" removeSelfEdges",()=>Wn(e)),n(" acyclic",()=>se(e)),n(" nestingGraph.run",()=>Ge(e)),n(" rank",()=>Ve(q(e))),n(" injectEdgeLabelProxies",()=>Bn(e)),n(" removeEmptyRanks",()=>me(e)),n(" nestingGraph.cleanup",()=>Ye(e)),n(" normalizeRanks",()=>pe(e)),n(" assignRankMinMax",()=>Fn(e)),n(" removeEdgeLabelProxies",()=>Gn(e)),n(" normalize.run",()=>Oe(e)),n(" parentDummyChains",()=>on(e)),n(" addBorderSegments",()=>Ee(e)),n(" order",()=>an(e)),n(" insertSelfEdges",()=>$n(e)),n(" adjustCoordinateSystem",()=>ye(e)),n(" position",()=>kn(e)),n(" positionSelfEdges",()=>zn(e)),n(" removeBorderNodes",()=>Un(e)),n(" normalize.undo",()=>Le(e)),n(" fixupEdgeLabelCoords",()=>Yn(e)),n(" undoCoordinateSystem",()=>ge(e)),n(" translateGraph",()=>Dn(e)),n(" assignNodeIntersects",()=>An(e)),n(" reversePoints",()=>qn(e)),n(" acyclic.undo",()=>le(e))}function Ln(e,n){i.forEach(e.nodes(),function(r){var a=e.node(r),t=n.node(r);a&&(a.x=t.x,a.y=t.y,n.children(r).length&&(a.width=t.width,a.height=t.height))}),i.forEach(e.edges(),function(r){var a=e.edge(r),t=n.edge(r);a.points=t.points,Object.prototype.hasOwnProperty.call(t,"x")&&(a.x=t.x,a.y=t.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var In=["nodesep","edgesep","ranksep","marginx","marginy"],Pn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_n=["acyclicer","ranker","rankdir","align"],Rn=["width","height"],Cn={width:0,height:0},Tn=["minlen","weight","width","height","labeloffset"],jn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Sn=["labelpos"];function Mn(e){var n=new w.Graph({multigraph:!0,compound:!0}),r=I(e.graph());return n.setGraph(i.merge({},Pn,L(r,In),i.pick(r,_n))),i.forEach(e.nodes(),function(a){var t=I(e.node(a));n.setNode(a,i.defaults(L(t,Rn),Cn)),n.setParent(a,e.parent(a))}),i.forEach(e.edges(),function(a){var t=I(e.edge(a));n.setEdge(a,i.merge({},jn,L(t,Tn),i.pick(t,Sn)))}),n}function Vn(e){var n=e.graph();n.ranksep/=2,i.forEach(e.edges(),function(r){var a=e.edge(r);a.minlen*=2,a.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?a.width+=a.labeloffset:a.height+=a.labeloffset)})}function Bn(e){i.forEach(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var a=e.node(n.v),t=e.node(n.w),d={rank:(t.rank-a.rank)/2+a.rank,e:n};E(e,"edge-proxy",d,"_ep")}})}function Fn(e){var n=0;i.forEach(e.nodes(),function(r){var a=e.node(r);a.borderTop&&(a.minRank=e.node(a.borderTop).rank,a.maxRank=e.node(a.borderBottom).rank,n=i.max(n,a.maxRank))}),e.graph().maxRank=n}function Gn(e){i.forEach(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Dn(e){var n=Number.POSITIVE_INFINITY,r=0,a=Number.POSITIVE_INFINITY,t=0,d=e.graph(),o=d.marginx||0,f=d.marginy||0;function u(c){var s=c.x,h=c.y,l=c.width,v=c.height;n=Math.min(n,s-l/2),r=Math.max(r,s+l/2),a=Math.min(a,h-v/2),t=Math.max(t,h+v/2)}i.forEach(e.nodes(),function(c){u(e.node(c))}),i.forEach(e.edges(),function(c){var s=e.edge(c);Object.prototype.hasOwnProperty.call(s,"x")&&u(s)}),n-=o,a-=f,i.forEach(e.nodes(),function(c){var s=e.node(c);s.x-=n,s.y-=a}),i.forEach(e.edges(),function(c){var s=e.edge(c);i.forEach(s.points,function(h){h.x-=n,h.y-=a}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=a)}),d.width=r-n+o,d.height=t-a+f}function An(e){i.forEach(e.edges(),function(n){var r=e.edge(n),a=e.node(n.v),t=e.node(n.w),d,o;r.points?(d=r.points[0],o=r.points[r.points.length-1]):(r.points=[],d=t,o=a),r.points.unshift(S(a,d)),r.points.push(S(t,o))})}function Yn(e){i.forEach(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function qn(e){i.forEach(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Un(e){i.forEach(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),a=e.node(r.borderTop),t=e.node(r.borderBottom),d=e.node(i.last(r.borderLeft)),o=e.node(i.last(r.borderRight));r.width=Math.abs(o.x-d.x),r.height=Math.abs(t.y-a.y),r.x=d.x+r.width/2,r.y=a.y+r.height/2}}),i.forEach(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Wn(e){i.forEach(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function $n(e){var n=k(e);i.forEach(n,function(r){var a=0;i.forEach(r,function(t,d){var o=e.node(t);o.order=d+a,i.forEach(o.selfEdges,function(f){E(e,"selfedge",{width:f.label.width,height:f.label.height,rank:o.rank,order:d+ ++a,e:f.e,label:f.label},"_se")}),delete o.selfEdges})})}function zn(e){i.forEach(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var a=e.node(r.e.v),t=a.x+a.width/2,d=a.y,o=r.x-t,f=a.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:t+2*o/3,y:d-f},{x:t+5*o/6,y:d-f},{x:t+o,y:d},{x:t+5*o/6,y:d+f},{x:t+2*o/3,y:d+f}],r.label.x=r.x,r.label.y=r.y}})}function L(e,n){return i.mapValues(i.pick(e,n),Number)}function I(e){var n={};return i.forEach(e,function(r,a){n[a.toLowerCase()]=r}),n}exports.layout=On;