@schmitech/chatbot-widget 0.5.3 → 0.6.0
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.
- package/dist/_basePickBy-C3-QE0dl-5eQ6L29l.js +152 -0
- package/dist/_baseUniq-CstiM9Lp-AFR_Ns0a.js +615 -0
- package/dist/arc-W3NKKXLI-DHbDwLx0.js +84 -0
- package/dist/architecture-U656AL7Q-fn9wJZsH-BLoGjtkP.js +6 -0
- package/dist/architectureDiagram-VXUJARFQ-zzJsgPC6-C4OfUE0m.js +4667 -0
- package/dist/blockDiagram-VD42YOAC-D-In4h7h-BYXdRmeG.js +2266 -0
- package/dist/c4Diagram-YG6GDRKO-DBs8r9gh-BdLuHgPT.js +1582 -0
- package/dist/channel-RBWQyMSg-Cx0HUumY.js +6 -0
- package/dist/chatbot-widget.bundle.js +4473 -1556
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +12 -63659
- package/dist/chatbot-widget.umd.js +4472 -1555
- package/dist/chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js +10 -0
- package/dist/chunk-55IACEB6-D8pvDVEJ-DrL4SJSR.js +9 -0
- package/dist/chunk-B4BG7PRW-Dwma1pSy-BWjG5dc6.js +1375 -0
- package/dist/chunk-DI55MBZ5-BY2XXvZz-DbAvz3Pq.js +1383 -0
- package/dist/chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js +20 -0
- package/dist/chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js +21 -0
- package/dist/chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js +16 -0
- package/dist/chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js +65 -0
- package/dist/classDiagram-2ON5EDUG-Crd6O69V-kCZrFOLN.js +17 -0
- package/dist/classDiagram-v2-WZHVMYZB-Crd6O69V-kCZrFOLN.js +17 -0
- package/dist/clone-CfLgyC8S-DsDOh4B4.js +9 -0
- package/dist/config/index.d.ts +4 -2
- package/dist/cose-bilkent-S5V4N54A-DKeVcPDK-de_7nZTY.js +2609 -0
- package/dist/cytoscape.esm-CjI2IsL8-Be2K4mI6.js +18723 -0
- package/dist/dagre-6UL2VRFP-BPf604Df-BhZs6zCq.js +448 -0
- package/dist/diagram-PSM6KHXK-DeLcpEV3-qb4rujeN.js +532 -0
- package/dist/diagram-QEK2KX5R-C_5RR1NJ-C5kZWmRl.js +222 -0
- package/dist/diagram-S2PKOQOG-DVx43aon-4nlw6iDz.js +144 -0
- package/dist/erDiagram-Q2GNP2WA-DgUeO5_h-DHc9Yphl.js +841 -0
- package/dist/flowDiagram-NV44I4VS-C5HQUzU9-DHjbmAtJ.js +1628 -0
- package/dist/ganttDiagram-JELNMOA3-DgSZ1ixF-C3hJs_k9.js +1936 -0
- package/dist/gitGraph-F6HP7TQM-UL7-Bx1s-Cog5rj3j.js +6 -0
- package/dist/gitGraphDiagram-NY62KEGX-DY5loT9K-CEcKQNrM.js +713 -0
- package/dist/graph-BfwqPHx6-DErF9dBN.js +248 -0
- package/dist/index-B5s_uaP2.js +124168 -0
- package/dist/index-BAOVR-xx-thst7Pu6.js +13251 -0
- package/dist/info-NVLQJR56-BsqQ0RXQ-BcYgZCCY.js +6 -0
- package/dist/infoDiagram-WHAUD3N6-DIqQ6vCk-BuiAAMSH.js +25 -0
- package/dist/journeyDiagram-XKPGCS4Q-DXjg3S3r-Byi_TGXs.js +835 -0
- package/dist/kanban-definition-3W4ZIXB7-Uxt7Am6n-jy96nA-g.js +721 -0
- package/dist/layout-CSfkE668-BjigbqJL.js +1333 -0
- package/dist/mermaid-parser.core-LjuO4CL3-BLqmPe8-.js +12891 -0
- package/dist/mindmap-definition-VGOIOE7T-DXwVuAPE-SK4e1Sse.js +787 -0
- package/dist/packet-BFZMPI3H-DJWkrKrV-BamBev9S.js +6 -0
- package/dist/pie-7BOR55EZ-DC8hTFwn-D1bcIQbR.js +6 -0
- package/dist/pieDiagram-ADFJNKIX-Cj0EHHtj-Dbr09c-S.js +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-CnLDz007-Ci0DQl2T.js +1024 -0
- package/dist/radar-NHE76QYJ-Bijk-Fk9-9nAmDCMr.js +6 -0
- package/dist/requirementDiagram-UZGBJVZJ-rDaI-8Be-CSEc4S33.js +851 -0
- package/dist/sankeyDiagram-TZEHDZUN-A0YO8ixs-Zj8Z0j0n.js +810 -0
- package/dist/sequenceDiagram-WL72ISMW-BFF7TtP7-Dcofckjv.js +2519 -0
- package/dist/shared/styles.d.ts +1 -1
- package/dist/stateDiagram-FKZM4ZOC-ofFsB7HJ-BJBX12rE.js +264 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CEZFbksU-BywmU88h.js +17 -0
- package/dist/timeline-definition-IT6M3QCI-5W361ZNm-MP_ufVe7.js +800 -0
- package/dist/treemap-KMMF4GRG-pGRoYcSn-BeZ7sXgP.js +6 -0
- package/dist/ui/Message.d.ts +1 -5
- package/dist/ui/MessagesList.d.ts +1 -5
- package/dist/utils/contentFiltering.d.ts +12 -0
- package/dist/xychartDiagram-PRI3JC2R-CSr0GxaP-DBgCtplP.js +1297 -0
- package/package.json +3 -3
- package/dist/ui/TypingEffect.d.ts +0 -18
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { x as w, Q as ee, S as te, al as ie, G as ce, bn as R, a as X, ao as K, bo as B, f as _, u as de, g as he, w as pe, z as ue, B as fe, h as me, T as ye, bp as ge, L as xe } from "./index-B5s_uaP2.js";
|
|
2
|
+
import { d as Se } from "./chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js";
|
|
3
|
+
import { m as ve } from "./chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js";
|
|
4
|
+
import { N as be } from "./mermaid-parser.core-LjuO4CL3-BLqmPe8-.js";
|
|
5
|
+
typeof window < "u" && (window.global = window);
|
|
6
|
+
function we(t) {
|
|
7
|
+
var a = 0, n = t.children, r = n && n.length;
|
|
8
|
+
if (!r) a = 1;
|
|
9
|
+
else for (; --r >= 0; ) a += n[r].value;
|
|
10
|
+
t.value = a;
|
|
11
|
+
}
|
|
12
|
+
function Ce() {
|
|
13
|
+
return this.eachAfter(we);
|
|
14
|
+
}
|
|
15
|
+
function $e(t, a) {
|
|
16
|
+
let n = -1;
|
|
17
|
+
for (const r of this)
|
|
18
|
+
t.call(a, r, ++n, this);
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
function Le(t, a) {
|
|
22
|
+
for (var n = this, r = [n], o, s, d = -1; n = r.pop(); )
|
|
23
|
+
if (t.call(a, n, ++d, this), o = n.children)
|
|
24
|
+
for (s = o.length - 1; s >= 0; --s)
|
|
25
|
+
r.push(o[s]);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
function Te(t, a) {
|
|
29
|
+
for (var n = this, r = [n], o = [], s, d, h, f = -1; n = r.pop(); )
|
|
30
|
+
if (o.push(n), s = n.children)
|
|
31
|
+
for (d = 0, h = s.length; d < h; ++d)
|
|
32
|
+
r.push(s[d]);
|
|
33
|
+
for (; n = o.pop(); )
|
|
34
|
+
t.call(a, n, ++f, this);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
function ke(t, a) {
|
|
38
|
+
let n = -1;
|
|
39
|
+
for (const r of this)
|
|
40
|
+
if (t.call(a, r, ++n, this))
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
function Me(t) {
|
|
44
|
+
return this.eachAfter(function(a) {
|
|
45
|
+
for (var n = +t(a.data) || 0, r = a.children, o = r && r.length; --o >= 0; ) n += r[o].value;
|
|
46
|
+
a.value = n;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function ze(t) {
|
|
50
|
+
return this.eachBefore(function(a) {
|
|
51
|
+
a.children && a.children.sort(t);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function Fe(t) {
|
|
55
|
+
for (var a = this, n = Ae(a, t), r = [a]; a !== n; )
|
|
56
|
+
a = a.parent, r.push(a);
|
|
57
|
+
for (var o = r.length; t !== n; )
|
|
58
|
+
r.splice(o, 0, t), t = t.parent;
|
|
59
|
+
return r;
|
|
60
|
+
}
|
|
61
|
+
function Ae(t, a) {
|
|
62
|
+
if (t === a) return t;
|
|
63
|
+
var n = t.ancestors(), r = a.ancestors(), o = null;
|
|
64
|
+
for (t = n.pop(), a = r.pop(); t === a; )
|
|
65
|
+
o = t, t = n.pop(), a = r.pop();
|
|
66
|
+
return o;
|
|
67
|
+
}
|
|
68
|
+
function Ne() {
|
|
69
|
+
for (var t = this, a = [t]; t = t.parent; )
|
|
70
|
+
a.push(t);
|
|
71
|
+
return a;
|
|
72
|
+
}
|
|
73
|
+
function Be() {
|
|
74
|
+
return Array.from(this);
|
|
75
|
+
}
|
|
76
|
+
function Pe() {
|
|
77
|
+
var t = [];
|
|
78
|
+
return this.eachBefore(function(a) {
|
|
79
|
+
a.children || t.push(a);
|
|
80
|
+
}), t;
|
|
81
|
+
}
|
|
82
|
+
function We() {
|
|
83
|
+
var t = this, a = [];
|
|
84
|
+
return t.each(function(n) {
|
|
85
|
+
n !== t && a.push({ source: n.parent, target: n });
|
|
86
|
+
}), a;
|
|
87
|
+
}
|
|
88
|
+
function* De() {
|
|
89
|
+
var t = this, a, n = [t], r, o, s;
|
|
90
|
+
do
|
|
91
|
+
for (a = n.reverse(), n = []; t = a.pop(); )
|
|
92
|
+
if (yield t, r = t.children)
|
|
93
|
+
for (o = 0, s = r.length; o < s; ++o)
|
|
94
|
+
n.push(r[o]);
|
|
95
|
+
while (n.length);
|
|
96
|
+
}
|
|
97
|
+
function Y(t, a) {
|
|
98
|
+
t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Re)) : a === void 0 && (a = Ee);
|
|
99
|
+
for (var n = new J(t), r, o = [n], s, d, h, f; r = o.pop(); )
|
|
100
|
+
if ((d = a(r.data)) && (f = (d = Array.from(d)).length))
|
|
101
|
+
for (r.children = d, h = f - 1; h >= 0; --h)
|
|
102
|
+
o.push(s = d[h] = new J(d[h])), s.parent = r, s.depth = r.depth + 1;
|
|
103
|
+
return n.eachBefore(Ve);
|
|
104
|
+
}
|
|
105
|
+
function Ie() {
|
|
106
|
+
return Y(this).eachBefore(He);
|
|
107
|
+
}
|
|
108
|
+
function Ee(t) {
|
|
109
|
+
return t.children;
|
|
110
|
+
}
|
|
111
|
+
function Re(t) {
|
|
112
|
+
return Array.isArray(t) ? t[1] : null;
|
|
113
|
+
}
|
|
114
|
+
function He(t) {
|
|
115
|
+
t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
|
|
116
|
+
}
|
|
117
|
+
function Ve(t) {
|
|
118
|
+
var a = 0;
|
|
119
|
+
do
|
|
120
|
+
t.height = a;
|
|
121
|
+
while ((t = t.parent) && t.height < ++a);
|
|
122
|
+
}
|
|
123
|
+
function J(t) {
|
|
124
|
+
this.data = t, this.depth = this.height = 0, this.parent = null;
|
|
125
|
+
}
|
|
126
|
+
J.prototype = Y.prototype = {
|
|
127
|
+
constructor: J,
|
|
128
|
+
count: Ce,
|
|
129
|
+
each: $e,
|
|
130
|
+
eachAfter: Te,
|
|
131
|
+
eachBefore: Le,
|
|
132
|
+
find: ke,
|
|
133
|
+
sum: Me,
|
|
134
|
+
sort: ze,
|
|
135
|
+
path: Fe,
|
|
136
|
+
ancestors: Ne,
|
|
137
|
+
descendants: Be,
|
|
138
|
+
leaves: Pe,
|
|
139
|
+
links: We,
|
|
140
|
+
copy: Ie,
|
|
141
|
+
[Symbol.iterator]: De
|
|
142
|
+
};
|
|
143
|
+
function Ge(t) {
|
|
144
|
+
if (typeof t != "function") throw new Error();
|
|
145
|
+
return t;
|
|
146
|
+
}
|
|
147
|
+
function H() {
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
function V(t) {
|
|
151
|
+
return function() {
|
|
152
|
+
return t;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function je(t) {
|
|
156
|
+
t.x0 = Math.round(t.x0), t.y0 = Math.round(t.y0), t.x1 = Math.round(t.x1), t.y1 = Math.round(t.y1);
|
|
157
|
+
}
|
|
158
|
+
function qe(t, a, n, r, o) {
|
|
159
|
+
for (var s = t.children, d, h = -1, f = s.length, i = t.value && (r - a) / t.value; ++h < f; )
|
|
160
|
+
d = s[h], d.y0 = n, d.y1 = o, d.x0 = a, d.x1 = a += d.value * i;
|
|
161
|
+
}
|
|
162
|
+
function Oe(t, a, n, r, o) {
|
|
163
|
+
for (var s = t.children, d, h = -1, f = s.length, i = t.value && (o - n) / t.value; ++h < f; )
|
|
164
|
+
d = s[h], d.x0 = a, d.x1 = r, d.y0 = n, d.y1 = n += d.value * i;
|
|
165
|
+
}
|
|
166
|
+
var Qe = (1 + Math.sqrt(5)) / 2;
|
|
167
|
+
function _e(t, a, n, r, o, s) {
|
|
168
|
+
for (var d = [], h = a.children, f, i, p = 0, b = 0, l = h.length, v, x, S = a.value, u, y, A, k, N, W, L; p < l; ) {
|
|
169
|
+
v = o - n, x = s - r;
|
|
170
|
+
do
|
|
171
|
+
u = h[b++].value;
|
|
172
|
+
while (!u && b < l);
|
|
173
|
+
for (y = A = u, W = Math.max(x / v, v / x) / (S * t), L = u * u * W, N = Math.max(A / L, L / y); b < l; ++b) {
|
|
174
|
+
if (u += i = h[b].value, i < y && (y = i), i > A && (A = i), L = u * u * W, k = Math.max(A / L, L / y), k > N) {
|
|
175
|
+
u -= i;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
N = k;
|
|
179
|
+
}
|
|
180
|
+
d.push(f = { value: u, dice: v < x, children: h.slice(p, b) }), f.dice ? qe(f, n, r, o, S ? r += x * u / S : s) : Oe(f, n, r, S ? n += v * u / S : o, s), S -= u, p = b;
|
|
181
|
+
}
|
|
182
|
+
return d;
|
|
183
|
+
}
|
|
184
|
+
const Je = function t(a) {
|
|
185
|
+
function n(r, o, s, d, h) {
|
|
186
|
+
_e(a, r, o, s, d, h);
|
|
187
|
+
}
|
|
188
|
+
return n.ratio = function(r) {
|
|
189
|
+
return t((r = +r) > 1 ? r : 1);
|
|
190
|
+
}, n;
|
|
191
|
+
}(Qe);
|
|
192
|
+
function Ke() {
|
|
193
|
+
var t = Je, a = !1, n = 1, r = 1, o = [0], s = H, d = H, h = H, f = H, i = H;
|
|
194
|
+
function p(l) {
|
|
195
|
+
return l.x0 = l.y0 = 0, l.x1 = n, l.y1 = r, l.eachBefore(b), o = [0], a && l.eachBefore(je), l;
|
|
196
|
+
}
|
|
197
|
+
function b(l) {
|
|
198
|
+
var v = o[l.depth], x = l.x0 + v, S = l.y0 + v, u = l.x1 - v, y = l.y1 - v;
|
|
199
|
+
u < x && (x = u = (x + u) / 2), y < S && (S = y = (S + y) / 2), l.x0 = x, l.y0 = S, l.x1 = u, l.y1 = y, l.children && (v = o[l.depth + 1] = s(l) / 2, x += i(l) - v, S += d(l) - v, u -= h(l) - v, y -= f(l) - v, u < x && (x = u = (x + u) / 2), y < S && (S = y = (S + y) / 2), t(l, x, S, u, y));
|
|
200
|
+
}
|
|
201
|
+
return p.round = function(l) {
|
|
202
|
+
return arguments.length ? (a = !!l, p) : a;
|
|
203
|
+
}, p.size = function(l) {
|
|
204
|
+
return arguments.length ? (n = +l[0], r = +l[1], p) : [n, r];
|
|
205
|
+
}, p.tile = function(l) {
|
|
206
|
+
return arguments.length ? (t = Ge(l), p) : t;
|
|
207
|
+
}, p.padding = function(l) {
|
|
208
|
+
return arguments.length ? p.paddingInner(l).paddingOuter(l) : p.paddingInner();
|
|
209
|
+
}, p.paddingInner = function(l) {
|
|
210
|
+
return arguments.length ? (s = typeof l == "function" ? l : V(+l), p) : s;
|
|
211
|
+
}, p.paddingOuter = function(l) {
|
|
212
|
+
return arguments.length ? p.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l) : p.paddingTop();
|
|
213
|
+
}, p.paddingTop = function(l) {
|
|
214
|
+
return arguments.length ? (d = typeof l == "function" ? l : V(+l), p) : d;
|
|
215
|
+
}, p.paddingRight = function(l) {
|
|
216
|
+
return arguments.length ? (h = typeof l == "function" ? l : V(+l), p) : h;
|
|
217
|
+
}, p.paddingBottom = function(l) {
|
|
218
|
+
return arguments.length ? (f = typeof l == "function" ? l : V(+l), p) : f;
|
|
219
|
+
}, p.paddingLeft = function(l) {
|
|
220
|
+
return arguments.length ? (i = typeof l == "function" ? l : V(+l), p) : i;
|
|
221
|
+
}, p;
|
|
222
|
+
}
|
|
223
|
+
var U, ae = (U = class {
|
|
224
|
+
constructor() {
|
|
225
|
+
this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = de, this.getAccTitle = he, this.setDiagramTitle = pe, this.getDiagramTitle = ue, this.getAccDescription = fe, this.setAccDescription = me;
|
|
226
|
+
}
|
|
227
|
+
getNodes() {
|
|
228
|
+
return this.nodes;
|
|
229
|
+
}
|
|
230
|
+
getConfig() {
|
|
231
|
+
const t = ye, a = te();
|
|
232
|
+
return ee({
|
|
233
|
+
...t.treemap,
|
|
234
|
+
...a.treemap ?? {}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
addNode(t, a) {
|
|
238
|
+
this.nodes.push(t), this.levels.set(t, a), a === 0 && (this.outerNodes.push(t), this.root ?? (this.root = t));
|
|
239
|
+
}
|
|
240
|
+
getRoot() {
|
|
241
|
+
return { name: "", children: this.outerNodes };
|
|
242
|
+
}
|
|
243
|
+
addClass(t, a) {
|
|
244
|
+
const n = this.classes.get(t) ?? { id: t, styles: [], textStyles: [] }, r = a.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
|
|
245
|
+
r && r.forEach((o) => {
|
|
246
|
+
ge(o) && (n != null && n.textStyles ? n.textStyles.push(o) : n.textStyles = [o]), n != null && n.styles ? n.styles.push(o) : n.styles = [o];
|
|
247
|
+
}), this.classes.set(t, n);
|
|
248
|
+
}
|
|
249
|
+
getClasses() {
|
|
250
|
+
return this.classes;
|
|
251
|
+
}
|
|
252
|
+
getStylesForClass(t) {
|
|
253
|
+
var a;
|
|
254
|
+
return ((a = this.classes.get(t)) == null ? void 0 : a.styles) ?? [];
|
|
255
|
+
}
|
|
256
|
+
clear() {
|
|
257
|
+
xe(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
|
|
258
|
+
}
|
|
259
|
+
}, w(U, "TreeMapDB"), U);
|
|
260
|
+
function ne(t) {
|
|
261
|
+
if (!t.length)
|
|
262
|
+
return [];
|
|
263
|
+
const a = [], n = [];
|
|
264
|
+
return t.forEach((r) => {
|
|
265
|
+
const o = {
|
|
266
|
+
name: r.name,
|
|
267
|
+
children: r.type === "Leaf" ? void 0 : []
|
|
268
|
+
};
|
|
269
|
+
for (o.classSelector = r == null ? void 0 : r.classSelector, r != null && r.cssCompiledStyles && (o.cssCompiledStyles = [r.cssCompiledStyles]), r.type === "Leaf" && r.value !== void 0 && (o.value = r.value); n.length > 0 && n[n.length - 1].level >= r.level; )
|
|
270
|
+
n.pop();
|
|
271
|
+
if (n.length === 0)
|
|
272
|
+
a.push(o);
|
|
273
|
+
else {
|
|
274
|
+
const s = n[n.length - 1].node;
|
|
275
|
+
s.children ? s.children.push(o) : s.children = [o];
|
|
276
|
+
}
|
|
277
|
+
r.type !== "Leaf" && n.push({ node: o, level: r.level });
|
|
278
|
+
}), a;
|
|
279
|
+
}
|
|
280
|
+
w(ne, "buildHierarchy");
|
|
281
|
+
var Ue = /* @__PURE__ */ w((t, a) => {
|
|
282
|
+
ve(t, a);
|
|
283
|
+
const n = [];
|
|
284
|
+
for (const s of t.TreemapRows ?? [])
|
|
285
|
+
s.$type === "ClassDefStatement" && a.addClass(s.className ?? "", s.styleText ?? "");
|
|
286
|
+
for (const s of t.TreemapRows ?? []) {
|
|
287
|
+
const d = s.item;
|
|
288
|
+
if (!d)
|
|
289
|
+
continue;
|
|
290
|
+
const h = s.indent ? parseInt(s.indent) : 0, f = Xe(d), i = d.classSelector ? a.getStylesForClass(d.classSelector) : [], p = i.length > 0 ? i.join(";") : void 0, b = {
|
|
291
|
+
level: h,
|
|
292
|
+
name: f,
|
|
293
|
+
type: d.$type,
|
|
294
|
+
value: d.value,
|
|
295
|
+
classSelector: d.classSelector,
|
|
296
|
+
cssCompiledStyles: p
|
|
297
|
+
};
|
|
298
|
+
n.push(b);
|
|
299
|
+
}
|
|
300
|
+
const r = ne(n), o = /* @__PURE__ */ w((s, d) => {
|
|
301
|
+
for (const h of s)
|
|
302
|
+
a.addNode(h, d), h.children && h.children.length > 0 && o(h.children, d + 1);
|
|
303
|
+
}, "addNodesRecursively");
|
|
304
|
+
o(r, 0);
|
|
305
|
+
}, "populate"), Xe = /* @__PURE__ */ w((t) => t.name ? String(t.name) : "", "getItemName"), re = {
|
|
306
|
+
// @ts-expect-error - TreeMapDB is not assignable to DiagramDB
|
|
307
|
+
parser: { yy: void 0 },
|
|
308
|
+
parse: /* @__PURE__ */ w(async (t) => {
|
|
309
|
+
var a;
|
|
310
|
+
try {
|
|
311
|
+
const n = await be("treemap", t);
|
|
312
|
+
X.debug("Treemap AST:", n);
|
|
313
|
+
const r = (a = re.parser) == null ? void 0 : a.yy;
|
|
314
|
+
if (!(r instanceof ae))
|
|
315
|
+
throw new Error(
|
|
316
|
+
"parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
317
|
+
);
|
|
318
|
+
Ue(n, r);
|
|
319
|
+
} catch (n) {
|
|
320
|
+
throw X.error("Error parsing treemap:", n), n;
|
|
321
|
+
}
|
|
322
|
+
}, "parse")
|
|
323
|
+
}, Ye = 10, P = 10, G = 25, Ze = /* @__PURE__ */ w((t, a, n, r) => {
|
|
324
|
+
const o = r.db, s = o.getConfig(), d = s.padding ?? Ye, h = o.getDiagramTitle(), f = o.getRoot(), { themeVariables: i } = te();
|
|
325
|
+
if (!f)
|
|
326
|
+
return;
|
|
327
|
+
const p = h ? 30 : 0, b = ie(a), l = s.nodeWidth ? s.nodeWidth * P : 960, v = s.nodeHeight ? s.nodeHeight * P : 500, x = l, S = v + p;
|
|
328
|
+
b.attr("viewBox", `0 0 ${x} ${S}`), ce(b, S, x, s.useMaxWidth);
|
|
329
|
+
let u;
|
|
330
|
+
try {
|
|
331
|
+
const e = s.valueFormat || ",";
|
|
332
|
+
if (e === "$0,0")
|
|
333
|
+
u = /* @__PURE__ */ w((c) => "$" + R(",")(c), "valueFormat");
|
|
334
|
+
else if (e.startsWith("$") && e.includes(",")) {
|
|
335
|
+
const c = /\.\d+/.exec(e), g = c ? c[0] : "";
|
|
336
|
+
u = /* @__PURE__ */ w((C) => "$" + R("," + g)(C), "valueFormat");
|
|
337
|
+
} else if (e.startsWith("$")) {
|
|
338
|
+
const c = e.substring(1);
|
|
339
|
+
u = /* @__PURE__ */ w((g) => "$" + R(c || "")(g), "valueFormat");
|
|
340
|
+
} else
|
|
341
|
+
u = R(e);
|
|
342
|
+
} catch (e) {
|
|
343
|
+
X.error("Error creating format function:", e), u = R(",");
|
|
344
|
+
}
|
|
345
|
+
const y = K().range([
|
|
346
|
+
"transparent",
|
|
347
|
+
i.cScale0,
|
|
348
|
+
i.cScale1,
|
|
349
|
+
i.cScale2,
|
|
350
|
+
i.cScale3,
|
|
351
|
+
i.cScale4,
|
|
352
|
+
i.cScale5,
|
|
353
|
+
i.cScale6,
|
|
354
|
+
i.cScale7,
|
|
355
|
+
i.cScale8,
|
|
356
|
+
i.cScale9,
|
|
357
|
+
i.cScale10,
|
|
358
|
+
i.cScale11
|
|
359
|
+
]), A = K().range([
|
|
360
|
+
"transparent",
|
|
361
|
+
i.cScalePeer0,
|
|
362
|
+
i.cScalePeer1,
|
|
363
|
+
i.cScalePeer2,
|
|
364
|
+
i.cScalePeer3,
|
|
365
|
+
i.cScalePeer4,
|
|
366
|
+
i.cScalePeer5,
|
|
367
|
+
i.cScalePeer6,
|
|
368
|
+
i.cScalePeer7,
|
|
369
|
+
i.cScalePeer8,
|
|
370
|
+
i.cScalePeer9,
|
|
371
|
+
i.cScalePeer10,
|
|
372
|
+
i.cScalePeer11
|
|
373
|
+
]), k = K().range([
|
|
374
|
+
i.cScaleLabel0,
|
|
375
|
+
i.cScaleLabel1,
|
|
376
|
+
i.cScaleLabel2,
|
|
377
|
+
i.cScaleLabel3,
|
|
378
|
+
i.cScaleLabel4,
|
|
379
|
+
i.cScaleLabel5,
|
|
380
|
+
i.cScaleLabel6,
|
|
381
|
+
i.cScaleLabel7,
|
|
382
|
+
i.cScaleLabel8,
|
|
383
|
+
i.cScaleLabel9,
|
|
384
|
+
i.cScaleLabel10,
|
|
385
|
+
i.cScaleLabel11
|
|
386
|
+
]);
|
|
387
|
+
h && b.append("text").attr("x", x / 2).attr("y", p / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(h);
|
|
388
|
+
const N = b.append("g").attr("transform", `translate(0, ${p})`).attr("class", "treemapContainer"), W = Y(f).sum((e) => e.value ?? 0).sort((e, c) => (c.value ?? 0) - (e.value ?? 0)), L = Ke().size([l, v]).paddingTop(
|
|
389
|
+
(e) => e.children && e.children.length > 0 ? G + P : 0
|
|
390
|
+
).paddingInner(d).paddingLeft((e) => e.children && e.children.length > 0 ? P : 0).paddingRight((e) => e.children && e.children.length > 0 ? P : 0).paddingBottom((e) => e.children && e.children.length > 0 ? P : 0).round(!0)(W), le = L.descendants().filter((e) => e.children && e.children.length > 0), D = N.selectAll(".treemapSection").data(le).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
391
|
+
D.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", G).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), D.append("clipPath").attr("id", (e, c) => `clip-section-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", G), D.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, c) => `treemapSection section${c}`).attr("fill", (e) => y(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => A(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
|
|
392
|
+
if (e.depth === 0)
|
|
393
|
+
return "display: none;";
|
|
394
|
+
const c = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
395
|
+
return c.nodeStyles + ";" + c.borderStyles.join(";");
|
|
396
|
+
}), D.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", G / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("style", (e) => {
|
|
397
|
+
if (e.depth === 0)
|
|
398
|
+
return "display: none;";
|
|
399
|
+
const c = "dominant-baseline: middle; font-size: 12px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", g = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
400
|
+
return c + g.labelStyles.replace("color:", "fill:");
|
|
401
|
+
}).each(function(e) {
|
|
402
|
+
if (e.depth === 0)
|
|
403
|
+
return;
|
|
404
|
+
const c = _(this), g = e.data.name;
|
|
405
|
+
c.text(g);
|
|
406
|
+
const C = e.x1 - e.x0, M = 6;
|
|
407
|
+
let z;
|
|
408
|
+
s.showValues !== !1 && e.value ? z = C - 10 - 30 - 10 - M : z = C - M - 6;
|
|
409
|
+
const T = Math.max(15, z), $ = c.node();
|
|
410
|
+
if ($.getComputedTextLength() > T) {
|
|
411
|
+
let m = g;
|
|
412
|
+
for (; m.length > 0; ) {
|
|
413
|
+
if (m = g.substring(0, m.length - 1), m.length === 0) {
|
|
414
|
+
c.text("..."), $.getComputedTextLength() > T && c.text("");
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
if (c.text(m + "..."), $.getComputedTextLength() <= T)
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}), s.showValues !== !1 && D.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", G / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? u(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
|
|
422
|
+
if (e.depth === 0)
|
|
423
|
+
return "display: none;";
|
|
424
|
+
const c = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", g = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
425
|
+
return c + g.labelStyles.replace("color:", "fill:");
|
|
426
|
+
});
|
|
427
|
+
const se = L.leaves(), j = N.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class", (e, c) => `treemapNode treemapLeafGroup leaf${c}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
428
|
+
j.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", "treemapLeaf").attr("fill", (e) => e.parent ? y(e.parent.data.name) : y(e.data.name)).attr("style", (e) => B({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? y(e.parent.data.name) : y(e.data.name)).attr("stroke-width", 3), j.append("clipPath").attr("id", (e, c) => `clip-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), j.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
|
|
429
|
+
const c = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + k(e.data.name) + ";", g = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
430
|
+
return c + g.labelStyles.replace("color:", "fill:");
|
|
431
|
+
}).attr("clip-path", (e, c) => `url(#clip-${a}-${c})`).text((e) => e.data.name).each(function(e) {
|
|
432
|
+
const c = _(this), g = e.x1 - e.x0, C = e.y1 - e.y0, M = c.node(), z = 4, T = g - 2 * z, $ = C - 2 * z;
|
|
433
|
+
if (T < 10 || $ < 10) {
|
|
434
|
+
c.style("display", "none");
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
let m = parseInt(c.style("font-size"), 10);
|
|
438
|
+
const F = 8, I = 28, q = 0.6, E = 6, O = 2;
|
|
439
|
+
for (; M.getComputedTextLength() > T && m > F; )
|
|
440
|
+
m--, c.style("font-size", `${m}px`);
|
|
441
|
+
let Q = Math.max(
|
|
442
|
+
E,
|
|
443
|
+
Math.min(I, Math.round(m * q))
|
|
444
|
+
), Z = m + O + Q;
|
|
445
|
+
for (; Z > $ && m > F && (m--, Q = Math.max(
|
|
446
|
+
E,
|
|
447
|
+
Math.min(I, Math.round(m * q))
|
|
448
|
+
), !(Q < E && m === F)); )
|
|
449
|
+
c.style("font-size", `${m}px`), Z = m + O + Q;
|
|
450
|
+
c.style("font-size", `${m}px`), (M.getComputedTextLength() > T || m < F || $ < m) && c.style("display", "none");
|
|
451
|
+
}), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", function(e) {
|
|
452
|
+
return (e.y1 - e.y0) / 2;
|
|
453
|
+
}).attr("style", (e) => {
|
|
454
|
+
const c = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + k(e.data.name) + ";", g = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
455
|
+
return c + g.labelStyles.replace("color:", "fill:");
|
|
456
|
+
}).attr("clip-path", (e, c) => `url(#clip-${a}-${c})`).text((e) => e.value ? u(e.value) : "").each(function(e) {
|
|
457
|
+
const c = _(this), g = this.parentNode;
|
|
458
|
+
if (!g) {
|
|
459
|
+
c.style("display", "none");
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const C = _(g).select(".treemapLabel");
|
|
463
|
+
if (C.empty() || C.style("display") === "none") {
|
|
464
|
+
c.style("display", "none");
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const M = parseFloat(C.style("font-size")), z = 28, T = 0.6, $ = 6, m = 2, F = Math.max(
|
|
468
|
+
$,
|
|
469
|
+
Math.min(z, Math.round(M * T))
|
|
470
|
+
);
|
|
471
|
+
c.style("font-size", `${F}px`);
|
|
472
|
+
const I = (e.y1 - e.y0) / 2 + M / 2 + m;
|
|
473
|
+
c.attr("y", I);
|
|
474
|
+
const q = e.x1 - e.x0, E = e.y1 - e.y0 - 4, O = q - 8;
|
|
475
|
+
c.node().getComputedTextLength() > O || I + F > E || F < $ ? c.style("display", "none") : c.style("display", null);
|
|
476
|
+
});
|
|
477
|
+
const oe = s.diagramPadding ?? 8;
|
|
478
|
+
Se(b, oe, "flowchart", (s == null ? void 0 : s.useMaxWidth) || !1);
|
|
479
|
+
}, "draw"), et = /* @__PURE__ */ w(function(t, a) {
|
|
480
|
+
return a.db.getClasses();
|
|
481
|
+
}, "getClasses"), tt = { draw: Ze, getClasses: et }, at = {
|
|
482
|
+
sectionStrokeColor: "black",
|
|
483
|
+
sectionStrokeWidth: "1",
|
|
484
|
+
sectionFillColor: "#efefef",
|
|
485
|
+
leafStrokeColor: "black",
|
|
486
|
+
leafStrokeWidth: "1",
|
|
487
|
+
leafFillColor: "#efefef",
|
|
488
|
+
labelColor: "black",
|
|
489
|
+
labelFontSize: "12px",
|
|
490
|
+
valueFontSize: "10px",
|
|
491
|
+
valueColor: "black",
|
|
492
|
+
titleColor: "black",
|
|
493
|
+
titleFontSize: "14px"
|
|
494
|
+
}, nt = /* @__PURE__ */ w(({
|
|
495
|
+
treemap: t
|
|
496
|
+
} = {}) => {
|
|
497
|
+
const a = ee(at, t);
|
|
498
|
+
return `
|
|
499
|
+
.treemapNode.section {
|
|
500
|
+
stroke: ${a.sectionStrokeColor};
|
|
501
|
+
stroke-width: ${a.sectionStrokeWidth};
|
|
502
|
+
fill: ${a.sectionFillColor};
|
|
503
|
+
}
|
|
504
|
+
.treemapNode.leaf {
|
|
505
|
+
stroke: ${a.leafStrokeColor};
|
|
506
|
+
stroke-width: ${a.leafStrokeWidth};
|
|
507
|
+
fill: ${a.leafFillColor};
|
|
508
|
+
}
|
|
509
|
+
.treemapLabel {
|
|
510
|
+
fill: ${a.labelColor};
|
|
511
|
+
font-size: ${a.labelFontSize};
|
|
512
|
+
}
|
|
513
|
+
.treemapValue {
|
|
514
|
+
fill: ${a.valueColor};
|
|
515
|
+
font-size: ${a.valueFontSize};
|
|
516
|
+
}
|
|
517
|
+
.treemapTitle {
|
|
518
|
+
fill: ${a.titleColor};
|
|
519
|
+
font-size: ${a.titleFontSize};
|
|
520
|
+
}
|
|
521
|
+
`;
|
|
522
|
+
}, "getStyles"), rt = nt, ct = {
|
|
523
|
+
parser: re,
|
|
524
|
+
get db() {
|
|
525
|
+
return new ae();
|
|
526
|
+
},
|
|
527
|
+
renderer: tt,
|
|
528
|
+
styles: rt
|
|
529
|
+
};
|
|
530
|
+
export {
|
|
531
|
+
ct as diagram
|
|
532
|
+
};
|