@dpuse/dpuse-tool-d3-visualiser 1.0.112 → 1.0.121

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 (41) hide show
  1. package/README.md +203 -240
  2. package/dist/chordDiagram-Cm91Tmgo.js +1729 -0
  3. package/dist/d3-hierarchy-Dtx4jD78.js +269 -0
  4. package/dist/{linear-DytAYqu2.js → d3-scale-BYykLEPO.js} +271 -245
  5. package/dist/{select-Bs4oiNEZ.js → d3-selection-CL8c_tE2.js} +233 -281
  6. package/dist/d3-shape-gf8U18pS.js +1133 -0
  7. package/dist/dpuse-tool-d3-visualiser.es.js +7 -8
  8. package/dist/{erdDiagram-CHPY-zaP.js → erdDiagram-DmYSx8Dh.js} +78 -65
  9. package/dist/networkDiagram-p5z5B_vZ.js +1005 -0
  10. package/dist/{palette-Ca7C6aNE.js → palette-D5DTPmuA.js} +2 -4
  11. package/dist/{sankeyDiagram-w2TGSqb7.js → sankeyDiagram-Dbl1-v5p.js} +38 -45
  12. package/dist/shipped-packages.json +12 -21
  13. package/dist/{src-Bo8my4B8.js → src-YHHReglY.js} +71 -109
  14. package/dist/{string-iJh48M7Y.js → string-BzfQLSds.js} +7 -14
  15. package/dist/{tanStackCharts-LPqRQGD9.js → tanStackCharts-DEINbmRi.js} +1228 -1350
  16. package/dist/treeDiagram-t0oFwi1c.js +49 -0
  17. package/dist/types/src/networkDiagram.d.ts +4 -0
  18. package/package.json +28 -25
  19. package/dist/array-Cv4-2llb.js +0 -14
  20. package/dist/array-Cv4-2llb.js.map +0 -1
  21. package/dist/chordDiagram-BG0jW2g9.js +0 -3663
  22. package/dist/chordDiagram-BG0jW2g9.js.map +0 -1
  23. package/dist/dpuse-tool-d3-visualiser.es.js.map +0 -1
  24. package/dist/erdDiagram-CHPY-zaP.js.map +0 -1
  25. package/dist/hierarchy-CDFAetye.js +0 -149
  26. package/dist/hierarchy-CDFAetye.js.map +0 -1
  27. package/dist/linear-DytAYqu2.js.map +0 -1
  28. package/dist/link-BfoIl3p5.js +0 -64
  29. package/dist/link-BfoIl3p5.js.map +0 -1
  30. package/dist/networkDiagram-XI0c9kJR.js +0 -1029
  31. package/dist/networkDiagram-XI0c9kJR.js.map +0 -1
  32. package/dist/palette-Ca7C6aNE.js.map +0 -1
  33. package/dist/point-DSPrfIZi.js +0 -88
  34. package/dist/point-DSPrfIZi.js.map +0 -1
  35. package/dist/sankeyDiagram-w2TGSqb7.js.map +0 -1
  36. package/dist/select-Bs4oiNEZ.js.map +0 -1
  37. package/dist/src-Bo8my4B8.js.map +0 -1
  38. package/dist/string-iJh48M7Y.js.map +0 -1
  39. package/dist/tanStackCharts-LPqRQGD9.js.map +0 -1
  40. package/dist/treeDiagram-C798R8hL.js +0 -128
  41. package/dist/treeDiagram-C798R8hL.js.map +0 -1
