smart-chat-asp 1.0.1

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