lowcoder-comps 0.0.31 → 0.0.33

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 (87) hide show
  1. package/00bb478a.js +1102 -0
  2. package/02bef5a4.js +505 -0
  3. package/057d2a44.js +1127 -0
  4. package/0964fcc6.js +34 -0
  5. package/14220e98.js +1276 -0
  6. package/1c074fe4.js +25 -0
  7. package/250a6954.js +804 -0
  8. package/256b619e.js +92 -0
  9. package/2cd27cf0.js +2501 -0
  10. package/2f064957.js +64 -0
  11. package/2ff2c7a6.js +6 -0
  12. package/2ff7471d.js +9 -0
  13. package/30c4916b.js +8 -0
  14. package/36ec7270.js +915 -0
  15. package/38c14832.js +960 -0
  16. package/3ae34bed.js +819 -0
  17. package/3e2939fa.js +237 -0
  18. package/3f5f874f.js +86 -0
  19. package/3fb86fb9.js +447 -0
  20. package/415177f9.js +1579 -0
  21. package/47848c42.js +11636 -0
  22. package/4c6a0ece.js +162535 -0
  23. package/4db8e48b.js +2284 -0
  24. package/531065f1.js +1089 -0
  25. package/5a398ea8.js +881 -0
  26. package/5ab1614c.js +268 -0
  27. package/65bbb6ae.js +1536 -0
  28. package/777cd15c.js +48428 -0
  29. package/7dacfa82.js +220 -0
  30. package/800cf0d0.js +796 -0
  31. package/92e85b65.js +65 -0
  32. package/93e9bd3a.js +391 -0
  33. package/98622dfa.js +16582 -0
  34. package/a2e74e62.js +2967 -0
  35. package/a61c3bd3.js +5 -0
  36. package/b8f48ff4.js +769 -0
  37. package/bd0f5f65.js +319 -0
  38. package/bf4428f5.js +1269 -0
  39. package/cb1972f7.js +455 -0
  40. package/dfc10c94.js +818 -0
  41. package/ed2c9753.js +208 -0
  42. package/ef2833e6.js +927 -0
  43. package/f9637058.js +16 -0
  44. package/f9e72519.js +1284 -0
  45. package/fe063d15.js +19339 -0
  46. package/index.js +5 -0
  47. package/package.json +30 -3
  48. package/README.md +0 -120
  49. package/index.html +0 -26
  50. package/index.tsx +0 -21
  51. package/jest.config.js +0 -6
  52. package/src/__test__/allComp.test.tsx +0 -61
  53. package/src/app-env.d.ts +0 -3
  54. package/src/comps/calendarComp/calendarComp.tsx +0 -633
  55. package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
  56. package/src/comps/calendarComp/errorBoundary.tsx +0 -30
  57. package/src/comps/chartComp/chartComp.tsx +0 -442
  58. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
  59. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
  60. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
  61. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
  62. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
  63. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
  64. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
  65. package/src/comps/chartComp/chartConstants.tsx +0 -299
  66. package/src/comps/chartComp/chartPropertyView.tsx +0 -235
  67. package/src/comps/chartComp/chartUtils.ts +0 -291
  68. package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
  69. package/src/comps/chartComp/reactEcharts/index.ts +0 -21
  70. package/src/comps/chartComp/reactEcharts/types.ts +0 -76
  71. package/src/comps/chartComp/seriesComp.tsx +0 -119
  72. package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
  73. package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
  74. package/src/comps/imageEditorComp/index.tsx +0 -184
  75. package/src/comps/mermaidComp/index.tsx +0 -44
  76. package/src/comps/mermaidComp/mermaid.tsx +0 -29
  77. package/src/global.ts +0 -1
  78. package/src/i18n/comps/index.tsx +0 -29
  79. package/src/i18n/comps/locales/en.ts +0 -163
  80. package/src/i18n/comps/locales/enObj.tsx +0 -198
  81. package/src/i18n/comps/locales/index.ts +0 -7
  82. package/src/i18n/comps/locales/types.tsx +0 -10
  83. package/src/i18n/comps/locales/zh.ts +0 -156
  84. package/src/i18n/comps/locales/zhObj.tsx +0 -4
  85. package/src/index.ts +0 -11
  86. package/tsconfig.json +0 -22
  87. package/vite.config.js +0 -10