@@ -0,0 +1,1729 @@
1
+ import { i as e, r as t, t as n } from "./palette-D5DTPmuA.js";
2
+ import { n as r, t as i } from "./d3-hierarchy-Dtx4jD78.js";
3
+ import { a, i as o, r as s, s as c } from "./d3-scale-BYykLEPO.js";
4
+ import { D as l, E as u, S as d, T as f, a as p, b as m, c as h, d as g, f as _, g as v, i as y, k as ee, l as b, n as x, o as S, p as te, r as ne, s as re, t as ie, u as ae, v as oe, y as se } from "./d3-shape-gf8U18pS.js";
5
+ import { i as C } from "./d3-selection-CL8c_tE2.js";
6
+ import { a as ce, o as le } from "./string-BzfQLSds.js";
7
+ import { t as ue } from "./src-YHHReglY.js";
8
+ // \0rolldown/runtime.js
9
+ var de = Object.defineProperty, fe = (e, t) => {
10
+ let n = {};
11
+ for (var r in e) de(n, r, {
12
+ get: e[r],
13
+ enumerable: !0
14
+ });
15
+ return t || de(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ }, pe = "comm", me = "rule", he = "decl", ge = "@import", _e = "@keyframes", ve = "@layer", ye = Math.abs, be = String.fromCharCode;
17
+ function xe(e) {
18
+ return e.trim();
19
+ }
20
+ function Se(e, t, n) {
21
+ return e.replace(t, n);
22
+ }
23
+ function Ce(e, t) {
24
+ return e.indexOf(t);
25
+ }
26
+ function w(e, t) {
27
+ return e.charCodeAt(t) | 0;
28
+ }
29
+ function T(e, t, n) {
30
+ return e.slice(t, n);
31
+ }
32
+ function E(e) {
33
+ return e.length;
34
+ }
35
+ function we(e) {
36
+ return e.length;
37
+ }
38
+ function Te(e, t) {
39
+ return t.push(e), e;
40
+ }
41
+ // node_modules/stylis/src/Tokenizer.js
42
+ var Ee = 1, D = 1, De = 0, O = 0, k = 0, A = "";
43
+ function Oe(e, t, n, r, i, a, o) {
44
+ return {
45
+ value: e,
46
+ root: t,
47
+ parent: n,
48
+ type: r,
49
+ props: i,
50
+ children: a,
51
+ line: Ee,
52
+ column: D,
53
+ length: o,
54
+ return: ""
55
+ };
56
+ }
57
+ function ke() {
58
+ return k;
59
+ }
60
+ function Ae() {
61
+ return k = O > 0 ? w(A, --O) : 0, D--, k === 10 && (D = 1, Ee--), k;
62
+ }
63
+ function j() {
64
+ return k = O < De ? w(A, O++) : 0, D++, k === 10 && (D = 1, Ee++), k;
65
+ }
66
+ function M() {
67
+ return w(A, O);
68
+ }
69
+ function je() {
70
+ return O;
71
+ }
72
+ function Me(e, t) {
73
+ return T(A, e, t);
74
+ }
75
+ function Ne(e) {
76
+ switch (e) {
77
+ case 0:
78
+ case 9:
79
+ case 10:
80
+ case 13:
81
+ case 32: return 5;
82
+ case 33:
83
+ case 43:
84
+ case 44:
85
+ case 47:
86
+ case 62:
87
+ case 64:
88
+ case 126:
89
+ case 59:
90
+ case 123:
91
+ case 125: return 4;
92
+ case 58: return 3;
93
+ case 34:
94
+ case 39:
95
+ case 40:
96
+ case 91: return 2;
97
+ case 41:
98
+ case 93: return 1;
99
+ }
100
+ return 0;
101
+ }
102
+ function Pe(e) {
103
+ return Ee = D = 1, De = E(A = e), O = 0, [];
104
+ }
105
+ function Fe(e) {
106
+ return A = "", e;
107
+ }
108
+ function Ie(e) {
109
+ return xe(Me(O - 1, ze(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
110
+ }
111
+ function Le(e) {
112
+ for (; (k = M()) && k < 33;) j();
113
+ return Ne(e) > 2 || Ne(k) > 3 ? "" : " ";
114
+ }
115
+ function Re(e, t) {
116
+ for (; --t && j() && !(k < 48 || k > 102 || k > 57 && k < 65 || k > 70 && k < 97););
117
+ return Me(e, je() + (t < 6 && M() == 32 && j() == 32));
118
+ }
119
+ function ze(e) {
120
+ for (; j();) switch (k) {
121
+ case e: return O;
122
+ case 34:
123
+ case 39:
124
+ e !== 34 && e !== 39 && ze(k);
125
+ break;
126
+ case 40:
127
+ e === 41 && ze(e);
128
+ break;
129
+ case 92: j();
130
+ }
131
+ return O;
132
+ }
133
+ function Be(e, t) {
134
+ for (; j() && e + k !== 57 && (e + k !== 84 || M() !== 47););
135
+ return "/*" + Me(t, O - 1) + "*" + be(e === 47 ? e : j());
136
+ }
137
+ function Ve(e) {
138
+ for (; !Ne(M());) j();
139
+ return Me(e, O);
140
+ }
141
+ // node_modules/stylis/src/Parser.js
142
+ function He(e) {
143
+ return Fe(Ue("", null, null, null, [""], e = Pe(e), 0, [0], e));
144
+ }
145
+ function Ue(e, t, n, r, i, a, o, s, c) {
146
+ for (var l = 0, u = 0, d = o, f = 0, p = 0, m = 0, h = 1, g = 1, _ = 1, v = 0, y = "", ee = i, b = a, x = r, S = y; g;) switch (m = v, v = j()) {
147
+ case 40: if (m != 108 && w(S, d - 1) == 58) {
148
+ Ce(S += Se(Ie(v), "&", "&\f"), "&\f") != -1 && (_ = -1);
149
+ break;
150
+ }
151
+ case 34:
152
+ case 39:
153
+ case 91:
154
+ S += Ie(v);
155
+ break;
156
+ case 9:
157
+ case 10:
158
+ case 13:
159
+ case 32:
160
+ S += Le(m);
161
+ break;
162
+ case 92:
163
+ S += Re(je() - 1, 7);
164
+ continue;
165
+ case 47:
166
+ switch (M()) {
167
+ case 42:
168
+ case 47:
169
+ Te(Ge(Be(j(), je()), t, n), c);
170
+ break;
171
+ default: S += "/";
172
+ }
173
+ break;
174
+ case 123 * h: s[l++] = E(S) * _;
175
+ case 125 * h:
176
+ case 59:
177
+ case 0:
178
+ switch (v) {
179
+ case 0:
180
+ case 125: g = 0;
181
+ case 59 + u:
182
+ _ == -1 && (S = Se(S, /\f/g, "")), p > 0 && E(S) - d && Te(p > 32 ? Ke(S + ";", r, n, d - 1) : Ke(Se(S, " ", "") + ";", r, n, d - 2), c);
183
+ break;
184
+ case 59: S += ";";
185
+ default: if (Te(x = We(S, t, n, l, u, i, s, y, ee = [], b = [], d), a), v === 123) {
186
+ if (u === 0) Ue(S, t, x, x, ee, a, d, s, b);
187
+ else switch (f === 99 && w(S, 3) === 110 ? 100 : f) {
188
+ case 100:
189
+ case 108:
190
+ case 109:
191
+ case 115:
192
+ Ue(e, x, x, r && Te(We(e, x, x, 0, 0, i, s, y, i, ee = [], d), b), i, b, d, s, r ? ee : b);
193
+ break;
194
+ default: Ue(S, x, x, x, [""], b, 0, s, b);
195
+ }
196
+ }
197
+ }
198
+ l = u = p = 0, h = _ = 1, y = S = "", d = o;
199
+ break;
200
+ case 58: d = 1 + E(S), p = m;
201
+ default:
202
+ if (h < 1) {
203
+ if (v == 123) --h;
204
+ else if (v == 125 && h++ == 0 && Ae() == 125) continue;
205
+ }
206
+ switch (S += be(v), v * h) {
207
+ case 38:
208
+ _ = u > 0 ? 1 : (S += "\f", -1);
209
+ break;
210
+ case 44:
211
+ s[l++] = (E(S) - 1) * _, _ = 1;
212
+ break;
213
+ case 64:
214
+ M() === 45 && (S += Ie(j())), f = M(), u = d = E(y = S += Ve(je())), v++;
215
+ break;
216
+ case 45: m === 45 && E(S) == 2 && (h = 0);
217
+ }
218
+ }
219
+ return a;
220
+ }
221
+ function We(e, t, n, r, i, a, o, s, c, l, u) {
222
+ for (var d = i - 1, f = i === 0 ? a : [""], p = we(f), m = 0, h = 0, g = 0; m < r; ++m) for (var _ = 0, v = T(e, d + 1, d = ye(h = o[m])), y = e; _ < p; ++_) (y = xe(h > 0 ? f[_] + " " + v : Se(v, /&\f/g, f[_]))) && (c[g++] = y);
223
+ return Oe(e, t, n, i === 0 ? me : s, c, l, u);
224
+ }
225
+ function Ge(e, t, n) {
226
+ return Oe(e, t, n, pe, be(ke()), T(e, 2, -2), 0);
227
+ }
228
+ function Ke(e, t, n, r) {
229
+ return Oe(e, t, n, he, T(e, 0, r), T(e, r + 1, -1), r);
230
+ }
231
+ // node_modules/stylis/src/Serializer.js
232
+ function qe(e, t) {
233
+ for (var n = "", r = we(e), i = 0; i < r; i++) n += t(e[i], i, e, t) || "";
234
+ return n;
235
+ }
236
+ function Je(e, t, n, r) {
237
+ switch (e.type) {
238
+ case ve: if (e.children.length) break;
239
+ case ge:
240
+ case he: return e.return = e.return || e.value;
241
+ case pe: return "";
242
+ case _e: return e.return = e.value + "{" + qe(e.children, r) + "}";
243
+ case me: e.value = e.props.join(",");
244
+ }
245
+ return E(n = qe(e.children, r)) ? e.return = e.value + "{" + n + "}" : "";
246
+ }
247
+ // node_modules/stylis/src/Middleware.js
248
+ function Ye(e) {
249
+ var t = we(e);
250
+ return function(n, r, i, a) {
251
+ for (var o = "", s = 0; s < t; s++) o += e[s](n, r, i, a) || "";
252
+ return o;
253
+ };
254
+ }
255
+ // node_modules/d3-array/src/identity.js
256
+ function Xe(e) {
257
+ return e;
258
+ }
259
+ // node_modules/d3-array/src/group.js
260
+ function Ze(e, ...t) {
261
+ return et(e, Xe, Xe, t);
262
+ }
263
+ function Qe(e, ...t) {
264
+ return et(e, Xe, $e, t);
265
+ }
266
+ function $e(e) {
267
+ if (e.length !== 1) throw Error("duplicate key");
268
+ return e[0];
269
+ }
270
+ function et(e, t, n, r) {
271
+ return (function e(i, a) {
272
+ if (a >= r.length) return n(i);
273
+ let o = new c(), s = r[a++], l = -1;
274
+ for (let e of i) {
275
+ let t = s(e, ++l, i), n = o.get(t);
276
+ n ? n.push(e) : o.set(t, [e]);
277
+ }
278
+ for (let [t, n] of o) o.set(t, e(n, a));
279
+ return t(o);
280
+ })(e, 0);
281
+ }
282
+ // node_modules/throttle-debounce/esm/index.js
283
+ function tt(e, t, n) {
284
+ var r = n || {}, i = r.noTrailing, a = i !== void 0 && i, o = r.noLeading, s = o !== void 0 && o, c = r.debounceMode, l = c === void 0 ? void 0 : c, u, d = !1, f = 0;
285
+ function p() {
286
+ u && clearTimeout(u);
287
+ }
288
+ function m(e) {
289
+ var t = (e || {}).upcomingOnly, n = t !== void 0 && t;
290
+ p(), d = !n;
291
+ }
292
+ function h() {
293
+ var n = [...arguments], r = this, i = Date.now() - f;
294
+ if (d) return;
295
+ function o() {
296
+ f = Date.now(), t.apply(r, n);
297
+ }
298
+ function c() {
299
+ u = void 0;
300
+ }
301
+ !s && l && !u && o(), p(), l === void 0 && i > e ? s ? (f = Date.now(), a || (u = setTimeout(l ? c : o, e))) : o() : a !== !0 && (u = setTimeout(l ? c : o, l === void 0 ? e - i : e));
302
+ }
303
+ return h.cancel = m, h;
304
+ }
305
+ // node_modules/@unovis/ts/utils/data.js
306
+ var N = (e) => typeof e == "number", nt = (e) => typeof e == "function", rt = (e) => e === void 0, P = (e) => typeof e == "string", it = (e) => Array.isArray(e), at = (e) => e instanceof Object, ot = (e) => !!e?.constructor?.name && e.constructor.name !== "Function" && e.constructor.name !== "Object", F = (e) => at(e) && !it(e) && !nt(e) && !ot(e), st = (e, t, n = [], r = /* @__PURE__ */ new Set()) => {
307
+ if (e === t) return !0;
308
+ if (Array.isArray(e)) {
309
+ if (!Array.isArray(t) || e.length !== t.length) return !1;
310
+ if (r.has(e)) return !0;
311
+ r.add(e);
312
+ for (let i = 0; i < e.length; i++) if (!st(e[i], t[i], n, r)) return !1;
313
+ return r.delete(e), !0;
314
+ }
315
+ if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
316
+ if (typeof e == "object" && e && t !== null) {
317
+ if (typeof t != "object") return !1;
318
+ let i = Object.keys(e).filter((e) => !n.includes(e)), a = Object.keys(t).filter((e) => !n.includes(e));
319
+ if (i.length !== a.length) return !1;
320
+ if (r.has(e)) return !0;
321
+ r.add(e);
322
+ for (let a of i) if (!st(e[a], t[a], n, r)) return !1;
323
+ return r.delete(e), !0;
324
+ }
325
+ return e === t;
326
+ }, ct = (e, t) => {
327
+ let n = { ...e };
328
+ for (let r of Object.keys(t ?? {})) {
329
+ if (r === "__proto__" || r === "constructor") continue;
330
+ let i = e?.[r], a = t[r];
331
+ n[r] = F(i) && F(a) ? ct(i, a) : a;
332
+ }
333
+ return n;
334
+ }, lt = (e, t) => e.reduce((e, n, r, i, a = t(n, r)) => ((e[a] || (e[a] = [])).push(n), e), {}), ut = (e, t, n) => tt(t, e, n);
335
+ function I(e, t, n) {
336
+ return nt(t) ? t(e, n) : t;
337
+ }
338
+ function dt(e, t, n) {
339
+ return I(e, t, n);
340
+ }
341
+ function L(e, t, n) {
342
+ return I(e, t, n);
343
+ }
344
+ function ft(e, t, n) {
345
+ return Math.min(Math.max(e, t), n);
346
+ }
347
+ // node_modules/@unovis/ts/styles/constants.js
348
+ var pt = "unovis", mt = "data-unovis", ht = /(?:^|[\s;{])label:\s*([^\s;{]+)\s*(?:;|$)/g, gt = [
349
+ "user-select",
350
+ "backdrop-filter",
351
+ "mask"
352
+ ], _t = globalThis?.UNOVIS_NONCE, vt = /* @__PURE__ */ new Set(), yt = /* @__PURE__ */ new Set(), R, bt = Ye([
353
+ (e) => {
354
+ e.type === "decl" && e.props === "label" && (e.return = e.value = "");
355
+ },
356
+ (e) => {
357
+ e.type === "decl" && gt.includes(e.props) && (e.return = `-webkit-${e.value}${e.value}`);
358
+ },
359
+ Je
360
+ ]);
361
+ function xt(e) {
362
+ let t = 5381;
363
+ for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
364
+ return (t >>> 0).toString(36);
365
+ }
366
+ function z(e) {
367
+ if (it(e)) return e.map((e) => `${z(e)};`).join("");
368
+ if (F(e)) {
369
+ let t = e;
370
+ return Object.keys(t).map((e) => {
371
+ let n = t[e];
372
+ if (it(n) || F(n)) return `${e}{${z(n)}}`;
373
+ let r = z(n);
374
+ return r ? `${e}:${r};` : "";
375
+ }).join("");
376
+ }
377
+ return P(e) || N(e) ? `${e}` : "";
378
+ }
379
+ function St(e, t) {
380
+ return P(e) ? e : F(e) ? z(e) : e.map((e, n) => `${e}${n < t.length ? z(t[n]) : ""}`).join("");
381
+ }
382
+ function Ct(e) {
383
+ if (typeof document > "u") return;
384
+ R?.isConnected || (R = document.createElement("style"), R.setAttribute(mt, ""), _t && R.setAttribute("nonce", _t), document.head.appendChild(R));
385
+ let t = R.sheet;
386
+ if (t) for (let n of He(e)) {
387
+ let e = qe([n], bt);
388
+ if (e) try {
389
+ t.insertRule(e, t.cssRules.length);
390
+ } catch {}
391
+ }
392
+ }
393
+ function B(e, ...t) {
394
+ let n = St(e, t), r = "";
395
+ n.replace(ht, (e, t) => (r += `-${t}`, e));
396
+ let i = `${pt}-${xt(n)}${r}`;
397
+ return vt.has(i) || (vt.add(i), Ct(`.${i}{${n}}`)), i;
398
+ }
399
+ function wt(e, ...t) {
400
+ let n = St(e, t), r = xt(n);
401
+ yt.has(r) || (yt.add(r), Ct(n));
402
+ }
403
+ // node_modules/@unovis/ts/types/component.js
404
+ var Tt = /* @__PURE__ */ ((e) => (e[e.SVG = 0] = "SVG", e[e.HTML = 1] = "HTML", e))(Tt || {}), V = /* @__PURE__ */ ((e) => (e.Fit = "fit", e.Extend = "extend", e.FitWidth = "fit_width", e))(V || {});
405
+ function Et(e) {
406
+ let t = e;
407
+ return typeof t?.getWidth == "function" && typeof t?.getHeight == "function";
408
+ }
409
+ // node_modules/@unovis/ts/utils/to-px.js
410
+ function Dt(e) {
411
+ return e = String(e), [parseFloat(e), e.match(/[\d.\-+]*\s*(.*)/)?.[1] || ""];
412
+ }
413
+ function Ot() {
414
+ return typeof window < "u" && typeof document < "u";
415
+ }
416
+ function kt(e, t) {
417
+ let n = Dt(getComputedStyle(e).getPropertyValue(t));
418
+ return n[0] * (U(n[1], e) ?? 1);
419
+ }
420
+ function At(e, t) {
421
+ let n = document.createElement("div");
422
+ n.style.height = `128${e}`, t.appendChild(n);
423
+ let r = kt(n, "height") / 128;
424
+ return t.removeChild(n), r;
425
+ }
426
+ var jt = null;
427
+ function H() {
428
+ return Ot() ? (jt === null && (jt = 96, jt = At("in", document.body)), jt) : 96;
429
+ }
430
+ function U(e, t) {
431
+ if (!e && e !== 0) return null;
432
+ if (!Ot()) {
433
+ let t = Dt(String(e));
434
+ if (!isNaN(t[0])) {
435
+ let e = t[1]?.toLowerCase() || "px";
436
+ if (e === "px" || e === "") return t[0];
437
+ if (e === "em" || e === "rem") return t[0] * 16;
438
+ if (e === "in") return t[0] * 96;
439
+ if (e === "cm") return t[0] * (96 / 2.54);
440
+ if (e === "mm") return t[0] * (96 / 25.4);
441
+ if (e === "pt") return t[0] * (96 / 72);
442
+ if (e === "pc") return t[0] * 16;
443
+ }
444
+ return null;
445
+ }
446
+ let n = document.body;
447
+ t && t !== window && t !== document && (n = t);
448
+ let r = (String(e) || "px").trim().toLowerCase();
449
+ switch (r) {
450
+ case "%": return n.clientHeight / 100;
451
+ case "ch":
452
+ case "ex": return At(r, n);
453
+ case "em": return kt(n, "font-size");
454
+ case "rem": return kt(document.body, "font-size");
455
+ case "vw": return window.innerWidth / 100;
456
+ case "vh": return window.innerHeight / 100;
457
+ case "vmin": return Math.min(window.innerWidth, window.innerHeight) / 100;
458
+ case "vmax": return Math.max(window.innerWidth, window.innerHeight) / 100;
459
+ case "in": return H();
460
+ case "cm": return H() / 2.54;
461
+ case "mm": return H() / 25.4;
462
+ case "pt": return H() / 72;
463
+ case "pc": return H() / 6;
464
+ case "px": return 1;
465
+ }
466
+ let i = Dt(r);
467
+ if (!isNaN(i[0])) {
468
+ if (i[1]) {
469
+ let e = U(i[1], n);
470
+ return typeof e == "number" ? i[0] * e : null;
471
+ }
472
+ return i[0];
473
+ }
474
+ return null;
475
+ }
476
+ // node_modules/@unovis/ts/utils/misc.js
477
+ function Mt() {
478
+ let e = () => Math.floor((1 + crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0]) * 65536).toString(16).substring(1);
479
+ return `${e() + e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`;
480
+ }
481
+ var Nt = /* @__PURE__ */ new WeakMap();
482
+ function Pt(e, t) {
483
+ if (!P(e)) return "";
484
+ let n = e.substr(4, e.length - 5), r = Nt.get(t);
485
+ if (r || (r = /* @__PURE__ */ new Map(), Nt.set(t, r)), r.has(n)) return r.get(n);
486
+ let i = getComputedStyle(t).getPropertyValue(n);
487
+ return r.set(n, i), i;
488
+ }
489
+ function Ft(e, t) {
490
+ return U(Pt(e, t));
491
+ }
492
+ function It(e) {
493
+ return typeof e == "number" ? e : U(e);
494
+ }
495
+ // node_modules/@unovis/ts/core/container/config.js
496
+ var Lt = {
497
+ duration: void 0,
498
+ margin: {
499
+ top: 0,
500
+ bottom: 0,
501
+ left: 0,
502
+ right: 0
503
+ },
504
+ padding: {
505
+ top: 0,
506
+ bottom: 0,
507
+ left: 0,
508
+ right: 0
509
+ },
510
+ sizing: V.Fit,
511
+ width: void 0,
512
+ height: void 0,
513
+ svgDefs: void 0,
514
+ ariaLabel: void 0,
515
+ colorFunction: void 0
516
+ }, Rt = class e {
517
+ constructor(t) {
518
+ this._defaultConfig = Lt, this._isFirstRender = !0, this._renderPromise = null, this._renderPromiseResolve = null, this._renderAnimationFrameId = null, this._container = t;
519
+ let n = C(this._container);
520
+ n.attr("role", "figure"), this.svg = n.append("svg").style("display", "block").attr("xmlns", "http://www.w3.org/2000/svg").attr("height", e.DEFAULT_CONTAINER_HEIGHT).attr("aria-hidden", !0), this._svgDefs = this.svg.append("defs"), this._svgDefsExternal = this.svg.append("defs"), this.element = this.svg.node();
521
+ }
522
+ updateContainer(e) {
523
+ this.prevConfig = this.config, this.config = ct(this._defaultConfig, e), e?.svgDefs !== this.prevConfig?.svgDefs && (this._svgDefsExternal.selectAll("*").remove(), this._svgDefsExternal.html(e.svgDefs));
524
+ }
525
+ _preRender() {}
526
+ _propagateSizeAndStyleToComponents(e, t) {
527
+ for (let n of e) n && (n.setSize(this.width, this.height, this.containerWidth, this.containerHeight), n.setContainerMargin(t), n.setColorFunction(this.config.colorFunction));
528
+ }
529
+ _render(e) {
530
+ let { config: t } = this;
531
+ C(this._container).attr("aria-label", t.ariaLabel), this._isFirstRender = !1;
532
+ }
533
+ render(e = this.config.duration) {
534
+ let t = this.config.width || this.containerWidth, n = this.config.height || this.containerHeight;
535
+ return this.svg.attr("width", t).attr("height", n), this._scheduleRender(e);
536
+ }
537
+ _scheduleRender(e) {
538
+ return this._resizeObserver || this._setUpResizeObserver(), cancelAnimationFrame(this._renderAnimationFrameId), this._renderPromise ||= new Promise((e) => {
539
+ this._renderPromiseResolve = e;
540
+ }), this._renderAnimationFrameId = requestAnimationFrame(() => {
541
+ this._preRender(), this._render(e), this._resolveRenderPromise();
542
+ }), this._renderPromise;
543
+ }
544
+ _resolveRenderPromise() {
545
+ this._renderPromiseResolve?.(), this._renderPromise = null, this._renderPromiseResolve = null;
546
+ }
547
+ get containerWidth() {
548
+ return this.config.width ? this.element.clientWidth || It(this.config.width) || 0 : this._container.clientWidth || this._container.getBoundingClientRect().width;
549
+ }
550
+ get containerHeight() {
551
+ return this.config.height ? this.element.clientHeight || It(this.config.height) || 0 : this._container.clientHeight || this._container.getBoundingClientRect().height || e.DEFAULT_CONTAINER_HEIGHT;
552
+ }
553
+ get width() {
554
+ return ft(this.containerWidth - this.config.margin.left - this.config.margin.right, 0, Infinity);
555
+ }
556
+ get height() {
557
+ return ft(this.containerHeight - this.config.margin.top - this.config.margin.bottom, 0, Infinity);
558
+ }
559
+ _removeAllChildren() {
560
+ for (; this.element.firstChild;) this.element.removeChild(this.element.firstChild);
561
+ }
562
+ _reconcileChildren(e) {
563
+ let t = e.filter(Boolean), n = new Set(t), r = this.element.firstChild;
564
+ for (; r;) {
565
+ let e = r.nextSibling;
566
+ n.has(r) || this.element.removeChild(r), r = e;
567
+ }
568
+ let i = this.element.firstChild;
569
+ for (let e of t) e === i ? i = i.nextSibling : this.element.insertBefore(e, i);
570
+ }
571
+ _getEffectiveSizing() {
572
+ return this.config.sizing;
573
+ }
574
+ _onResize() {
575
+ let e = this._getEffectiveSizing();
576
+ (e === V.Fit || e === V.FitWidth) && this.render(0);
577
+ }
578
+ _setUpResizeObserver() {
579
+ if (this._resizeObserver || !globalThis.ResizeObserver) return;
580
+ let e = this._container.getBoundingClientRect();
581
+ this._containerSize = {
582
+ width: e.width,
583
+ height: e.height
584
+ }, this._resizeObserver = new ResizeObserver((e, t) => {
585
+ cancelAnimationFrame(this._resizeObserverAnimationFrameId), this._resizeObserverAnimationFrameId = requestAnimationFrame(() => {
586
+ let e = this._container.getBoundingClientRect(), t = {
587
+ width: e.width,
588
+ height: e.height
589
+ };
590
+ !st(this._containerSize, t) && t.width && t.height && (this._containerSize = t, this._onResize());
591
+ });
592
+ }), this._resizeObserver.observe(this._container);
593
+ }
594
+ destroy() {
595
+ cancelAnimationFrame(this._renderAnimationFrameId), cancelAnimationFrame(this._resizeObserverAnimationFrameId), this._resizeObserver?.disconnect(), this.svg.remove(), this._resolveRenderPromise();
596
+ }
597
+ };
598
+ Rt.DEFAULT_CONTAINER_HEIGHT = 300;
599
+ var zt = Rt, Bt = "html[data-theme=\"dark\"],html.dark-theme,body.dark-theme,html.theme-dark,body.theme-dark", W = globalThis?.UNOVIS_COLORS || [
600
+ "#4D8CFD",
601
+ "#FF6B7E",
602
+ "#F4B83E",
603
+ "#A6CC74",
604
+ "#00C19A",
605
+ "#6859BE"
606
+ ], Vt = globalThis?.UNOVIS_COLORS_DARK || [
607
+ "#4D8CFD",
608
+ "#FF6B7E",
609
+ "#FFC16D",
610
+ "#A6CC74",
611
+ "#00C19A",
612
+ "#7887E0"
613
+ ], G = (e) => `--vis-${N(e) ? `color${e % W.length}` : e}`;
614
+ function Ht(e, t = .4) {
615
+ let n = le(e);
616
+ return n.l *= 1 + t, n.formatHex();
617
+ }
618
+ function Ut(e, t = .4, n = .6) {
619
+ let r = le(e);
620
+ return r.s *= 1 - n, r.l *= 1 - t, r.formatHex();
621
+ }
622
+ var Wt = [
623
+ {
624
+ id: "stripes-diagonal",
625
+ svg: "<path d=\"M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2\" stroke=\"#000\"/>"
626
+ },
627
+ {
628
+ id: "dots",
629
+ svg: "<path d=\"m0-1.5a1 1 0 010 3m10-3a1 1 0 000 3M5 3.5a1 1 0 010 3 1 1 0 010-3M0 8.5 a1 1 0 010 3m10-3a1 1 0 000 3\" fill\"#000\"/>"
630
+ },
631
+ {
632
+ id: "stripes-vertical",
633
+ svg: "<path d=\"M 5,-1 L5,11\" stroke=\"#000\"/>"
634
+ },
635
+ {
636
+ id: "crosshatch",
637
+ svg: "<path d=\"M0 0L10 10ZM10 0L0 10Z\" stroke=\"#000\"/>"
638
+ },
639
+ {
640
+ id: "waves",
641
+ svg: "<path d=\"M0 4Q2.5 1 5 4 7.5 7 10 4v2Q7.5 9 5 6 2.5 3 0 6Z\" fill=\"#000\"/>"
642
+ },
643
+ {
644
+ id: "circles",
645
+ svg: "<circle cx=\"5\" cy=\"5\" r=\"3\" stroke=\"#000\" fill=\"#fff\"/>"
646
+ }
647
+ ], Gt = [
648
+ {
649
+ id: "circle",
650
+ marker: "<circle cx=\"5\" cy=\"5\" r=\"5\"/>",
651
+ dashArray: []
652
+ },
653
+ {
654
+ id: "triangle",
655
+ marker: "<path d=\"M5,0 L10,9 L0,9Z\">",
656
+ dashArray: [9, 1]
657
+ },
658
+ {
659
+ id: "diamond",
660
+ marker: "<path d=\"M 0 5 L5 0 L 10 5 L 5 10 L 0 5Z\">",
661
+ dashArray: [2]
662
+ },
663
+ {
664
+ id: "arrow",
665
+ marker: "<path d=\"M4 0 0 0 6 5 0 10 4 10 10 5Z\">",
666
+ dashArray: [
667
+ 2,
668
+ 3,
669
+ 8,
670
+ 3
671
+ ]
672
+ },
673
+ {
674
+ id: "square",
675
+ marker: "<rect x=\"1\" y=\"1\" width=\"8\" height=\"8\"/>",
676
+ dashArray: [6]
677
+ },
678
+ {
679
+ id: "star",
680
+ marker: "<path d=\"m2 9 3-9 3 9L0 3h10Z\"/>",
681
+ dashArray: [1, 6]
682
+ }
683
+ ], Kt = new Map(Wt.map((e) => [e.id, e])), qt = new Map(Gt.map((e) => [e.id, e]));
684
+ function K(e) {
685
+ return `vis-${`pattern-${e.svg ? "fill" : "marker"}`}-${e.id}`;
686
+ }
687
+ function Jt(e) {
688
+ return `vis-pattern-fill-${e}`;
689
+ }
690
+ function Yt(e) {
691
+ return `vis-pattern-marker-${e}`;
692
+ }
693
+ function Xt(e) {
694
+ return `vis-pattern-marker-ctx-${e}`;
695
+ }
696
+ function Zt(e) {
697
+ return Kt.get(e) ?? qt.get(e) ?? null;
698
+ }
699
+ var Qt = (e) => `<mask id="${Jt(e.id)}">
700
+ <pattern id="vis-pattern-tile-${e.id}" viewBox="0 0 10 10" width="10" height="10" patternUnits="userSpaceOnUse">
701
+ <rect width="10" height="10" fill="#fff"/>
702
+ ${e.svg}
703
+ </pattern>
704
+ <rect x="-100000" y="-100000" width="200000" height="200000" fill="url(#vis-pattern-tile-${e.id})"/>
705
+ </mask>`, $t = (e, t) => `<marker id="${Yt(e.id)}"
706
+ fill="var(${G(t)})"
707
+ markerUnits="userSpaceOnUse"
708
+ refX="5"
709
+ refY="5"
710
+ markerWidth="10"
711
+ markerHeight="10">
712
+ ${e.marker}
713
+ </marker>`, en = (e) => `<marker id="${Xt(e.id)}"
714
+ fill="context-stroke"
715
+ markerUnits="userSpaceOnUse"
716
+ refX="5"
717
+ refY="5"
718
+ markerWidth="10"
719
+ markerHeight="10">
720
+ ${e.marker}
721
+ </marker>`;
722
+ function tn() {
723
+ let e = Gt.map((e, t) => $t(e, t)).concat(Gt.map(en)), t = Wt.map(Qt).concat(e).join(""), n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
724
+ n.setAttribute("height", "0"), n.setAttribute("width", "0"), n.style.position = "fixed", n.style.zIndex = "-99999999", n.innerHTML = `<defs>${t}</defs>`, document.body.appendChild(n);
725
+ }
726
+ typeof window < "u" && tn();
727
+ // node_modules/@unovis/ts/utils/color.js
728
+ var nn = s().range(Array.from({ length: W.length }, (e, t) => `var(${G(t)})`)).domain(Array.from({ length: W.length }, (e, t) => t));
729
+ function q(e, t, n, r, i) {
730
+ if (Array.isArray(t) && isFinite(n)) return t[n % t.length];
731
+ let a;
732
+ if (a = nt(t) ? t(e, n, r) : t, a) return a;
733
+ let o = i?.colorFn ?? nn;
734
+ if (typeof r == "string" && r) return o(r);
735
+ let s = i?.dontFallbackToCssVar ?? r === !0;
736
+ return N(n) && !s ? o(n % W.length) : null;
737
+ }
738
+ function rn(e) {
739
+ let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
740
+ return t ? {
741
+ r: parseInt(t[1], 16),
742
+ g: parseInt(t[2], 16),
743
+ b: parseInt(t[3], 16)
744
+ } : {
745
+ r: 0,
746
+ g: 0,
747
+ b: 0
748
+ };
749
+ }
750
+ function an(e) {
751
+ return (.2126 * e.r + .7152 * e.g + .0722 * e.b) / 255;
752
+ }
753
+ function on(e) {
754
+ return an(rn(e));
755
+ }
756
+ // node_modules/@unovis/ts/utils/pattern.js
757
+ var sn = "unovis-pattern-index";
758
+ function cn(e, t, n) {
759
+ let r = I(e, t, n);
760
+ return r ? Zt(r) : null;
761
+ }
762
+ function ln(e) {
763
+ return !e || !("svg" in e) ? null : `url(#${Jt(e.id)})`;
764
+ }
765
+ globalThis?.UNOVIS_ICON_FONT_FAMILY;
766
+ var un = globalThis?.UNOVIS_FONT_W2H_RATIO_DEFAULT || .5;
767
+ globalThis?.UNOVIS_TEXT_SEPARATOR_DEFAULT, globalThis?.UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT;
768
+ var dn = globalThis?.UNOVIS_TEXT_DEFAULT_FONT_SIZE || 12, fn = globalThis?.UNOVIS_TEXT_DEFAULT || {
769
+ text: "",
770
+ fontSize: dn,
771
+ fontFamily: "var(--vis-font-family)",
772
+ lineHeight: 1.25,
773
+ marginTop: 0,
774
+ marginBottom: 0
775
+ };
776
+ wt`
777
+ :root {
778
+ label: vis-root-styles;
779
+ --vis-font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
780
+ --vis-font-wh-ratio: ${un};
781
+ --vis-color-main: var(${G(0)});
782
+ --vis-color-main-light: ${Ht(W[0])};
783
+ --vis-color-main-dark: ${Ut(W[0])};
784
+ --vis-color-grey: #2a2a2a;
785
+ ${W.map((e, t) => `${G(t)}: ${e};`)}
786
+ ${Vt.map((e, t) => `--vis-dark-color${t}: ${e};`)}
787
+ ${Wt.map((e, t) => `
788
+ --${K(e)}: url(#${K(e)});
789
+ --vis-pattern-fill${t}: var(--${K(e)});
790
+ `)}
791
+ ${Gt.map((e, t) => `
792
+ --${K(e)}: url(#${K(e)});
793
+ --vis-pattern-marker${t}: var(--${K(e)});
794
+ --vis-pattern-dasharray${t}: ${e.dashArray?.join(" ")};
795
+ `)}
796
+ }
797
+
798
+ ${Bt} {
799
+ ${W.map((e, t) => `${G(t)}: var(--vis-dark-color${t});`)}
800
+ }
801
+
802
+ body.theme-patterns {
803
+ ${Wt.map((e, t) => `path[${sn}="${t}"][style*="fill"]:not([style*="mask"]) {
804
+ mask: var(--vis-pattern-fill${t});
805
+ }`)}
806
+ ${Gt.map((e, t) => `
807
+ path[${sn}="${t}"]:not([style*="fill"]):not([style*="marker"]) {
808
+ marker: var(--vis-pattern-marker${t});
809
+ stroke-dasharray: var(--vis-pattern-dasharray${t});
810
+ }
811
+ `)}
812
+ }
813
+ `;
814
+ function pn(e = window?.document.body) {
815
+ return e ? +Pt("var(--vis-font-wh-ratio)", e) : un;
816
+ }
817
+ // node_modules/@unovis/ts/types/text.js
818
+ var mn = /* @__PURE__ */ ((e) => (e.Start = "start", e.Middle = "middle", e.End = "end", e))(mn || {}), hn = 5e3;
819
+ function gn(e, t, n) {
820
+ if (e.size >= hn && !e.has(t)) {
821
+ let t = e.keys().next().value;
822
+ t !== void 0 && e.delete(t);
823
+ }
824
+ e.set(t, n);
825
+ }
826
+ // node_modules/@unovis/ts/utils/text-measure.js
827
+ var _n = "", vn = /* @__PURE__ */ new Map(), yn = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new Map(), xn = globalThis?.document?.createElement("canvas").getContext("2d") ?? null, Sn = (e, t) => `${t}${_n}${e}`;
828
+ function Cn() {
829
+ vn.clear(), bn.clear();
830
+ }
831
+ globalThis?.document?.fonts?.addEventListener?.("loadingdone", Cn);
832
+ function wn(e, t, n = pn()) {
833
+ return e.length * t * n || 0;
834
+ }
835
+ function Tn(e, t) {
836
+ if (xn) return xn.font !== t && (xn.font = t), xn.measureText(e).width;
837
+ let n = /(\d*\.?\d+)(px|pt|pc|rem|em|ex|ch|cm|mm|in|vmin|vmax|vw|vh|%)/.exec(t)?.[0];
838
+ return wn(e, U(n) ?? dn, pn());
839
+ }
840
+ function En(e) {
841
+ let t = "", n = e;
842
+ for (; n && (t += `${_n}${n.getAttribute("class") || ""};${n.getAttribute("style") || ""}`, n.localName !== "svg");) n = n.parentElement;
843
+ return t;
844
+ }
845
+ function Dn(e) {
846
+ let t = yn.get(e);
847
+ if (t) return t;
848
+ let n = En(e);
849
+ if (t = bn.get(n), t) return yn.set(e, t), t;
850
+ let r = window.getComputedStyle(e), i = r.fontSize || `${dn}px`, a = r.fontFamily || "sans-serif";
851
+ return t = {
852
+ font: `${r.fontStyle || "normal"} ${r.fontWeight || "normal"} ${i} ${a}`,
853
+ fontFamily: a,
854
+ fontSizePx: U(i)
855
+ }, gn(bn, n, t), yn.set(e, t), t;
856
+ }
857
+ function On(e) {
858
+ let t = e.textContent || "", { font: n } = Dn(e), r = Sn(t, n), i = vn.get(r);
859
+ if (i !== void 0) return i;
860
+ let a = xn ? Tn(t, n) : e.getComputedTextLength();
861
+ return gn(vn, r, a), a;
862
+ }
863
+ // node_modules/@unovis/ts/utils/text.js
864
+ function kn(e, t = 15) {
865
+ return e ? e.length > t ? `…${e.substr(e.length - t, t)}` : e : "";
866
+ }
867
+ function An(e, t = 15) {
868
+ if (!e) return "";
869
+ let n = Math.floor((t - 3) / 2);
870
+ return e.length > t ? `${e.substr(0, n)}…${e.substr(-n, n)}` : e;
871
+ }
872
+ function jn(e, t = 15) {
873
+ return e ? e.length > t ? `${e.substr(0, t)}…` : e : "";
874
+ }
875
+ function Mn(e, t = 15, n = mn.Middle) {
876
+ if (!e) return "";
877
+ let r = jn(e, t);
878
+ return n === mn.Start ? r = kn(e, t) : n === mn.Middle && (r = An(e, t)), r;
879
+ }
880
+ function Nn(e, t = 50, n = mn.Middle, r = !1, i = U(window.getComputedStyle(e.node())?.fontSize || fn.fontSize), a = pn()) {
881
+ let o = e.text() || "", s = o.length;
882
+ if (!s) return !1;
883
+ if (r) {
884
+ let r = wn(o, i, a), c = Math.ceil(s * t / (1.1 * r));
885
+ return c < s && (e.text(Mn(o, c, n)), !0);
886
+ }
887
+ let c = e.node();
888
+ if (On(c) <= t) return !1;
889
+ let l = 0, u = s, d = 0;
890
+ for (; l <= u;) {
891
+ let r = l + u >> 1;
892
+ e.text(Mn(o, r, n)), On(c) <= t ? (d = r, l = r + 1) : u = r - 1;
893
+ }
894
+ return e.text(Mn(o, d, n)), !0;
895
+ }
896
+ // node_modules/@unovis/ts/utils/d3.js
897
+ function J(e, t, n) {
898
+ if (e.nodes().forEach((e) => ue(e)), t) {
899
+ let r = e.transition().duration(t);
900
+ return n && r.ease(n), r;
901
+ }
902
+ return e;
903
+ }
904
+ // node_modules/@unovis/ts/containers/single-container/config.js
905
+ var Pn = {
906
+ ...Lt,
907
+ tooltip: void 0,
908
+ annotations: void 0
909
+ }, Fn = class extends zt {
910
+ constructor(e, t, n) {
911
+ super(e), this._defaultConfig = Pn, this.config = this._defaultConfig, t && (this.updateContainer(t, !0), this.component = t.component), n && this.setData(n, !0), this.component?.datamodel.data && this.render();
912
+ }
913
+ setData(e, t) {
914
+ let { config: n } = this, r = this.component?.datamodel.data !== e;
915
+ this.component && this.component.setData(e), t || this.render(), r && n.tooltip?.hide();
916
+ }
917
+ updateContainer(e, t) {
918
+ super.updateContainer(e), this.component = e.component;
919
+ let n = e.tooltip;
920
+ if (n && (n.hasContainer() || n.setContainer(this._container), n.setComponents([this.component])), this._reconcileChildren([
921
+ this.component?.element,
922
+ e.annotations?.element,
923
+ this._svgDefs.node(),
924
+ this._svgDefsExternal.node()
925
+ ]), e.sizing && this.component) {
926
+ let t = this._getEffectiveSizing();
927
+ t !== e.sizing && console.warn(`Unovis | Single Container: The component doesn't support the '${e.sizing}' sizing mode because it doesn't report its own size. Falling back to '${t}'`), this.component.setSizing(t);
928
+ }
929
+ t || this.render();
930
+ }
931
+ updateComponent(e, t) {
932
+ this.component.setConfig(e), t || this.render();
933
+ }
934
+ update(e, t, n) {
935
+ e && this.updateContainer(e, !0), t && this.updateComponent(t, !0), n && this.setData(n, !0), this.render();
936
+ }
937
+ _getEffectiveSizing() {
938
+ let { sizing: e } = this.config;
939
+ return (e === V.Extend || e === V.FitWidth) && !Et(this.component) ? V.Fit : e;
940
+ }
941
+ getFitWidthScale() {
942
+ let { config: e, component: t } = this;
943
+ if (!Et(t)) return 1;
944
+ let n = t.getWidth() + e.margin.left + e.margin.right;
945
+ return this.width / n;
946
+ }
947
+ _preRender() {
948
+ let { config: e } = this;
949
+ super._preRender(), this._propagateSizeAndStyleToComponents([this.component, e.annotations], e.margin);
950
+ }
951
+ _render(e) {
952
+ let { config: t, component: n } = this;
953
+ super._render(e), n.g.attr("transform", `translate(${t.margin.left},${t.margin.top})`), n.render(e), t.annotations?.render(e), t.tooltip && t.tooltip.update(), t.onRenderComplete?.(this.svg.node(), t.margin, this.containerWidth, this.containerHeight, this.width, this.height);
954
+ }
955
+ render(e = this.config.duration) {
956
+ let { config: t, component: n } = this, r = this._getEffectiveSizing();
957
+ if ((r === V.Extend || r === V.FitWidth) && Et(n)) {
958
+ let i = r === V.FitWidth, a = n.getWidth() + t.margin.left + t.margin.right, o = n.getHeight() + t.margin.top + t.margin.bottom, s = i ? this.getFitWidthScale() : 1, c = this.svg.attr("width"), l = this.svg.attr("height"), u = a * s, d = o * s, f = c || l;
959
+ J(this.svg, f ? e : 0).attr("width", u).attr("height", d).attr("viewBox", `0 0 ${a} ${i ? d : o}`).attr("preserveAspectRatio", "xMinYMin");
960
+ } else this.svg.attr("width", this.config.width || this.containerWidth).attr("height", this.config.height || this.containerHeight);
961
+ return this._scheduleRender(e);
962
+ }
963
+ _onResize() {
964
+ let { config: e } = this;
965
+ super._onResize(), e.tooltip?.hide();
966
+ }
967
+ destroy() {
968
+ let { component: e, config: t } = this;
969
+ super.destroy(), e?.destroy(), t.tooltip?.destroy(), t.annotations?.destroy();
970
+ }
971
+ }, In = {
972
+ duration: 600,
973
+ events: {},
974
+ attributes: {}
975
+ }, Ln = class {
976
+ get data() {
977
+ return this._data;
978
+ }
979
+ set data(e) {
980
+ this._data = e;
981
+ }
982
+ constructor(e) {
983
+ this.data = e;
984
+ }
985
+ }, Rn = class {
986
+ constructor(e = Tt.SVG) {
987
+ this.type = Tt.SVG, this.datamodel = new Ln(), this.sizing = V.Fit, this.events = {}, this._defaultConfig = In, this._width = 400, this._height = 200, this._containerWidth = void 0, this._containerHeight = void 0, this._containerMargin = {
988
+ top: 0,
989
+ bottom: 0,
990
+ left: 0,
991
+ right: 0
992
+ }, this._colorFunction = void 0, this._setUpComponentEventsThrottled = ut(this._setUpComponentEvents, 500), this._setCustomAttributesThrottled = ut(this._setCustomAttributes, 500), this.element = e === Tt.SVG ? document.createElementNS("http://www.w3.org/2000/svg", "g") : document.createElement("div"), this.uid = Mt(), this.g = C(this.element);
993
+ let t = this.constructor?.selectors?.root;
994
+ t && this.g.attr("class", t);
995
+ }
996
+ setContainerMargin(e) {
997
+ this._containerMargin = e;
998
+ }
999
+ setColorFunction(e) {
1000
+ this._colorFunction = e;
1001
+ }
1002
+ setSizing(e) {
1003
+ this.sizing = e;
1004
+ }
1005
+ setConfig(e) {
1006
+ this.prevConfig = this.config, this.config = ct(this._defaultConfig, e);
1007
+ }
1008
+ setData(e) {
1009
+ this.datamodel.data = e;
1010
+ }
1011
+ setSize(e, t, n, r) {
1012
+ isFinite(e) && (this._width = e), isFinite(t) && (this._height = t), isFinite(n) && (this._containerWidth = n), isFinite(r) && (this._containerHeight = r);
1013
+ }
1014
+ render(e = this.config.duration) {
1015
+ this._render(e);
1016
+ let t = "animating";
1017
+ e && (this.g.attr(t, ""), this.g.transition(t).duration(e).on("end interrupt", () => {
1018
+ this.g.attr(t, null);
1019
+ })), this._setUpComponentEventsThrottled(), this._setCustomAttributesThrottled();
1020
+ }
1021
+ get bleed() {
1022
+ return {
1023
+ top: 0,
1024
+ bottom: 0,
1025
+ left: 0,
1026
+ right: 0
1027
+ };
1028
+ }
1029
+ _render(e = this.config.duration) {}
1030
+ _setCustomAttributes() {
1031
+ let e = this.config.attributes;
1032
+ Object.keys(e).forEach((t) => {
1033
+ Object.keys(e[t]).forEach((n) => {
1034
+ this.g.selectAll(`.${t}`).attr(n, e[t][n]);
1035
+ });
1036
+ });
1037
+ }
1038
+ _setUpComponentEvents() {
1039
+ this._bindEvents(() => this.events), this._bindEvents(() => this.config.events, ".user");
1040
+ }
1041
+ _mapEventDatum(e, t) {
1042
+ return {
1043
+ datum: e,
1044
+ index: t
1045
+ };
1046
+ }
1047
+ _bindEvents(e, t = "") {
1048
+ let n = e() ?? {};
1049
+ Object.keys(n).forEach((r) => {
1050
+ Object.keys(n[r]).forEach((n) => {
1051
+ let i = this.g.selectAll(`.${r}`), a = i.nodes();
1052
+ i.on(n + t, (t, i) => {
1053
+ let o = e()?.[r]?.[n];
1054
+ if (!o) return;
1055
+ let s = a.indexOf(t.currentTarget), { datum: c, index: l } = this._mapEventDatum(i, s);
1056
+ return o(c, t, l, a);
1057
+ });
1058
+ });
1059
+ });
1060
+ }
1061
+ _onDestroy() {}
1062
+ destroy() {
1063
+ this.isDestroyed() || (this._onDestroy(), this.g?.remove(), this.element = void 0);
1064
+ }
1065
+ isDestroyed() {
1066
+ return !this.element;
1067
+ }
1068
+ }, zn = {
1069
+ M: ["x", "y"],
1070
+ L: ["x", "y"],
1071
+ C: [
1072
+ "x1",
1073
+ "y1",
1074
+ "x2",
1075
+ "y2",
1076
+ "x",
1077
+ "y"
1078
+ ],
1079
+ Q: [
1080
+ "x1",
1081
+ "y1",
1082
+ "x",
1083
+ "y"
1084
+ ],
1085
+ A: [
1086
+ "rx",
1087
+ "ry",
1088
+ "rotation",
1089
+ "largeArc",
1090
+ "sweep",
1091
+ "x",
1092
+ "y"
1093
+ ],
1094
+ Z: []
1095
+ }, Bn = /[A-Za-z]|[-+]?(?:\d*\.?\d+)(?:e[-+]?\d+)?/gi;
1096
+ // node_modules/@unovis/ts/utils/interpolate-path/index.js
1097
+ function Vn(e) {
1098
+ let t = (e || "").match(Bn) || [], n = [];
1099
+ for (let e = 0; e < t.length;) {
1100
+ let r = t[e++], i = zn[r].length;
1101
+ r === "M" && n.push({
1102
+ commands: [],
1103
+ closed: !1
1104
+ });
1105
+ let a = n[n.length - 1];
1106
+ r === "Z" ? a.closed = !0 : a.commands.push({
1107
+ type: r,
1108
+ values: t.slice(e, e + i).map(Number)
1109
+ }), e += i;
1110
+ }
1111
+ return n;
1112
+ }
1113
+ function Hn(e, t, n) {
1114
+ if (n === 1) return [t];
1115
+ if (t.type === "A") return [...Array.from({ length: n - 1 }, () => ({
1116
+ ...e,
1117
+ type: e.type === "M" ? "L" : e.type
1118
+ })), t];
1119
+ let r = [...e.values.slice(-2), ...t.values], i = Array.from({ length: r.length / 2 }, (e, t) => r.slice(t * 2, t * 2 + 2)), a = [];
1120
+ for (let e = n; e > 1; e--) {
1121
+ let n = i, r = [n[0]], o = [n[n.length - 1]];
1122
+ for (; n.length > 1;) n = n.slice(1).map((t, r) => t.map((t, i) => n[r][i] + (t - n[r][i]) / e)), r.push(n[0]), o.unshift(n[n.length - 1]);
1123
+ a.push({
1124
+ type: t.type,
1125
+ values: r.slice(1).flat()
1126
+ }), i = o;
1127
+ }
1128
+ return a.push({
1129
+ type: t.type,
1130
+ values: i.slice(1).flat()
1131
+ }), a;
1132
+ }
1133
+ function Un(e, t) {
1134
+ if (e.length === t) return e;
1135
+ if (e.length === 1) return [e[0], ...Array.from({ length: t - 1 }, () => ({
1136
+ type: "L",
1137
+ values: e[0].values
1138
+ }))];
1139
+ let n = Array(e.length - 1).fill(0);
1140
+ for (let r = 0; r < t - 1; r++) n[Math.floor(r * (e.length - 1) / (t - 1))]++;
1141
+ return [e[0], ...n.flatMap((t, n) => Hn(e[n], e[n + 1], t))];
1142
+ }
1143
+ function Wn(e, t) {
1144
+ if (e.type === t.type) return e.values;
1145
+ let n = zn[e.type];
1146
+ return zn[t.type].map((r, i) => {
1147
+ let a = n.indexOf(r);
1148
+ return a >= 0 ? e.values[a] : r[0] === "x" ? e.values[e.values.length - 2] : r[0] === "y" ? e.values[e.values.length - 1] : i < 2 ? 0 : t.values[i];
1149
+ });
1150
+ }
1151
+ function Gn(e, t) {
1152
+ let n = e?.commands.length ? e.commands : [t.commands[0]], r = t?.commands.length ? t.commands : [n[0]], i = Math.max(n.length, r.length), a = Un(n, i), o = Un(r, i), s = a.map((e, t) => Wn(e, o[t])), c = (!e || e.closed) && (!t || t.closed);
1153
+ return (e) => {
1154
+ let t = "";
1155
+ for (let n = 0; n < i; n++) {
1156
+ let r = o[n], i = r.values.map((t, i) => {
1157
+ let a = s[n][i] * (1 - e) + t * e;
1158
+ return r.type === "A" && (i === 3 || i === 4) ? Math.round(a) : a;
1159
+ });
1160
+ t += r.type + i.join(",");
1161
+ }
1162
+ return t + (c ? "Z" : "");
1163
+ };
1164
+ }
1165
+ function Kn(e, t) {
1166
+ if (e === t) return () => t || "";
1167
+ let n = Vn(e), r = Vn(t), i = Array.from({ length: Math.max(n.length, r.length) }, (e, t) => Gn(n[t], r[t]));
1168
+ return (e) => e === 1 ? t || "" : i.map((t) => t(e)).join("");
1169
+ }
1170
+ // node_modules/@unovis/ts/utils/path.js
1171
+ function qn(e, t) {
1172
+ return e.toString().replace(/L(?<x>-?\d*\.?\d*),(?<y>-?\d+\.?\d*)/gm, (e, n, r) => `A ${t} ${t} 0 0 0 ${n} ${r}`);
1173
+ }
1174
+ // node_modules/@unovis/ts/types/curve.js
1175
+ var Jn = {
1176
+ basis: ne,
1177
+ basisClosed: y,
1178
+ basisOpen: p,
1179
+ bundle: S,
1180
+ cardinal: re,
1181
+ cardinalClosed: h,
1182
+ cardinalOpen: b,
1183
+ catmullRom: ae,
1184
+ catmullRomClosed: g,
1185
+ catmullRomOpen: _,
1186
+ linear: te,
1187
+ linearClosed: v,
1188
+ monotoneX: oe,
1189
+ monotoneY: se,
1190
+ natural: m,
1191
+ step: f,
1192
+ stepAfter: u,
1193
+ stepBefore: l
1194
+ }, Y = /* @__PURE__ */ ((e) => (e.Along = "along", e.Perpendicular = "perpendicular", e))(Y || {}), Yn = class extends Ln {
1195
+ constructor() {
1196
+ super(...arguments), this._nodes = [], this._links = [], this._inputNodesMap = /* @__PURE__ */ new Map(), this._nodesMap = /* @__PURE__ */ new Map(), this._nodesByUserId = /* @__PURE__ */ new Map(), this._nodesByInputRef = /* @__PURE__ */ new Map(), this.nodeId = (e) => P(e.id) || isFinite(e.id) ? `${e.id}` : void 0, this.linkId = (e) => P(e.id) || isFinite(e.id) ? `${e.id}` : void 0;
1197
+ }
1198
+ getNodeById(e) {
1199
+ return this._nodesMap.get(e);
1200
+ }
1201
+ get data() {
1202
+ return this._data;
1203
+ }
1204
+ set data(e) {
1205
+ if (!e) return;
1206
+ this._data = e;
1207
+ let t = this.nodes, n = this.links;
1208
+ this._inputNodesMap.clear(), this._nodesMap.clear(), this._nodesByUserId.clear(), this._nodesByInputRef.clear();
1209
+ let r = (e?.nodes ?? []).map((e) => ({ ...e })), i = (e?.links ?? []).map((e) => ({ ...e }));
1210
+ this.transferState(r, t, this.nodeId), this.transferState(i, n, this.linkId), r.forEach((t, n) => {
1211
+ t._index = n, t._id = this.nodeId(t) || `${n}`, this._inputNodesMap.set(t, e.nodes[n]), this._nodesMap.set(t._id, t), this._nodesByInputRef.set(e.nodes[n], t);
1212
+ let r = this.nodeId(t);
1213
+ r !== void 0 && !this._nodesByUserId.has(r) && this._nodesByUserId.set(r, t);
1214
+ }), nt(this.nodeSort) && r.sort(this.nodeSort), i.forEach((e, t) => {
1215
+ e._indexGlobal = t, e.source = this.findNode(r, e.source), e.target = this.findNode(r, e.target);
1216
+ });
1217
+ let a = /* @__PURE__ */ new Map();
1218
+ for (let e of i) {
1219
+ let t = e.source?._index ?? -1, n = e.target?._index ?? -1, r = t <= n ? `${t}|${n}` : `${n}|${t}`, i = a.get(r);
1220
+ i ? i.push(e) : a.set(r, [e]);
1221
+ }
1222
+ a.forEach((e) => {
1223
+ if (e.every((e) => !rt(e._index) && !rt(e._neighbours))) return;
1224
+ let t = e[0];
1225
+ e.forEach((n, r) => {
1226
+ n._index = r, n._id = this.linkId(n) || `${n.source?._id}-${n.target?._id}-${r}`, n._neighbours = e.length, n._direction = t.source === n.source && t.target === n.target ? 1 : -1;
1227
+ });
1228
+ });
1229
+ let o = /* @__PURE__ */ new Map();
1230
+ r.forEach((e) => o.set(e, []));
1231
+ for (let e of i) e.source && o.get(e.source)?.push(e), e.target && e.target !== e.source && o.get(e.target)?.push(e);
1232
+ r.forEach((e) => {
1233
+ e.links = o.get(e), e._isConnected = e.links.length !== 0;
1234
+ }), this._nonConnectedNodes = r.filter((e) => !e._isConnected), this._connectedNodes = r.filter((e) => e._isConnected), this._nodes = r, this._links = i.filter((e) => e.source === e.target ? (console.warn(`Unovis | Graph Data Model: Skipping link ${e._id} because it has the same source and target`), !1) : e.source && e.target);
1235
+ }
1236
+ get nodes() {
1237
+ return this._nodes;
1238
+ }
1239
+ get links() {
1240
+ return this._links;
1241
+ }
1242
+ get connectedNodes() {
1243
+ return this._connectedNodes;
1244
+ }
1245
+ get nonConnectedNodes() {
1246
+ return this._nonConnectedNodes;
1247
+ }
1248
+ findNode(e, t) {
1249
+ let n;
1250
+ return N(t) ? n = e[t] : P(t) ? n = this._nodesByUserId.get(t) : at(t) && (n = this._nodesByInputRef.get(t) ?? e.find((e) => st(this._inputNodesMap.get(e), t))), n || console.warn(`Unovis | Graph Data Model: Node ${t} is missing from the nodes list`), n;
1251
+ }
1252
+ transferState(e, t, n) {
1253
+ let r = /* @__PURE__ */ new Map();
1254
+ for (let e of t) {
1255
+ let t = n(e);
1256
+ r.has(t) || r.set(t, e);
1257
+ }
1258
+ for (let t of e) {
1259
+ let e = r.get(n(t));
1260
+ t._state = e ? { ...e._state } : {};
1261
+ }
1262
+ }
1263
+ setNodeStateById(e, t) {
1264
+ let n = this.getNodeById(e);
1265
+ n ? n._state = t : console.warn(`Unovis | Graph Data Model: Node ${e} not found`);
1266
+ }
1267
+ }, Xn = {
1268
+ ...In,
1269
+ duration: 800,
1270
+ highlightedNodeId: void 0,
1271
+ highlightedLinkIds: [],
1272
+ linkColor: void 0,
1273
+ linkPattern: void 0,
1274
+ linkValue: (e) => e.value,
1275
+ nodeLevels: [],
1276
+ nodeWidth: 15,
1277
+ nodeColor: (e) => e.color,
1278
+ nodePattern: void 0,
1279
+ nodeLabel: (e) => e.label ?? e.key,
1280
+ nodeLabelColor: void 0,
1281
+ nodeLabelAlignment: Y.Along,
1282
+ padAngle: .02,
1283
+ cornerRadius: 2,
1284
+ angleRange: [0, 2 * Math.PI],
1285
+ radiusScaleExponent: 2
1286
+ };
1287
+ // node_modules/@unovis/ts/components/chord-diagram/modules/node.js
1288
+ function Zn(e) {
1289
+ e.style("opacity", 0).each((e, t, n) => {
1290
+ let r = n[t], i = (e.x0 + e.x1) / 2, a = (e.x1 - e.x0) / 2;
1291
+ r._animState = {
1292
+ x0: i - a * .8,
1293
+ x1: i + a * .8,
1294
+ y0: e.y0,
1295
+ y1: e.y1
1296
+ };
1297
+ });
1298
+ }
1299
+ function Qn(e, t, n, r) {
1300
+ let i = (e) => q(e.data, t.nodeColor, e.height);
1301
+ e.attr("id", (e) => e.uid).style("transition", `fill ${r}ms`).style("fill", i).style("stroke", i).style("mask", (e) => ln(cn(e.data, t.nodePattern, e.height))), r ? J(e, r).style("opacity", 1).attrTween("d", (e, t, r) => {
1302
+ let i = r[t], o = {
1303
+ x0: e.x0,
1304
+ x1: e.x1,
1305
+ y0: e.y0,
1306
+ y1: e.y1
1307
+ }, s = a(i._animState, o);
1308
+ return (e) => (i._animState = s(e), n(i._animState));
1309
+ }) : e.attr("d", (e) => n(e)).style("opacity", 1);
1310
+ }
1311
+ function $n(e, t) {
1312
+ J(e, t).style("opacity", 0).remove();
1313
+ }
1314
+ // node_modules/@unovis/ts/components/chord-diagram/style.js
1315
+ var er = /* @__PURE__ */ fe({
1316
+ background: () => rr,
1317
+ highlightedLink: () => fr,
1318
+ highlightedNode: () => cr,
1319
+ label: () => lr,
1320
+ labelExit: () => dr,
1321
+ labelText: () => ur,
1322
+ labels: () => or,
1323
+ link: () => X,
1324
+ links: () => ar,
1325
+ node: () => sr,
1326
+ nodes: () => ir,
1327
+ root: () => tr,
1328
+ transparent: () => pr,
1329
+ variables: () => nr
1330
+ }), tr = B`
1331
+ label: chord-diagram-component;
1332
+ `, nr = wt`
1333
+ :root {
1334
+ --vis-chord-diagram-link-fill-color: #cad5f6;
1335
+ --vis-chord-diagram-link-stroke-color: #777777;
1336
+ --vis-chord-diagram-link-opacity: 0.5;
1337
+ --vis-chord-diagram-link-stroke-opacity: 0.15;
1338
+ --vis-chord-diagram-link-highlighted-opacity: 0.9;
1339
+ --vis-chord-diagram-link-dimmed-opacity: 0.25;
1340
+
1341
+ --vis-chord-diagram-node-highlighted-opacity: 0.9;
1342
+ --vis-chord-diagram-node-dimmed-opacity: 0.25;
1343
+
1344
+ --vis-chord-diagram-label-text-fill-color-bright: #ffffff;
1345
+ --vis-chord-diagram-label-text-fill-color-dark: #a5abb2;
1346
+ --vis-chord-diagram-label-text-font-size: 1em;
1347
+
1348
+ --vis-dark-chord-diagram-link-fill-color: #575c65;
1349
+ }
1350
+
1351
+ ${Bt} ${`.${tr}`} {
1352
+ --vis-chord-diagram-link-fill-color: var(--vis-dark-chord-diagram-link-fill-color);
1353
+ }
1354
+ `, rr = B`
1355
+ label: background;
1356
+ `, ir = B`
1357
+ label: nodes;
1358
+ `, ar = B`
1359
+ label: links;
1360
+ `, or = B`
1361
+ label: labels;
1362
+ `, sr = B`
1363
+ label: node;
1364
+ stroke-width: 0;
1365
+ fill: var(--vis-color-main);
1366
+ stroke: var(--vis-color-main);
1367
+ transition: .1s fill-opacity;
1368
+ `, cr = B`
1369
+ label: highlighted;
1370
+ fill-opacity: var(--vis-chord-diagram-node-highlighted-opacity);
1371
+ stroke-width: 1.5;
1372
+ `, lr = B`
1373
+ label: label;
1374
+ `, ur = B`
1375
+ label: label-text;
1376
+
1377
+ dominant-baseline: middle;
1378
+ user-select: none;
1379
+ font-size: var(--vis-chord-diagram-label-text-font-size);
1380
+
1381
+ > textPath {
1382
+ dominant-baseline: central;
1383
+ }
1384
+ `, dr = B`
1385
+ label: label-exit;
1386
+ `, X = B`
1387
+ label: link;
1388
+
1389
+ fill: var(--vis-chord-diagram-link-fill-color);
1390
+ fill-opacity: var(--vis-chord-diagram-link-opacity);
1391
+ stroke: var(--vis-chord-diagram-link-stroke-color);
1392
+ stroke-opacity: var(--vis-chord-diagram-link-stroke-opacity);
1393
+ transition: .1s fill-opacity;
1394
+ `, fr = B`
1395
+ label: highlighted;
1396
+ fill-opacity: var(--vis-chord-diagram-link-highlighted-opacity);
1397
+ `, pr = B`
1398
+ label: transparent;
1399
+
1400
+ ${`.${X}`}:not(${`.${fr}`}) {
1401
+ fill-opacity: var(--vis-chord-diagram-link-dimmed-opacity);
1402
+ }
1403
+
1404
+ ${`.${sr}`}:not(${`.${cr}`}) {
1405
+ fill-opacity: var(--vis-chord-diagram-node-dimmed-opacity);
1406
+ }
1407
+ `;
1408
+ function mr(e, t) {
1409
+ switch (I(e.data, t.nodeLabelAlignment) ?? Y.Along) {
1410
+ case Y.Perpendicular: return q(e.data, t.nodeColor, e.height);
1411
+ case Y.Along: {
1412
+ let n = q(e.data, t.nodeColor, e.height), r = ce(n);
1413
+ return (r ? on(r.hex()) : 0) > .65 ? "var(--vis-chord-diagram-label-text-fill-color-dark)" : "var(--vis-chord-diagram-label-text-fill-color-bright)";
1414
+ }
1415
+ }
1416
+ }
1417
+ function hr(e, t) {
1418
+ switch (I(e.data, t.nodeLabelAlignment) ?? Y.Along) {
1419
+ case Y.Perpendicular: return (e.x0 + e.x1) / 2 * 180 / Math.PI < 180 ? "start" : "end";
1420
+ case Y.Along: return null;
1421
+ }
1422
+ }
1423
+ function gr(e, t, n) {
1424
+ switch (I(e.data, t.nodeLabelAlignment) ?? Y.Along) {
1425
+ case Y.Perpendicular: {
1426
+ let t = n(e.y1) + 3, r = (e.x0 + e.x1) / 2 - Math.PI / 2;
1427
+ return `translate(${t * Math.cos(r)}, ${t * Math.sin(r)})`;
1428
+ }
1429
+ case Y.Along: return null;
1430
+ }
1431
+ }
1432
+ function _r(e, t, n) {
1433
+ e.style("opacity", 0).attr("transform", (e) => gr(e, t, n)), e.append("text").attr("class", ur).style("fill", (e) => q(e.data, t.nodeColor, e.height));
1434
+ }
1435
+ function vr(e, t, n, r, i) {
1436
+ let { nodeLabel: a, nodeLabelColor: o, nodeWidth: s } = t;
1437
+ J(e, i).attr("transform", (e) => gr(e, t, r)).style("opacity", 1);
1438
+ let c = e.select(`.${ur}`);
1439
+ c.selectAll("textPath").remove(), c.text((e) => dt(e.data, a)).style("transition", `fill ${i}ms`).style("fill", (e) => q(e.data, o) ?? mr(e, t)).style("text-anchor", (e) => hr(e, t)).each((e, i, a) => {
1440
+ let o = I(e.data, t.nodeLabelAlignment) ?? Y.Along, c = e.x1 - e.x0 - L(e.data, t.padAngle) * 2, l = (r(e.y1) - L(e, t.nodeWidth) / 2) * c, u = o === Y.Along ? l : n - 6, d = C(a[i]).call(Nn, u).attr("dx", o === Y.Along ? 3 : null).attr("dy", o === Y.Along ? L(e.data, s) / 2 : null), f = On(d.node()), p = d.text();
1441
+ o === Y.Along && (d.text(""), f <= u && d.append("textPath").attr("href", `#${e.uid}`).text(p));
1442
+ }), J(c, i).attr("transform", (e) => {
1443
+ if (I(e.data, t.nodeLabelAlignment) !== Y.Perpendicular) return null;
1444
+ let n = (e.x0 + e.x1) / 2 * 180 / Math.PI;
1445
+ return `rotate(${n < 180 ? n - 90 : n + 90})`;
1446
+ });
1447
+ }
1448
+ function yr(e, t) {
1449
+ J(e, t).style("opacity", 0).remove();
1450
+ }
1451
+ // node_modules/@unovis/ts/components/chord-diagram/modules/layout.js
1452
+ function br(e) {
1453
+ let { height: t, depth: n } = e;
1454
+ if (t > 0) {
1455
+ let r = e.data, i = e;
1456
+ i.data = {
1457
+ key: r[0],
1458
+ values: r[1],
1459
+ depth: n,
1460
+ height: t,
1461
+ ancestors: i.ancestors().map((e) => e.data.key)
1462
+ };
1463
+ }
1464
+ }
1465
+ function xr(e, t, n = []) {
1466
+ let r = n.map((e) => (t) => t[e]), a = n.length ? Ze(e, ...r) : {
1467
+ key: "root",
1468
+ children: e
1469
+ };
1470
+ return i(a).sum((e) => L(e, t)).each(br);
1471
+ }
1472
+ function Sr(e, t, n = .95) {
1473
+ if (!e.children) return;
1474
+ let r = e.value > 0, i = e.x1 - e.x0, a = i * (e.y0 === 0 ? 1 : n), o = i - a, s = r ? t : a / e.children.length, c = d().startAngle(e.x0 + o / 2).endAngle(e.x1 - o / 2).padAngle(s).value((e) => r ? e.value : 1).sort((t, n) => e.children.indexOf(t) - e.children.indexOf(n))(e.children);
1475
+ e.children.forEach((e, i) => {
1476
+ let a = c[i].startAngle, o = c[i].endAngle, s = (o - a) * (1 - n), l = (a + o) / 2;
1477
+ e.x0 = r ? a + s / 2 : l - t / 2, e.x1 = r ? o - s / 2 : l + t / 2;
1478
+ });
1479
+ }
1480
+ function Cr(e, t, n) {
1481
+ let r = lt(t, (e) => e.source._id), i = lt(t, (e) => e.target._id), a = e.leaves(), o = Qe(a, (e) => e.data._id), s = (e, t, n, r = []) => (r[e.height] = e, r[n * 2 - t.height] = t, e.parent && t.parent && s(e.parent, t.parent, n, r), r), c = (e, t, r, i) => {
1482
+ e.forEach((e) => {
1483
+ e._state.points || (e._state.points = []);
1484
+ let a = o.get(e.source._id), c = o.get(e.target._id), l = s(t === "out" ? a : c, t === "out" ? c : a, i)[r], u = l.x1 - l.x0 - n, d = l._prevX1 ?? l.x0 + n / 2, f = d + u * e._state.value / l.value;
1485
+ l._prevX1 = f;
1486
+ let p = t === "out" ? r : i * 2 - 1 - r;
1487
+ e._state.points[p] = {
1488
+ a0: d,
1489
+ a1: f,
1490
+ r: l.y1
1491
+ };
1492
+ });
1493
+ };
1494
+ return a.forEach((e) => {
1495
+ let t = r[e.data._id] || [], n = i[e.data._id] || [];
1496
+ for (let r = 0; r < e.depth; r += 1) c(t, "out", r, e.depth), c(n, "in", r, e.depth);
1497
+ }), t.map((e) => ({
1498
+ source: o.get(e.source._id),
1499
+ target: o.get(e.target._id),
1500
+ data: e,
1501
+ points: e._state.points,
1502
+ _state: {}
1503
+ }));
1504
+ }
1505
+ // node_modules/d3-chord/dist/d3-chord.mjs
1506
+ var wr = Math.abs, Z = Math.cos, Q = Math.sin, Tr = Math.PI, Er = Tr / 2;
1507
+ Tr * 2;
1508
+ var Dr = 1e-12, Or = Array.prototype.slice;
1509
+ function $(e) {
1510
+ return function() {
1511
+ return e;
1512
+ };
1513
+ }
1514
+ function kr(e) {
1515
+ return e.source;
1516
+ }
1517
+ function Ar(e) {
1518
+ return e.target;
1519
+ }
1520
+ function jr(e) {
1521
+ return e.radius;
1522
+ }
1523
+ function Mr(e) {
1524
+ return e.startAngle;
1525
+ }
1526
+ function Nr(e) {
1527
+ return e.endAngle;
1528
+ }
1529
+ function Pr() {
1530
+ return 0;
1531
+ }
1532
+ function Fr(e) {
1533
+ var t = kr, n = Ar, r = jr, i = jr, a = Mr, o = Nr, s = Pr, c = null;
1534
+ function l() {
1535
+ var l, u = t.apply(this, arguments), d = n.apply(this, arguments), f = s.apply(this, arguments) / 2, p = Or.call(arguments), m = +r.apply(this, (p[0] = u, p)), h = a.apply(this, p) - Er, g = o.apply(this, p) - Er, _ = +i.apply(this, (p[0] = d, p)), v = a.apply(this, p) - Er, y = o.apply(this, p) - Er;
1536
+ if (c ||= l = ee(), f > Dr && (wr(g - h) > f * 2 + Dr ? g > h ? (h += f, g -= f) : (h -= f, g += f) : h = g = (h + g) / 2, wr(y - v) > f * 2 + Dr ? y > v ? (v += f, y -= f) : (v -= f, y += f) : v = y = (v + y) / 2), c.moveTo(m * Z(h), m * Q(h)), c.arc(0, 0, m, h, g), h !== v || g !== y) {
1537
+ if (e) {
1538
+ var b = _ - +e.apply(this, arguments), x = (v + y) / 2;
1539
+ c.quadraticCurveTo(0, 0, b * Z(v), b * Q(v)), c.lineTo(_ * Z(x), _ * Q(x)), c.lineTo(b * Z(y), b * Q(y));
1540
+ } else c.quadraticCurveTo(0, 0, _ * Z(v), _ * Q(v)), c.arc(0, 0, _, v, y);
1541
+ }
1542
+ if (c.quadraticCurveTo(0, 0, m * Z(h), m * Q(h)), c.closePath(), l) return c = null, l + "" || null;
1543
+ }
1544
+ return e && (l.headRadius = function(t) {
1545
+ return arguments.length ? (e = typeof t == "function" ? t : $(+t), l) : e;
1546
+ }), l.radius = function(e) {
1547
+ return arguments.length ? (r = i = typeof e == "function" ? e : $(+e), l) : r;
1548
+ }, l.sourceRadius = function(e) {
1549
+ return arguments.length ? (r = typeof e == "function" ? e : $(+e), l) : r;
1550
+ }, l.targetRadius = function(e) {
1551
+ return arguments.length ? (i = typeof e == "function" ? e : $(+e), l) : i;
1552
+ }, l.startAngle = function(e) {
1553
+ return arguments.length ? (a = typeof e == "function" ? e : $(+e), l) : a;
1554
+ }, l.endAngle = function(e) {
1555
+ return arguments.length ? (o = typeof e == "function" ? e : $(+e), l) : o;
1556
+ }, l.padAngle = function(e) {
1557
+ return arguments.length ? (s = typeof e == "function" ? e : $(+e), l) : s;
1558
+ }, l.source = function(e) {
1559
+ return arguments.length ? (t = e, l) : t;
1560
+ }, l.target = function(e) {
1561
+ return arguments.length ? (n = e, l) : n;
1562
+ }, l.context = function(e) {
1563
+ return arguments.length ? (c = e ?? null, l) : c;
1564
+ }, l;
1565
+ }
1566
+ function Ir() {
1567
+ return Fr();
1568
+ }
1569
+ // node_modules/@unovis/ts/components/chord-diagram/modules/link.js
1570
+ function Lr() {
1571
+ return "M0,0 L0,0";
1572
+ }
1573
+ var Rr = Ir().source((e) => e[0]).target((e) => e[e.length - 1]).startAngle((e) => e.a0).endAngle((e) => e.a1), zr = x().curve(Jn.catmullRom.alpha(.5)).startAngle((e, t, n) => t < n.length / 2 ? e.a1 : e.a0).endAngle((e, t, n) => t < n.length / 2 ? e.a0 : e.a1);
1574
+ function Br(e, t) {
1575
+ let n = e.length === 2 ? Rr : zr;
1576
+ n.radius((e) => t(e.r));
1577
+ let r = n(e);
1578
+ if (e.length === 2) return r;
1579
+ let i = r.slice(0, -1);
1580
+ return qn(i.concat(`L${i.match(/M-?\d*\.?\d*[,\s*]-?\d*\.?\d*/)?.[0].slice(1)}`), Math.max(t(e[0].r), 0));
1581
+ }
1582
+ function Vr(e, t) {
1583
+ e.attr("d", (e) => Br(e.points, t) || Lr()).style("opacity", 0);
1584
+ }
1585
+ function Hr(e, t, n, r) {
1586
+ e.style("transition", `fill ${r}ms`).style("fill", (e) => q(e.data, t.linkColor)).style("stroke", (e) => q(e.data, t.linkColor)).style("mask", (e) => ln(cn(e.data, t.linkPattern)));
1587
+ let i = J(e, r).style("opacity", 1);
1588
+ r ? i.attrTween("d", (e, t, r) => Kn(C(r[t]).attr("d"), Br(e.points, n) || Lr())) : i.attr("d", (e) => Br(e.points, n) || Lr());
1589
+ }
1590
+ function Ur(e, t) {
1591
+ J(e, t).style("opacity", 0).remove();
1592
+ }
1593
+ // node_modules/@unovis/ts/components/chord-diagram/index.js
1594
+ var Wr = class t extends Rn {
1595
+ constructor(e) {
1596
+ super(), this._defaultConfig = Xn, this.config = this._defaultConfig, this.datamodel = new Yn(), this.arcGen = ie(), this.radiusScale = o(), this.events = {
1597
+ [t.selectors.node]: {
1598
+ mouseover: this._onNodeMouseOver.bind(this),
1599
+ mouseout: this._onNodeMouseOut.bind(this)
1600
+ },
1601
+ [t.selectors.link]: {
1602
+ mouseover: this._onLinkMouseOver.bind(this),
1603
+ mouseout: this._onLinkMouseOut.bind(this)
1604
+ },
1605
+ [t.selectors.label]: {
1606
+ mouseover: this._onNodeMouseOver.bind(this),
1607
+ mouseout: this._onNodeMouseOut.bind(this)
1608
+ }
1609
+ }, this._nodes = [], this._links = [], this.setConfig(e), this.background = this.g.append("rect").attr("class", rr), this.linkGroup = this.g.append("g").attr("class", ar), this.nodeGroup = this.g.append("g").attr("class", ir), this.labelGroup = this.g.append("g").attr("class", or);
1610
+ }
1611
+ get _forceHighlight() {
1612
+ return this.config.highlightedNodeId !== void 0 || this.config.highlightedLinkIds?.length > 0;
1613
+ }
1614
+ get bleed() {
1615
+ let { config: e } = this, t = 0, n = 0, r = 0, i = 0;
1616
+ return this._nodes.forEach((a) => {
1617
+ let o = I(a.data, e.nodeLabelAlignment);
1618
+ if (a.height === 0 && o === Y.Perpendicular) {
1619
+ let o = wn(dt(a.data, e.nodeLabel) ?? "", Ft("var(--vis-chord-diagram-label-text-font-size)", this.element)), [s, c] = this.arcGen.centroid(a);
1620
+ s < 0 ? i = Math.max(i, o) : r = Math.max(r, o), c < 0 ? t = Math.max(t, o) : n = Math.max(n, o);
1621
+ }
1622
+ }), i += 6, r += 6, n += 6, t += 6, {
1623
+ top: t,
1624
+ bottom: n,
1625
+ left: i,
1626
+ right: r
1627
+ };
1628
+ }
1629
+ setSize(e, t, n, r) {
1630
+ super.setSize(e, t, n, r), this.radiusScale.exponent(this.config.radiusScaleExponent).range([0, Math.min(e, t) / 2]);
1631
+ }
1632
+ setData(e) {
1633
+ super.setData(e), this._layoutData();
1634
+ }
1635
+ _layoutData() {
1636
+ let { nodes: e } = this.datamodel, { links: t } = this.datamodel, { padAngle: n, linkValue: i, nodeLevels: a } = this.config;
1637
+ e.forEach((e) => {
1638
+ delete e._state.value;
1639
+ }), t.forEach((e) => {
1640
+ delete e._state.points, e._state.value = L(e, i), e.source._state.value = (e.source._state.value || 0) + L(e, i), e.target._state.value = (e.target._state.value || 0) + L(e, i);
1641
+ }), t = t.filter((e) => e._state.value);
1642
+ let o = xr(e, (e) => e._state?.value, a), s = r().size([this.config.angleRange[1], 1])(o);
1643
+ s.each((e, t) => {
1644
+ Sr(e, n), e.uid = `${this.uid.substr(0, 4)}-${t}`, e.x0 = Number.isNaN(e.x0) ? 0 : e.x0, e.x1 = Number.isNaN(e.x1) ? 0 : e.x1, e._state = {};
1645
+ });
1646
+ let c = s.descendants();
1647
+ this._rootNode = c.find((e) => e.depth === 0), this._nodes = c.filter((e) => e.depth !== 0), this._links = Cr(s, t, n);
1648
+ }
1649
+ _render(t) {
1650
+ super._render(t);
1651
+ let { config: n, bleed: r } = this;
1652
+ this._layoutData();
1653
+ let i = N(t) ? t : n.duration, a = Math.min(this._width, this._height), o = a / 2 - e([
1654
+ r.top,
1655
+ r.bottom,
1656
+ r.left,
1657
+ r.right
1658
+ ]), s = 1 + n.nodeLevels?.length, c = o > n.nodeWidth * s ? n.nodeWidth : Math.max(o / s, 0);
1659
+ this.radiusScale.range([0, Math.max(o, 0)]), this.arcGen.startAngle((e) => e.x0 + n.padAngle / 2 - (e.value ? 0 : Math.PI / 360)).endAngle((e) => e.x1 - n.padAngle / 2 + (e.value ? 0 : Math.PI / 360)).cornerRadius((e) => L(e.data, n.cornerRadius)).innerRadius((e) => Math.max(this.radiusScale(e.y1) - c, 0)).outerRadius((e) => this.radiusScale(e.y1)), this.g.classed(pr, this._forceHighlight), this.background.attr("width", this._width).attr("height", this._height).style("opacity", 0), this.nodeGroup.attr("transform", `translate(${this._width / 2},${this._height / 2})`), this.labelGroup.attr("transform", `translate(${this._width / 2},${this._height / 2})`), this.linkGroup.attr("transform", `translate(${this._width / 2},${this._height / 2})`);
1660
+ let l = this.linkGroup.selectAll(`.${X}`).data(this._links, (e) => String(e.data._id)), u = l.enter().append("path").attr("class", X).call(Vr, this.radiusScale);
1661
+ l.merge(u).classed(fr, (e) => {
1662
+ let t = e.data.id ?? e.data._indexGlobal;
1663
+ return n.highlightedLinkIds?.includes(t);
1664
+ }).call(Hr, n, this.radiusScale, i), l.exit().call(Ur, i);
1665
+ let d = this.nodeGroup.selectAll(`.${sr}`).data(this._nodes, (e) => String(e.uid)), f = d.enter().append("path").attr("class", sr).call(Zn);
1666
+ d.merge(f).classed(cr, (e) => n.highlightedNodeId === e.data._id).call(Qn, n, this.arcGen, i), d.exit().call($n, i);
1667
+ let p = a - o, m = this.labelGroup.selectAll(`.${lr}`).data(this._nodes, (e) => String(e.uid)), h = m.enter().append("g").attr("class", lr).call(_r, n, this.radiusScale);
1668
+ m.merge(h).call(vr, n, p, this.radiusScale, i), m.exit().attr("class", dr).call(yr, i);
1669
+ }
1670
+ _onNodeMouseOver(e) {
1671
+ let t;
1672
+ if (e.children) {
1673
+ let n = e.leaves();
1674
+ t = this._links.filter((e) => n.find((t) => e.source.data.id === t.data.id || e.target.data.id === t.data.id));
1675
+ } else {
1676
+ let n = e;
1677
+ t = this._links.filter((e) => e.source.data.id === n.data.id || e.target.data.id === n.data.id);
1678
+ }
1679
+ t.length || (e._state.hovered = !0), this._highlightOnHover(t);
1680
+ }
1681
+ _onNodeMouseOut() {
1682
+ this._highlightOnHover();
1683
+ }
1684
+ _onLinkMouseOver(e) {
1685
+ this._highlightOnHover([e]);
1686
+ }
1687
+ _onLinkMouseOut() {
1688
+ this._highlightOnHover();
1689
+ }
1690
+ _highlightOnHover(e) {
1691
+ this._forceHighlight || (e ? e.forEach((e) => {
1692
+ e._state.hovered = !0;
1693
+ let t = e.source.path(this._rootNode), n = e.target.path(this._rootNode);
1694
+ t.forEach((e) => {
1695
+ e.depth && (e._state.hovered = !0);
1696
+ }), n.forEach((e) => {
1697
+ e.depth && (e._state.hovered = !0);
1698
+ });
1699
+ }) : (this._nodes.forEach((e) => {
1700
+ delete e._state.hovered;
1701
+ }), this._links.forEach((e) => {
1702
+ delete e._state.hovered;
1703
+ })), this.nodeGroup.selectAll(`.${sr}`).classed(cr, (e) => e._state.hovered), this.linkGroup.selectAll(`.${X}`).classed(fr, (e) => e._state.hovered), this.g.classed(pr, !!e));
1704
+ }
1705
+ };
1706
+ Wr.selectors = er;
1707
+ var Gr = Wr, Kr = 16, qr = .02;
1708
+ function Jr(e, r, i = {}) {
1709
+ let a = i.colorModeId ?? "light", o = n[a], s = new Gr({
1710
+ linkColor: (n) => t(e.nodes.findIndex((e) => e.id === n.source), a),
1711
+ nodeColor: (e, n) => t(n, a),
1712
+ nodeLabel: (e) => "label" in e ? e.label : e.key,
1713
+ nodeLabelColor: o.primary,
1714
+ nodeWidth: i.nodeWidth ?? Kr,
1715
+ padAngle: i.padAngle ?? qr
1716
+ }), c = {
1717
+ links: e.links,
1718
+ nodes: e.nodes
1719
+ }, l = new Fn(r, { component: s }, c);
1720
+ return {
1721
+ resize: () => {
1722
+ l.render();
1723
+ },
1724
+ get svg() {
1725
+ return l.element;
1726
+ }
1727
+ };
1728
+ }
1729
+ export { Jr as renderChordDiagram };