package/3ae34bed.js ADDED
@@ -0,0 +1,819 @@
1
+ var U = (r, e, t) => new Promise((n, a) => {
2
+ var s = (l) => {
3
+ try {
4
+ o(t.next(l));
5
+ } catch (d) {
6
+ a(d);
7
+ }
8
+ }, i = (l) => {
9
+ try {
10
+ o(t.throw(l));
11
+ } catch (d) {
12
+ a(d);
13
+ }
14
+ }, o = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(s, i);
15
+ o((t = t.apply(r, e)).next());
16
+ });
17
+ import { p as _t, f as z } from "./057d2a44.js";
18
+ import { h as S, f as et, G as Et } from "./5a398ea8.js";
19
+ import { j as x, p as $, q as H, r as rt, e as G, t as at, m as nt, l as R, u as Y, v as Tt } from "./4c6a0ece.js";
20
+ import { u as Nt, r as At, p as Ct, l as It, d as M } from "./65bbb6ae.js";
21
+ import { a as N, b as st, i as it, c as E, e as ot, d as lt, f as Bt, g as Mt, s as Dt } from "./cb1972f7.js";
22
+ import { l as Rt } from "./0964fcc6.js";
23
+ import "./93e9bd3a.js";
24
+ import "./30c4916b.js";
25
+ import "./00bb478a.js";
26
+ import "./a2e74e62.js";
27
+ import "./a61c3bd3.js";
28
+ import "./2ff2c7a6.js";
29
+ import "./256b619e.js";
30
+ function Gt(r) {
31
+ if (!r.ok)
32
+ throw new Error(r.status + " " + r.statusText);
33
+ return r.text();
34
+ }
35
+ function Pt(r, e) {
36
+ return fetch(r, e).then(Gt);
37
+ }
38
+ function Ut(r) {
39
+ return (e, t) => Pt(e, t).then((n) => new DOMParser().parseFromString(n, r));
40
+ }
41
+ var $t = Ut("image/svg+xml"), X = {
42
+ normal: Vt,
43
+ vee: zt,
44
+ undirected: Yt
45
+ };
46
+ function Wt(r) {
47
+ X = r;
48
+ }
49
+ function Vt(r, e, t, n) {
50
+ 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");
51
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
52
+ }
53
+ function zt(r, e, t, n) {
54
+ 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");
55
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
56
+ }
57
+ function Yt(r, e, t, n) {
58
+ 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");
59
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
60
+ }
61
+ function Ht(r, e) {
62
+ var t = r;
63
+ return t.node().appendChild(e.label), N(t, e.labelStyle), t;
64
+ }
65
+ function Xt(r, e) {
66
+ for (var t = r.append("text"), n = Ft(e.label).split(`
67
+ `), a = 0; a < n.length; a++)
68
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
69
+ return N(t, e.labelStyle), t;
70
+ }
71
+ function Ft(r) {
72
+ for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
73
+ if (n = r[a], t) {
74
+ switch (n) {
75
+ case "n":
76
+ e += `
77
+ `;
78
+ break;
79
+ default:
80
+ e += n;
81
+ }
82
+ t = !1;
83
+ } else
84
+ n === "\\" ? t = !0 : e += n;
85
+ return e;
86
+ }
87
+ function Z(r, e, t) {
88
+ var n = e.label, a = r.append("g");
89
+ e.labelType === "svg" ? Ht(a, e) : typeof n != "string" || e.labelType === "html" ? st(a, e) : Xt(a, e);
90
+ var s = a.node().getBBox(), i;
91
+ switch (t) {
92
+ case "top":
93
+ i = -e.height / 2;
94
+ break;
95
+ case "bottom":
96
+ i = e.height / 2 - s.height;
97
+ break;
98
+ default:
99
+ i = -s.height / 2;
100
+ }
101
+ return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
102
+ }
103
+ var F = function(r, e) {
104
+ var t = e.nodes().filter(function(s) {
105
+ return it(e, s);
106
+ }), n = r.selectAll("g.cluster").data(t, function(s) {
107
+ return s;
108
+ });
109
+ E(n.exit(), e).style("opacity", 0).remove();
110
+ var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
111
+ var i = e.node(s);
112
+ return i.id;
113
+ }).style("opacity", 0).each(function(s) {
114
+ var i = e.node(s), o = x(this);
115
+ x(this).append("rect");
116
+ var l = o.append("g").attr("class", "label");
117
+ Z(l, i, i.clusterLabelPos);
118
+ });
119
+ return n = n.merge(a), n = E(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
120
+ var i = e.node(s), o = x(this);
121
+ N(o, i.style);
122
+ }), n;
123
+ };
124
+ function qt(r) {
125
+ F = r;
126
+ }
127
+ let q = function(r, e) {
128
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
129
+ return ot(a);
130
+ }).classed("update", !0);
131
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
132
+ var s = x(this);
133
+ s.select(".label").remove();
134
+ var i = e.edge(a), o = Z(s, e.edge(a), 0).classed("label", !0), l = o.node().getBBox();
135
+ i.labelId && o.attr("id", i.labelId), S(i, "width") || (i.width = l.width), S(i, "height") || (i.height = l.height);
136
+ });
137
+ var n;
138
+ return t.exit ? n = t.exit() : n = t.selectAll(null), E(n, e).style("opacity", 0).remove(), t;
139
+ };
140
+ function Qt(r) {
141
+ q = r;
142
+ }
143
+ function j(r, e) {
144
+ return r.intersect(e);
145
+ }
146
+ var Q = function(r, e, t) {
147
+ var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
148
+ return ot(i);
149
+ }).classed("update", !0), a = jt(n, e);
150
+ te(n, e);
151
+ var s = n.merge !== void 0 ? n.merge(a) : n;
152
+ return E(s, e).style("opacity", 1), s.each(function(i) {
153
+ var o = x(this), l = e.edge(i);
154
+ l.elem = this, l.id && o.attr("id", l.id), lt(
155
+ o,
156
+ l.class,
157
+ (o.classed("update") ? "update " : "") + "edgePath"
158
+ );
159
+ }), s.selectAll("path.path").each(function(i) {
160
+ var o = e.edge(i);
161
+ o.arrowheadId = Nt("arrowhead");
162
+ var l = x(this).attr("marker-end", function() {
163
+ return "url(" + Jt(location.href, o.arrowheadId) + ")";
164
+ }).style("fill", "none");
165
+ E(l, e).attr("d", function(d) {
166
+ return Zt(e, d);
167
+ }), N(l, o.style);
168
+ }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
169
+ var o = e.edge(i), l = t[o.arrowhead];
170
+ l(x(this), o.arrowheadId, o, "arrowhead");
171
+ }), s;
172
+ };
173
+ function Kt(r) {
174
+ Q = r;
175
+ }
176
+ function Jt(r, e) {
177
+ var t = r.split("#")[0];
178
+ return t + "#" + e;
179
+ }
180
+ function Zt(r, e) {
181
+ var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
182
+ return s.unshift(j(n, s[0])), s.push(j(a, s[s.length - 1])), ct(t, s);
183
+ }
184
+ function ct(r, e) {
185
+ var t = (Rt || $t.line)().x(function(n) {
186
+ return n.x;
187
+ }).y(function(n) {
188
+ return n.y;
189
+ });
190
+ return (t.curve || t.interpolate)(r.curve), t(e);
191
+ }
192
+ function Ot(r) {
193
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
194
+ return { x: t.e, y: t.f };
195
+ }
196
+ function jt(r, e) {
197
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
198
+ return t.append("path").attr("class", "path").attr("d", function(n) {
199
+ var a = e.edge(n), s = e.node(n.v).elem, i = At(a.points.length).map(function() {
200
+ return Ot(s);
201
+ });
202
+ return ct(a, i);
203
+ }), t.append("defs"), t;
204
+ }
205
+ function te(r, e) {
206
+ var t = r.exit();
207
+ E(t, e).style("opacity", 0).remove();
208
+ }
209
+ var K = function(r, e, t) {
210
+ var n = e.nodes().filter(function(i) {
211
+ return !it(e, i);
212
+ }), a = r.selectAll("g.node").data(n, function(i) {
213
+ return i;
214
+ }).classed("update", !0);
215
+ a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
216
+ var o = e.node(i), l = x(this);
217
+ lt(
218
+ l,
219
+ o.class,
220
+ (l.classed("update") ? "update " : "") + "node"
221
+ ), l.select("g.label").remove();
222
+ var d = l.append("g").attr("class", "label"), c = Z(d, o), v = t[o.shape], h = Ct(c.node().getBBox(), "width", "height");
223
+ o.elem = this, o.id && l.attr("id", o.id), o.labelId && d.attr("id", o.labelId), S(o, "width") && (h.width = o.width), S(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
224
+ "transform",
225
+ "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
226
+ );
227
+ var u = x(this);
228
+ u.select(".label-container").remove();
229
+ var p = v(u, h, o).classed("label-container", !0);
230
+ N(p, o.style);
231
+ var y = p.node().getBBox();
232
+ o.width = y.width, o.height = y.height;
233
+ });
234
+ var s;
235
+ return a.exit ? s = a.exit() : s = a.selectAll(null), E(s, e).style("opacity", 0).remove(), a;
236
+ };
237
+ function ee(r) {
238
+ K = r;
239
+ }
240
+ function re(r, e) {
241
+ var t = r.filter(function() {
242
+ return !x(this).classed("update");
243
+ });
244
+ function n(a) {
245
+ var s = e.node(a);
246
+ return "translate(" + s.x + "," + s.y + ")";
247
+ }
248
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n), E(t.selectAll("rect"), e).attr("width", function(a) {
249
+ return e.node(a).width;
250
+ }).attr("height", function(a) {
251
+ return e.node(a).height;
252
+ }).attr("x", function(a) {
253
+ var s = e.node(a);
254
+ return -s.width / 2;
255
+ }).attr("y", function(a) {
256
+ var s = e.node(a);
257
+ return -s.height / 2;
258
+ });
259
+ }
260
+ function ae(r, e) {
261
+ var t = r.filter(function() {
262
+ return !x(this).classed("update");
263
+ });
264
+ function n(a) {
265
+ var s = e.edge(a);
266
+ return S(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
267
+ }
268
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n);
269
+ }
270
+ function ne(r, e) {
271
+ var t = r.filter(function() {
272
+ return !x(this).classed("update");
273
+ });
274
+ function n(a) {
275
+ var s = e.node(a);
276
+ return "translate(" + s.x + "," + s.y + ")";
277
+ }
278
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n);
279
+ }
280
+ function dt(r, e, t, n) {
281
+ var a = r.x, s = r.y, i = a - n.x, o = s - n.y, l = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / l);
282
+ n.x < a && (d = -d);
283
+ var c = Math.abs(e * t * o / l);
284
+ return n.y < s && (c = -c), { x: a + d, y: s + c };
285
+ }
286
+ function se(r, e, t) {
287
+ return dt(r, e, e, t);
288
+ }
289
+ function ie(r, e, t, n) {
290
+ var a, s, i, o, l, d, c, v, h, u, p, y, f, g, k;
291
+ if (a = e.y - r.y, i = r.x - e.x, l = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + l, u = a * n.x + i * n.y + l, !(h !== 0 && u !== 0 && tt(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, c = s * r.x + o * r.y + d, v = s * e.x + o * e.y + d, !(c !== 0 && v !== 0 && tt(c, v)) && (p = a * o - s * i, p !== 0)))
292
+ return y = Math.abs(p / 2), f = i * d - o * l, g = f < 0 ? (f - y) / p : (f + y) / p, f = s * l - a * d, k = f < 0 ? (f - y) / p : (f + y) / p, { x: g, y: k };
293
+ }
294
+ function tt(r, e) {
295
+ return r * e > 0;
296
+ }
297
+ function T(r, e, t) {
298
+ var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
299
+ e.forEach(function(p) {
300
+ i = Math.min(i, p.x), o = Math.min(o, p.y);
301
+ });
302
+ for (var l = n - r.width / 2 - i, d = a - r.height / 2 - o, c = 0; c < e.length; c++) {
303
+ var v = e[c], h = e[c < e.length - 1 ? c + 1 : 0], u = ie(
304
+ r,
305
+ t,
306
+ { x: l + v.x, y: d + v.y },
307
+ { x: l + h.x, y: d + h.y }
308
+ );
309
+ u && s.push(u);
310
+ }
311
+ return s.length ? (s.length > 1 && s.sort(function(p, y) {
312
+ var f = p.x - t.x, g = p.y - t.y, k = Math.sqrt(f * f + g * g), I = y.x - t.x, _ = y.y - t.y, W = Math.sqrt(I * I + _ * _);
313
+ return k < W ? -1 : k === W ? 0 : 1;
314
+ }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
315
+ }
316
+ function O(r, e) {
317
+ var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, l, d;
318
+ return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), l = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), l = i, d = a === 0 ? 0 : i * s / a), { x: t + l, y: n + d };
319
+ }
320
+ var J = {
321
+ rect: le,
322
+ ellipse: ce,
323
+ circle: de,
324
+ diamond: he
325
+ };
326
+ function oe(r) {
327
+ J = r;
328
+ }
329
+ function le(r, e, t) {
330
+ 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);
331
+ return t.intersect = function(a) {
332
+ return O(t, a);
333
+ }, n;
334
+ }
335
+ function ce(r, e, t) {
336
+ 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);
337
+ return t.intersect = function(i) {
338
+ return dt(t, n, a, i);
339
+ }, s;
340
+ }
341
+ function de(r, e, t) {
342
+ 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);
343
+ return t.intersect = function(s) {
344
+ return se(t, n, s);
345
+ }, a;
346
+ }
347
+ function he(r, e, t) {
348
+ var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
349
+ { x: 0, y: -a },
350
+ { x: -n, y: 0 },
351
+ { x: 0, y: a },
352
+ { x: n, y: 0 }
353
+ ], i = r.insert("polygon", ":first-child").attr(
354
+ "points",
355
+ s.map(function(o) {
356
+ return o.x + "," + o.y;
357
+ }).join(" ")
358
+ );
359
+ return t.intersect = function(o) {
360
+ return T(t, s, o);
361
+ }, i;
362
+ }
363
+ function ue() {
364
+ var r = function(e, t) {
365
+ ve(t);
366
+ var n = D(e, "output"), a = D(n, "clusters"), s = D(n, "edgePaths"), i = q(D(n, "edgeLabels"), t), o = K(D(n, "nodes"), t, J);
367
+ It(t), ne(o, t), ae(i, t), Q(s, t, X);
368
+ var l = F(a, t);
369
+ re(l, t), ge(t);
370
+ };
371
+ return r.createNodes = function(e) {
372
+ return arguments.length ? (ee(e), r) : K;
373
+ }, r.createClusters = function(e) {
374
+ return arguments.length ? (qt(e), r) : F;
375
+ }, r.createEdgeLabels = function(e) {
376
+ return arguments.length ? (Qt(e), r) : q;
377
+ }, r.createEdgePaths = function(e) {
378
+ return arguments.length ? (Kt(e), r) : Q;
379
+ }, r.shapes = function(e) {
380
+ return arguments.length ? (oe(e), r) : J;
381
+ }, r.arrows = function(e) {
382
+ return arguments.length ? (Wt(e), r) : X;
383
+ }, r;
384
+ }
385
+ var fe = {
386
+ paddingLeft: 10,
387
+ paddingRight: 10,
388
+ paddingTop: 10,
389
+ paddingBottom: 10,
390
+ rx: 0,
391
+ ry: 0,
392
+ shape: "rect"
393
+ }, pe = {
394
+ arrowhead: "normal",
395
+ curve: $
396
+ };
397
+ function ve(r) {
398
+ r.nodes().forEach(function(e) {
399
+ var t = r.node(e);
400
+ !S(t, "label") && !r.children(e).length && (t.label = e), S(t, "paddingX") && M(t, {
401
+ paddingLeft: t.paddingX,
402
+ paddingRight: t.paddingX
403
+ }), S(t, "paddingY") && M(t, {
404
+ paddingTop: t.paddingY,
405
+ paddingBottom: t.paddingY
406
+ }), S(t, "padding") && M(t, {
407
+ paddingLeft: t.padding,
408
+ paddingRight: t.padding,
409
+ paddingTop: t.padding,
410
+ paddingBottom: t.padding
411
+ }), M(t, fe), et(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(n) {
412
+ t[n] = Number(t[n]);
413
+ }), S(t, "width") && (t._prevWidth = t.width), S(t, "height") && (t._prevHeight = t.height);
414
+ }), r.edges().forEach(function(e) {
415
+ var t = r.edge(e);
416
+ S(t, "label") || (t.label = ""), M(t, pe);
417
+ });
418
+ }
419
+ function ge(r) {
420
+ et(r.nodes(), function(e) {
421
+ var t = r.node(e);
422
+ S(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, S(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
423
+ });
424
+ }
425
+ function D(r, e) {
426
+ var t = r.select("g." + e);
427
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
428
+ }
429
+ function ht(r, e, t) {
430
+ const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
431
+ { x: s / 2, y: 0 },
432
+ { x: s, y: -s / 2 },
433
+ { x: s / 2, y: -s },
434
+ { x: 0, y: -s / 2 }
435
+ ], o = A(r, s, s, i);
436
+ return t.intersect = function(l) {
437
+ return T(t, i, l);
438
+ }, o;
439
+ }
440
+ function ut(r, e, t) {
441
+ const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
442
+ { x: s, y: 0 },
443
+ { x: i - s, y: 0 },
444
+ { x: i, y: -a / 2 },
445
+ { x: i - s, y: -a },
446
+ { x: s, y: -a },
447
+ { x: 0, y: -a / 2 }
448
+ ], l = A(r, i, a, o);
449
+ return t.intersect = function(d) {
450
+ return T(t, o, d);
451
+ }, l;
452
+ }
453
+ function ft(r, e, t) {
454
+ const n = e.width, a = e.height, s = [
455
+ { x: -a / 2, y: 0 },
456
+ { x: n, y: 0 },
457
+ { x: n, y: -a },
458
+ { x: -a / 2, y: -a },
459
+ { x: 0, y: -a / 2 }
460
+ ], i = A(r, n, a, s);
461
+ return t.intersect = function(o) {
462
+ return T(t, s, o);
463
+ }, i;
464
+ }
465
+ function pt(r, e, t) {
466
+ const n = e.width, a = e.height, s = [
467
+ { x: -2 * a / 6, y: 0 },
468
+ { x: n - a / 6, y: 0 },
469
+ { x: n + 2 * a / 6, y: -a },
470
+ { x: a / 6, y: -a }
471
+ ], i = A(r, n, a, s);
472
+ return t.intersect = function(o) {
473
+ return T(t, s, o);
474
+ }, i;
475
+ }
476
+ function vt(r, e, t) {
477
+ const n = e.width, a = e.height, s = [
478
+ { x: 2 * a / 6, y: 0 },
479
+ { x: n + a / 6, y: 0 },
480
+ { x: n - 2 * a / 6, y: -a },
481
+ { x: -a / 6, y: -a }
482
+ ], i = A(r, n, a, s);
483
+ return t.intersect = function(o) {
484
+ return T(t, s, o);
485
+ }, i;
486
+ }
487
+ function gt(r, e, t) {
488
+ const n = e.width, a = e.height, s = [
489
+ { x: -2 * a / 6, y: 0 },
490
+ { x: n + 2 * a / 6, y: 0 },
491
+ { x: n - a / 6, y: -a },
492
+ { x: a / 6, y: -a }
493
+ ], i = A(r, n, a, s);
494
+ return t.intersect = function(o) {
495
+ return T(t, s, o);
496
+ }, i;
497
+ }
498
+ function yt(r, e, t) {
499
+ const n = e.width, a = e.height, s = [
500
+ { x: a / 6, y: 0 },
501
+ { x: n - a / 6, y: 0 },
502
+ { x: n + 2 * a / 6, y: -a },
503
+ { x: -2 * a / 6, y: -a }
504
+ ], i = A(r, n, a, s);
505
+ return t.intersect = function(o) {
506
+ return T(t, s, o);
507
+ }, i;
508
+ }
509
+ function wt(r, e, t) {
510
+ const n = e.width, a = e.height, s = [
511
+ { x: 0, y: 0 },
512
+ { x: n + a / 2, y: 0 },
513
+ { x: n, y: -a / 2 },
514
+ { x: n + a / 2, y: -a },
515
+ { x: 0, y: -a }
516
+ ], i = A(r, n, a, s);
517
+ return t.intersect = function(o) {
518
+ return T(t, s, o);
519
+ }, i;
520
+ }
521
+ function mt(r, e, t) {
522
+ 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);
523
+ return t.intersect = function(i) {
524
+ return O(t, i);
525
+ }, s;
526
+ }
527
+ function xt(r, e, t) {
528
+ const n = e.width, a = e.height, s = [
529
+ { x: 0, y: 0 },
530
+ { x: n, y: 0 },
531
+ { x: n, y: -a },
532
+ { x: 0, y: -a },
533
+ { x: 0, y: 0 },
534
+ { x: -8, y: 0 },
535
+ { x: n + 8, y: 0 },
536
+ { x: n + 8, y: -a },
537
+ { x: -8, y: -a },
538
+ { x: -8, y: 0 }
539
+ ], i = A(r, n, a, s);
540
+ return t.intersect = function(o) {
541
+ return T(t, s, o);
542
+ }, i;
543
+ }
544
+ function bt(r, e, t) {
545
+ 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, l = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
546
+ return t.intersect = function(d) {
547
+ const c = O(t, d), v = c.x - t.x;
548
+ if (a != 0 && (Math.abs(v) < t.width / 2 || Math.abs(v) == t.width / 2 && Math.abs(c.y - t.y) > t.height / 2 - s)) {
549
+ let h = s * s * (1 - v * v / (a * a));
550
+ h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), c.y += h;
551
+ }
552
+ return c;
553
+ }, l;
554
+ }
555
+ function ye(r) {
556
+ r.shapes().question = ht, r.shapes().hexagon = ut, r.shapes().stadium = mt, r.shapes().subroutine = xt, r.shapes().cylinder = bt, r.shapes().rect_left_inv_arrow = ft, r.shapes().lean_right = pt, r.shapes().lean_left = vt, r.shapes().trapezoid = gt, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = wt;
557
+ }
558
+ function we(r) {
559
+ r({ question: ht }), r({ hexagon: ut }), r({ stadium: mt }), r({ subroutine: xt }), r({ cylinder: bt }), r({ rect_left_inv_arrow: ft }), r({ lean_right: pt }), r({ lean_left: vt }), r({ trapezoid: gt }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: wt });
560
+ }
561
+ function A(r, e, t, n) {
562
+ return r.insert("polygon", ":first-child").attr(
563
+ "points",
564
+ n.map(function(a) {
565
+ return a.x + "," + a.y;
566
+ }).join(" ")
567
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
568
+ }
569
+ const me = {
570
+ addToRender: ye,
571
+ addToRenderV2: we
572
+ }, kt = {}, xe = function(r) {
573
+ const e = Object.keys(r);
574
+ for (const t of e)
575
+ kt[t] = r[t];
576
+ }, St = function(r, e, t, n, a, s) {
577
+ return U(this, null, function* () {
578
+ const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, l = Object.keys(r);
579
+ for (const d of l) {
580
+ const c = r[d];
581
+ let v = "default";
582
+ c.classes.length > 0 && (v = c.classes.join(" "));
583
+ const h = H(c.styles);
584
+ let u = c.text !== void 0 ? c.text : c.id, p;
585
+ if (rt(G().flowchart.htmlLabels)) {
586
+ const g = {
587
+ label: yield at(
588
+ u.replace(
589
+ /fa[blrs]?:fa-[\w-]+/g,
590
+ // cspell:disable-line
591
+ (k) => `<i class='${k.replace(":", " ")}'></i>`
592
+ ),
593
+ G()
594
+ )
595
+ };
596
+ p = st(i, g).node(), p.parentNode.removeChild(p);
597
+ } else {
598
+ const g = o.createElementNS("http://www.w3.org/2000/svg", "text");
599
+ g.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
600
+ const k = u.split(nt.lineBreakRegex);
601
+ for (const I of k) {
602
+ const _ = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
603
+ _.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), _.setAttribute("dy", "1em"), _.setAttribute("x", "1"), _.textContent = I, g.appendChild(_);
604
+ }
605
+ p = g;
606
+ }
607
+ let y = 0, f = "";
608
+ switch (c.type) {
609
+ case "round":
610
+ y = 5, f = "rect";
611
+ break;
612
+ case "square":
613
+ f = "rect";
614
+ break;
615
+ case "diamond":
616
+ f = "question";
617
+ break;
618
+ case "hexagon":
619
+ f = "hexagon";
620
+ break;
621
+ case "odd":
622
+ f = "rect_left_inv_arrow";
623
+ break;
624
+ case "lean_right":
625
+ f = "lean_right";
626
+ break;
627
+ case "lean_left":
628
+ f = "lean_left";
629
+ break;
630
+ case "trapezoid":
631
+ f = "trapezoid";
632
+ break;
633
+ case "inv_trapezoid":
634
+ f = "inv_trapezoid";
635
+ break;
636
+ case "odd_right":
637
+ f = "rect_left_inv_arrow";
638
+ break;
639
+ case "circle":
640
+ f = "circle";
641
+ break;
642
+ case "ellipse":
643
+ f = "ellipse";
644
+ break;
645
+ case "stadium":
646
+ f = "stadium";
647
+ break;
648
+ case "subroutine":
649
+ f = "subroutine";
650
+ break;
651
+ case "cylinder":
652
+ f = "cylinder";
653
+ break;
654
+ case "group":
655
+ f = "rect";
656
+ break;
657
+ default:
658
+ f = "rect";
659
+ }
660
+ R.warn("Adding node", c.id, c.domId), e.setNode(s.db.lookUpDomId(c.id), {
661
+ labelType: "svg",
662
+ labelStyle: h.labelStyle,
663
+ shape: f,
664
+ label: p,
665
+ rx: y,
666
+ ry: y,
667
+ class: v,
668
+ style: h.style,
669
+ id: s.db.lookUpDomId(c.id)
670
+ });
671
+ }
672
+ });
673
+ }, Lt = function(r, e, t) {
674
+ return U(this, null, function* () {
675
+ let n = 0, a, s;
676
+ if (r.defaultStyle !== void 0) {
677
+ const i = H(r.defaultStyle);
678
+ a = i.style, s = i.labelStyle;
679
+ }
680
+ for (const i of r) {
681
+ n++;
682
+ const o = "L-" + i.start + "-" + i.end, l = "LS-" + i.start, d = "LE-" + i.end, c = {};
683
+ i.type === "arrow_open" ? c.arrowhead = "none" : c.arrowhead = "normal";
684
+ let v = "", h = "";
685
+ if (i.style !== void 0) {
686
+ const u = H(i.style);
687
+ v = u.style, h = u.labelStyle;
688
+ } else
689
+ switch (i.stroke) {
690
+ case "normal":
691
+ v = "fill:none", a !== void 0 && (v = a), s !== void 0 && (h = s);
692
+ break;
693
+ case "dotted":
694
+ v = "fill:none;stroke-width:2px;stroke-dasharray:3;";
695
+ break;
696
+ case "thick":
697
+ v = " stroke-width: 3.5px;fill:none";
698
+ break;
699
+ }
700
+ c.style = v, c.labelStyle = h, i.interpolate !== void 0 ? c.curve = Y(i.interpolate, $) : r.defaultInterpolate !== void 0 ? c.curve = Y(r.defaultInterpolate, $) : c.curve = Y(kt.curve, $), i.text === void 0 ? i.style !== void 0 && (c.arrowheadStyle = "fill: #333") : (c.arrowheadStyle = "fill: #333", c.labelpos = "c", rt(G().flowchart.htmlLabels) ? (c.labelType = "html", c.label = `<span id="L-${o}" class="edgeLabel L-${l}' L-${d}" style="${c.labelStyle}">${yield at(
701
+ i.text.replace(
702
+ /fa[blrs]?:fa-[\w-]+/g,
703
+ // cspell:disable-line
704
+ (u) => `<i class='${u.replace(":", " ")}'></i>`
705
+ ),
706
+ G()
707
+ )}</span>`) : (c.labelType = "text", c.label = i.text.replace(nt.lineBreakRegex, `
708
+ `), i.style === void 0 && (c.style = c.style || "stroke: #333; stroke-width: 1.5px;fill:none"), c.labelStyle = c.labelStyle.replace("color:", "fill:"))), c.id = o, c.class = l + " " + d, c.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), c, n);
709
+ }
710
+ });
711
+ }, be = function(r, e) {
712
+ return R.info("Extracting classes"), e.db.getClasses();
713
+ }, ke = function(r, e, t, n) {
714
+ return U(this, null, function* () {
715
+ R.info("Drawing flowchart");
716
+ const { securityLevel: a, flowchart: s } = G();
717
+ let i;
718
+ a === "sandbox" && (i = x("#i" + e));
719
+ const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), l = a === "sandbox" ? i.nodes()[0].contentDocument : document;
720
+ let d = n.db.getDirection();
721
+ d === void 0 && (d = "TD");
722
+ const c = s.nodeSpacing || 50, v = s.rankSpacing || 50, h = new Et({
723
+ multigraph: !0,
724
+ compound: !0
725
+ }).setGraph({
726
+ rankdir: d,
727
+ nodesep: c,
728
+ ranksep: v,
729
+ marginx: 8,
730
+ marginy: 8
731
+ }).setDefaultEdgeLabel(function() {
732
+ return {};
733
+ });
734
+ let u;
735
+ const p = n.db.getSubGraphs();
736
+ for (let w = p.length - 1; w >= 0; w--)
737
+ u = p[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
738
+ const y = n.db.getVertices();
739
+ R.warn("Get vertices", y);
740
+ const f = n.db.getEdges();
741
+ let g = 0;
742
+ for (g = p.length - 1; g >= 0; g--) {
743
+ u = p[g], Dt("cluster").append("text");
744
+ for (let w = 0; w < u.nodes.length; w++)
745
+ R.warn(
746
+ "Setting subgraph",
747
+ u.nodes[w],
748
+ n.db.lookUpDomId(u.nodes[w]),
749
+ n.db.lookUpDomId(u.id)
750
+ ), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
751
+ }
752
+ yield St(y, h, e, o, l, n), yield Lt(f, h, n);
753
+ const k = new ue();
754
+ me.addToRender(k), k.arrows().none = function(b, L, m, B) {
755
+ const C = b.append("marker").attr("id", L).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");
756
+ N(C, m[B + "Style"]);
757
+ }, k.arrows().normal = function(b, L) {
758
+ b.append("marker").attr("id", L).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");
759
+ };
760
+ const I = o.select(`[id="${e}"]`), _ = o.select("#" + e + " g");
761
+ for (k(_, h), _.selectAll("g.node").attr("title", function() {
762
+ return n.db.getTooltip(this.id);
763
+ }), n.db.indexNodes("subGraph" + g), g = 0; g < p.length; g++)
764
+ if (u = p[g], u.title !== "undefined") {
765
+ const w = l.querySelectorAll(
766
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
767
+ ), b = l.querySelectorAll(
768
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
769
+ ), L = w[0].x.baseVal.value, m = w[0].y.baseVal.value, B = w[0].width.baseVal.value, C = x(b[0]).select(".label");
770
+ C.attr("transform", `translate(${L + B / 2}, ${m + 14})`), C.attr("id", e + "Text");
771
+ for (let V = 0; V < u.classes.length; V++)
772
+ b[0].classList.add(u.classes[V]);
773
+ }
774
+ if (!s.htmlLabels) {
775
+ const w = l.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
776
+ for (const b of w) {
777
+ const L = b.getBBox(), m = l.createElementNS("http://www.w3.org/2000/svg", "rect");
778
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", L.width), m.setAttribute("height", L.height), b.insertBefore(m, b.firstChild);
779
+ }
780
+ }
781
+ Tt(h, I, s.diagramPadding, s.useMaxWidth), Object.keys(y).forEach(function(w) {
782
+ const b = y[w];
783
+ if (b.link) {
784
+ const L = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
785
+ if (L) {
786
+ const m = l.createElementNS("http://www.w3.org/2000/svg", "a");
787
+ 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);
788
+ const B = L.insert(function() {
789
+ return m;
790
+ }, ":first-child"), P = L.select(".label-container");
791
+ P && B.append(function() {
792
+ return P.node();
793
+ });
794
+ const C = L.select(".label");
795
+ C && B.append(function() {
796
+ return C.node();
797
+ });
798
+ }
799
+ }
800
+ });
801
+ });
802
+ }, Se = {
803
+ setConf: xe,
804
+ addVertices: St,
805
+ addEdges: Lt,
806
+ getClasses: be,
807
+ draw: ke
808
+ }, Ue = {
809
+ parser: _t,
810
+ db: z,
811
+ renderer: Bt,
812
+ styles: Mt,
813
+ init: (r) => {
814
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, Se.setConf(r.flowchart), z.clear(), z.setGen("gen-1");
815
+ }
816
+ };
817
+ export {
818
+ Ue as diagram
819
+ };